Simulated economic paths
esg_scenarios.RdFrom 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)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 factorexp(-integral of r).bond_prices(): the price of the zero-coupon bond of thematurity-th ofx@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 pathsimat stepstep(0 today), a list ofmaturitiesandrates.
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
#>