powered by
Resamples historical scenarios with flexible probabilities.
bootstrap_scenarios(x, p, n)# S3 method for numeric bootstrap_scenarios(x, p, n)# S3 method for matrix bootstrap_scenarios(x, p, n)# S3 method for ts bootstrap_scenarios(x, p, n)# S3 method for xts bootstrap_scenarios(x, p, n)# S3 method for tbl bootstrap_scenarios(x, p, n)# S3 method for data.frame bootstrap_scenarios(x, p, n)
# S3 method for numeric bootstrap_scenarios(x, p, n)
# S3 method for matrix bootstrap_scenarios(x, p, n)
# S3 method for ts bootstrap_scenarios(x, p, n)
# S3 method for xts bootstrap_scenarios(x, p, n)
# S3 method for tbl bootstrap_scenarios(x, p, n)
# S3 method for data.frame bootstrap_scenarios(x, p, n)
A tibble with the number of rows equal to n.
tibble
n
A time series defining the scenario-probability distribution.
An object of the ffp class.
ffp
An integer scalar with the number of scenarios to be generated.
integer
The argument x is supposed to have the same size of p.
x
p
set.seed(123) ret <- diff(log(EuStockMarkets)) ew <- rep(1 / nrow(ret), nrow(ret)) bootstrap_scenarios(x = ret, p = as_ffp(ew), n = 10)
Run the code above in your browser using DataLab