View source: R/bootstrap_scenarios.R
bootstrap_scenarios | R Documentation |
Resamples historical scenarios with flexible probabilities.
bootstrap_scenarios(x, p, n) ## S3 method for class 'numeric' bootstrap_scenarios(x, p, n) ## S3 method for class 'matrix' bootstrap_scenarios(x, p, n) ## S3 method for class 'ts' bootstrap_scenarios(x, p, n) ## S3 method for class 'xts' bootstrap_scenarios(x, p, n) ## S3 method for class 'tbl' bootstrap_scenarios(x, p, n) ## S3 method for class 'data.frame' bootstrap_scenarios(x, p, n)
x |
A time series defining the scenario-probability distribution. |
p |
An object of the |
n |
An |
The argument x
is supposed to have the same size of p
.
A tibble
with the number of rows equal to n
.
set.seed(123) ret <- diff(log(EuStockMarkets)) ew <- rep(1 / nrow(ret), nrow(ret)) bootstrap_scenarios(x = ret, p = as_ffp(ew), n = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.