Skip to contents

From esg_simulate(). Each matrix has one row per path and one column per step from today (n_steps + 1 columns), except superimposed_excess(), one column per year.

Usage

esg_scenarios(ptr)

short_rates(x)

deflators(x)

bond_prices(x, maturity)

inflation_rates(x)

index_levels(x, index = "claims")

superimposed_excess(x)

scenario_curve(x, sim, step)

Arguments

ptr

Internal.

x

An esg_scenarios.

maturity

The maturity's position in x@maturities, from 1.

index

"claims" or "price".

sim

The path, from 1.

step

The step, from 0 (today) to x@n_steps.

Value

An esg_scenarios has properties n_sims, n_steps, step (its name), times (in years, from 0) and maturities.

Details

  • short_rates(): the short rate.

  • deflators(): the stochastic discount factor exp(-integral of r).

  • bond_prices(): the price of the zero-coupon bond of the maturity-th of x@maturities.

  • inflation_rates(): the economic inflation rate.

  • index_levels(): the level of the claims or price index, 1 today.

  • superimposed_excess(): the superimposed excess by year, years 1 to the horizon.

  • scenario_curve(): the annually compounded spot curve of path sim at step step (0 today), a list of maturities and rates.

Examples

model <- esg(vasicek(0.3, 0.04, 0.01, 0.02),
             inflation = esg_inflation(0.5, 0.025, 0.02, 0.03),
             step = "quarterly", maturities = c(1, 5))
sc <- esg_simulate(model, 3, 50, seed = 4)
sc@times[1:3]
#> [1] 0.00 0.25 0.50
dim(index_levels(sc, "price"))
#> [1] 50 13
scenario_curve(sc, 1, 0)
#> $maturities
#> [1] 1 5
#> 
#> $rates
#> [1] 0.02296761 0.02992468
#>