Time-series models
StochX exposes the standard univariate families used throughout the course workflow.
AR(p)
The autoregressive model is
from stochx.timeseries import fit_ar
result = fit_ar(y, p=2)
print(result.summary())
An AR model is useful when the current value can be explained largely by its own recent history. Stationarity depends on the roots of the AR polynomial.
MA(q)
A moving-average model uses past shocks:
from stochx.timeseries import fit_ma
result = fit_ma(y, q=2)
Invertibility is checked through the MA roots.
ARMA(p,q)
ARMA combines both structures:
from stochx.timeseries import fit_arma
result = fit_arma(y, p=1, q=1)
ARIMA(p,d,q)
ARIMA applies ARMA structure after \(d\) ordinary differences. Use it when the original series is not stationary but its differenced representation is.
from stochx.timeseries import fit_arima
result = fit_arima(y, order=(1, 1, 1))
SARIMA
SARIMA extends ARIMA with seasonal orders. The parameterization separates non-seasonal and seasonal dynamics so that the final specification remains auditable.
from stochx.timeseries import fit_sarima
result = fit_sarima(y, order=(1, 1, 1), seasonal_order=(1, 1, 1, 12))
What every fitted result should answer
A useful model report should make the following visible:
- estimated coefficients;
- standard errors;
- t-values and p-values where applicable;
- log-likelihood and information criteria;
- residuals;
- stationarity/invertibility information;
- forecast behavior;
- diagnostic tests.
Don't stop at the fit
A model is not selected because its estimation converged. The StochX workflow continues through residual validation and deterministic selection. See Diagnostics and Box–Jenkins.