ARMA–GARCH
Joint MLE of a linear mean (ARMA / ARX / HAR / …) and conditional variance (GARCH, GJR, EGARCH, APARCH, FIGARCH) under normal, Student-t, skew-t or GED innovations.
README: makystats/armagarch/README.md ·
Full technical guide: DOCUMENTATION.md
Quick start
from makystats import arma_garch, select_order
res = arma_garch(y, mean="AR", ar=1, ma=1, vol="GARCH", dist="normal", trend="c").fit()
print(res.coef_table)
print(res.loglik, res.aic, res.bic)
print(res.forecast(h=5))
fig = res.plot_diagnostics(lags=20)
# d and seasonality fixed on the whole IC grid
tab = select_order(
ylog, p_range=range(0, 3), q_range=range(0, 2),
r_range=[1], s_range=[1], d=1,
seasonal_order=(0, 1, 1, 12), criterion="aic",
)
tab, best = select_order(..., return_best=True)
API sketch
| Argument | Role |
|---|---|
mean | Constant, Zero, AR, ARX, ARMAX, HAR, HARX, LS |
in_mean | None / sigma / var / log — GARCH-M (coef archm) |
trend | n / c / t / ct |
vol | GARCH, ARCH, GJR/TARCH, EGARCH, APARCH, FIGARCH |
dist | normal, t, skewt, ged |
ar / ma | Orders or lag lists (sparse ARMA) |
r / s | ARCH / GARCH orders (r=s=0 → constant variance) |
d | Regular differences 0, 1 or 2 |
seasonal_order | (P, D, Q, s) additive seasonal mean |
GARCH-M
res = arma_garch(y, mean="AR", ar=1, ma=1, vol="GARCH", in_mean="var").fit()
# in_mean: None | "sigma" | "var" | "log" → coefficient archm (λ)
Value-at-Risk / Expected Shortfall
res.var(alpha=0.05, h=1, method="parametric")
res.var(alpha=0.05, h=10, aggregation="cumulative", n_sims=10000, seed=1)
res.expected_shortfall(alpha=0.05)
df = res.var_series(alpha=0.05)
res.var_backtest(alpha=0.05)
res.plot_var(alphas=(0.05, 0.01), method="parametric")
- Forecast VaR/ES:
aggregation="marginal"(default) or"cumulative"(MC) - In-sample 1-step:
var_series,var_backtest,plot_var
Fitted series
res.fitted_values
res.residuals
res.results_frame(include_x=True, index=dates)
# Identity: y = fitted_values + residuals
Unconstrained BFGS on a reparameterised space; OPG standard errors by default.
Deep technical material (likelihood, burn-in, backcast, optimisation):
DOCUMENTATION.md.