esg.Esg
An economic scenario generator: a short rate, and optionally economic
Usage
esg.Esg()and superimposed inflation with correlated shocks (docs/design/esg-dfa.md).
Parameters
rate: (Vasicek, Cir or HullWhite)-
The short rate model.
inflation: Inflationsuperimposed: Superimposedcorrelation: list of list of float-
The correlation of the shocks, in the order short rate, inflation, superimposed, for the models given; independent by default.
step: str = "monthly"-
"monthly","quarterly"or"annual". maturities: list of float- The maturities of the curve reported at each step.
Examples
>>> from prospicio.esg import Esg, Inflation, Vasicek
>>> esg = Esg(Vasicek(0.3, 0.04, 0.01, 0.02), inflation=Inflation(0.5, 0.025, 0.01, 0.03),
... correlation=[[1.0, 0.4], [0.4, 1.0]], step="annual")
>>> sc = esg.simulate(5, 100, seed=1)
>>> sc.short_rates().shape(100, 6)
Methods
| Name | Description |
|---|---|
| simulate() |
Simulate sims paths of years years from seed.
|
simulate()
Usage
simulate(years, sims, seed)Path s draws from its own stream, so a path is the same whatever the number of paths and threads.