Simulation¶
simulate()¶
SimStMoMo
dataclass
¶
Result of simulating future mortality trajectories.
Attributes:
| Name | Type | Description |
|---|---|---|
fit |
FitStMoMo
|
The fitted model used to generate simulations. |
h |
int
|
Forecast horizon (number of future years). |
nsim |
int
|
Number of simulated sample paths. |
rates |
ndarray
|
Simulated mortality rates, shape (n_ages, h, nsim). For Poisson log link: central death rates μ_xt. For Binomial logit link: initial death probabilities q_xt. |
years_f |
ndarray
|
Future calendar years, shape (h,). |
ages |
ndarray
|
Age vector from the fitted model. |
kt_s |
ndarray
|
Simulated period indexes, shape (N, h, nsim). |
gc_s |
ndarray | None
|
Simulated cohort effects for new cohorts, shape (n_new_cohorts, nsim),
or |
seed |
int | None
|
Random seed used (for reproducibility). |
Source code in src/pystmomo/simulate/sim_result.py
SimStMoMo¶
Result of simulating future mortality trajectories.
Attributes:
| Name | Type | Description |
|---|---|---|
fit |
FitStMoMo
|
The fitted model used to generate simulations. |
h |
int
|
Forecast horizon (number of future years). |
nsim |
int
|
Number of simulated sample paths. |
rates |
ndarray
|
Simulated mortality rates, shape (n_ages, h, nsim). For Poisson log link: central death rates μ_xt. For Binomial logit link: initial death probabilities q_xt. |
years_f |
ndarray
|
Future calendar years, shape (h,). |
ages |
ndarray
|
Age vector from the fitted model. |
kt_s |
ndarray
|
Simulated period indexes, shape (N, h, nsim). |
gc_s |
ndarray | None
|
Simulated cohort effects for new cohorts, shape (n_new_cohorts, nsim),
or |
seed |
int | None
|
Random seed used (for reproducibility). |