An economic scenario generator
esg.RdA short rate, and optionally economic and superimposed inflation with
correlated shocks (docs/design/esg-dfa.md). esg_simulate() draws
sims paths of years years from seed; path s draws from its own
stream, so a path is the same whatever the number of paths.
Usage
esg(
rate,
inflation = NULL,
superimposed = NULL,
correlation = NULL,
step = "monthly",
maturities = NULL
)
esg_simulate(model, years, sims, seed)Arguments
- rate
A
vasicek(),cir()orhull_white().- inflation
An
esg_inflation(), orNULL.- superimposed
A
superimposed_inflation(), orNULL.- correlation
The correlation matrix of the shocks, in the order short rate, inflation, superimposed, for the models given; independent when
NULL.- step
"monthly","quarterly"or"annual".- maturities
The maturities of the curve reported at each step, or
NULL.- model
An
esg.- years, sims
The horizon in years and the number of paths.
- seed
The seed.
Value
esg(): an esg. esg_simulate(): an esg_scenarios.
Examples
model <- esg(vasicek(0.3, 0.04, 0.01, 0.02),
inflation = esg_inflation(0.5, 0.025, 0.01, 0.03),
correlation = matrix(c(1, 0.4, 0.4, 1), 2), step = "annual")
sc <- esg_simulate(model, 5, 100, seed = 1)
dim(short_rates(sc))
#> [1] 100 6