bootstrap_scenarios function

Flexible Probabilities Driven Bootstrap

Flexible Probabilities Driven Bootstrap

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)

Arguments

  • x: A time series defining the scenario-probability distribution.
  • p: An object of the ffp class.
  • n: An integer scalar with the number of scenarios to be generated.

Returns

A tibble with the number of rows equal to n.

Details

The argument x is supposed to have the same size of p.

Examples

set.seed(123) ret <- diff(log(EuStockMarkets)) ew <- rep(1 / nrow(ret), nrow(ret)) bootstrap_scenarios(x = ret, p = as_ffp(ew), n = 10)
  • Maintainer: Bernardo Reckziegel
  • License: MIT + file LICENSE
  • Last published: 2022-09-29