GARCH Simulation
Calculate a GARCH simulation of each asset: the spread of the returns (or the conditional volatility) a GARCH-family model fitted to its returns expects for the periods after the last return.
The paths are summarized per period: the mean and the 5th, 25th, 50th, 75th and 95th percentiles.
Unlike get_garch_forecast, which gives the expected variance, the simulation shows the whole spread of outcomes the model implies, including the fat tails and skewness of the innovation distribution and the way a large shock raises the volatility of the periods after it. The percentiles of the cumulative return give a GARCH-based Value at Risk over the horizon.
The formula is as follows, for \(h = 1\), …, forecast_steps:
Where n is the last return, \(\sigma_{n + 1}^{2}\) the one-step-ahead variance of the fitted model, z drawn from the fitted innovation distribution and Mean_(n+h) = 0, Mu, Mu + \(\text{AR} (1) \cdot r_{n + h - 1} + \text{MA} (1) \cdot e_{n + h - 1}\) or Mu + \(\text{Lambda} \cdot \sigma_{n + h}\) by the mean model (the last return and residual start the ARMA mean; the ARFIMA mean continues its fractional difference over every return). FIGARCH continues its sum over the squared residuals of the returns, and the realized GARCH draws its realized measure from the measurement equation with a normal error u ~ N(0, Sigma \(U^{2}\)). The cumulative return compounds the simulated returns, \((1 + r_{n + 1}) \cdot \ldots \cdot (1 + r_{n + h}) - 1\), treating them as simple returns.
With bootstrap fits, the bootstrap forecast density of Pascual, Romo and Ruiz (2006) replaces the fitted innovation distribution with the model’s own standardized residuals and adds the uncertainty of the estimated parameters:
- z*_t drawn with replacement from the standardized residuals \(z_{t}\) of the fit (and, for the realized GARCH, the measurement error of the same day)
- a series r_1, …, r_n as long as the returns simulated from the fitted parameters with those draws, starting after the last return, and the model fitted to it again,
bootstrap_fitstimes - every refitted model filters the actual returns to its own \(\sigma_{n + 1}^{2}\) and simulates
simulations/bootstrap_fitsof the paths from there with the resampled z* - no bootstrap fits (0) keeps the fitted parameters and only resamples the residuals (the partial bootstrap)
The spread of the first period’s volatility then shows the parameter uncertainty, which a simulation from the fitted parameters does not have.
Also known as: GARCH Monte Carlo, volatility simulation, GARCH scenarios, simulated return paths, GARCH bootstrap, bootstrap forecast density, ugarchboot, parameter uncertainty.
Example · AAPL · 2016 to 2025
Install the Finance Toolkit with pip install financetoolkit -U, then call get_garch_simulation:
from financetoolkit import Toolkit
toolkit = Toolkit(
["AAPL"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2016-01-01",
end_date="2025-12-31",
)
toolkit.risk.get_garch_simulation(
output="cumulative_returns", distribution="t", show_columns="AAPL"
)
Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:
What range of cumulative returns over the next ten trading days does a GARCH model with Student-t errors, fitted to Apple's daily returns from 2016 to 2025, simulate?
Which returns:
| Item | Mean | 5% | 25% | 50% | 75% | 95% |
|---|---|---|---|---|---|---|
| 2026-01-01 | 0.0000 | -0.0154 | -0.0054 | -0.0002 | 0.0053 | 0.0151 |
| 2026-01-02 | -0.0001 | -0.0227 | -0.0084 | -0.0001 | 0.0079 | 0.0225 |
| 2026-01-05 | -0.0002 | -0.0286 | -0.0106 | -0.0003 | 0.0102 | 0.0278 |
| 2026-01-06 | -0.0003 | -0.0330 | -0.0126 | -0.0004 | 0.0120 | 0.0325 |
| 2026-01-07 | -0.0003 | -0.0379 | -0.0144 | -0.0002 | 0.0138 | 0.0372 |
| 2026-01-08 | -0.0002 | -0.0419 | -0.0159 | -0.0005 | 0.0152 | 0.0417 |
| 2026-01-09 | -0.0002 | -0.0451 | -0.0173 | -0.0007 | 0.0167 | 0.0457 |
| 2026-01-12 | -0.0001 | -0.0489 | -0.0189 | -0.0005 | 0.0183 | 0.0494 |
| 2026-01-13 | -0.0001 | -0.0523 | -0.0203 | -0.0007 | 0.0196 | 0.0544 |
| 2026-01-14 | -0.0002 | -0.0555 | -0.0217 | -0.0010 | 0.0208 | 0.0575 |
10 rows
Parameters
get_garch_simulation accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The data frequency for returns. Options are: “daily”, “weekly”, “monthly”, “quarterly”, “yearly”. Defaults to “daily”. | "weekly" |
forecast_steps | int | The number of periods to simulate. Defaults to 10. | 10 |
simulations | int | The number of simulated paths per asset. Defaults to 10,000. | 1000 |
seed | int | None | The seed of the random draws, None for a different simulation every time. Defaults to 0. | 42 |
output | str | What to simulate. Options are: “returns” (the return of each period), “cumulative_returns” (the compounded return from the last return to each period), “volatility” (the conditional volatility sigma of each period). Defaults to “returns”. | "returns" |
method | str | The model. Options are: “garch” (GARCH(1, 1)), “gjr” (GJR-GARCH(1, 1, 1)), “egarch” (EGARCH(1, 1)), “igarch” (IGARCH(1, 1)), “aparch” (APARCH(1, 1)), “tgarch” (threshold GARCH), “ngarch” (nonlinear GARCH), “avgarch” (absolute value GARCH), “nagarch” (nonlinear asymmetric GARCH), “component” (component GARCH), “figarch” (FIGARCH(1, d, 1)), “realized” (realized GARCH(1, 1) on the daily Parkinson variance). Defaults to “garch”. | "garch" |
distribution | str | The distribution of the standardized innovations \(z_{t}\). Options are: “normal” (normal), “t” (Student-t, with a Shape v > 2), “skewt” (Hansen’s skewed Student-t, with a Shape and a Skew \(\lambda\) in (-1, 1)), “skewt_fernandez_steel” (Fernández and Steel’s skewed Student-t, the same distribution with a Skew \(\xi = \sqrt{(1 + \lambda) / (1 - \lambda)}\), as in R’s rugarch), “ged” (generalized error distribution, with a Shape v, 2 for the normal), “johnson_su” (Johnson’s SU, with a Shape and a Skew). Defaults to “normal”. | "studentt" |
mean | str | The mean model. Options are: “zero” (zero mean, the returns themselves are the shocks), “constant” (constant mean Mu), “arma” (ARMA(1, 1)), “in_mean” (GARCH-in-mean, Mu + Lambda * \(\sigma_{t}\)), “arfima” (ARFIMA(1, d, 1)). Defaults to “zero”. | "zero" |
rounding | int | None | The number of decimals to round the results to. Defaults to None. | 2 |
show_columns | str | list[str] | None | The columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column. | None, which keeps every column |
bootstrap_fits | int | None | The number of bootstrap series the model is fitted to again for the bootstrap forecast density of Pascual, Romo and Ruiz, 0 for the partial bootstrap that only resamples the residuals. Defaults to None, which draws from the fitted innovation distribution. | None, which draws from the fitted innovation distribution |
References
- Paper Pascual, L., Romo, J. and Ruiz, E. (2006). “Bootstrap Prediction for Returns and Volatilities in GARCH Models.” Computational Statistics & Data Analysis, 50(9), 2293-2312.
- Library Shares similar logic as rugarch (R)’s ugarchsim
- Library Shares similar logic as rugarch (R)’s ugarchpath
- Library Shares similar logic as rugarch (R)’s ugarchboot (bootstrap forecast density)