bootstrap_scenarios: Flexible Probabilities Driven Bootstrap

View source: R/bootstrap_scenarios.R

bootstrap_scenariosR Documentation

Flexible Probabilities Driven Bootstrap

Description

Resamples historical scenarios with flexible probabilities.

Usage

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.

Details

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

Value

A tibble with the number of rows equal to n.

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)

ffp documentation built on Sept. 29, 2022, 5:10 p.m.