Mean Models¶
All ARCH models start by specifying a mean model.
|
Model with zero conditional mean estimation and simulation. |
|
Constant mean model estimation and simulation. |
|
Autoregressive model with optional exogenous regressors. |
|
Heterogeneous Autoregression (HAR) model with optional exogenous regressors. |
|
Least squares model estimation and simulation. |
|
Moving average (MA) mean model, with optional constant. |
Moving Average Models¶
MAMean is a moving average model of order \(q\)
with an optional constant, which can be used with any volatility process and
distribution. The model is
where \(\sigma^2_t\) is the conditional variance from the volatility process
and \(e_t\) has the distribution of the model. The order is set using lags,
and the constant \(\mu\) is omitted when constant=False. The parameters
are ordered \([\mu, \theta_1, \ldots, \theta_q]\).
The innovations \(\epsilon_t\) are not observed. They are computed recursively
from the data, with the innovations before the first observation set to 0, so that
the parameters are estimated by maximizing the conditional likelihood. The effect
of the initial values vanishes when the model is invertible. Invertibility is
imposed when \(q\) is 1 or 2, but not for larger values of \(q\), and the
starting values are always invertible. Exogenous regressors are not supported,
and ARX or HARX should be used
when they are needed.
In [1]: import arch.data.sp500
In [2]: from arch.univariate import GARCH, MAMean, StudentsT
In [3]: sp500 = arch.data.sp500.load()
In [4]: returns = 100 * sp500["Adj Close"].pct_change().dropna()
In [5]: ma = MAMean(returns, lags=2, volatility=GARCH(1, 0, 1), distribution=StudentsT())
In [6]: res = ma.fit(disp="off")
In [7]: res.params
Out[7]:
mu 0.067441
theta[1] -0.060069
theta[2] -0.031440
omega 0.008391
alpha[1] 0.098476
beta[1] 0.901311
nu 6.483428
Name: params, dtype: float64
The forecast of the mean depends on the most recent innovations for the first \(q\) steps, and is the constant \(\mu\) after that.
In [8]: res.forecast(horizon=4, reindex=False).mean
Out[8]:
h.1 h.2 h.3 h.4
Date
2018-12-31 0.018189 0.041874 0.067441 0.067441
MAMean is a class only. It is not available through
arch_model(), so that arch_model(y, mean="ma") raises a
ValueError.
Adding Observations to a Model¶
Once a model has been estimated, observations that arrive later can be added using
append(), which is available for all mean
models. It modifies the model in-place and does not change its parameters, so that
forecasts and results that are computed using parameters estimated using earlier
data include the new observations without estimating the model again. See
Forecasting After New Data Arrive for details and an example.
(G)ARCH-in-mean Models¶
(G)ARCH-in-mean models allow the conditional variance (or a transformation of it) to enter the conditional mean.
|
(G)ARCH-in-mean model and simulation. |
Special Requirements¶
A volatility process can only be used in AIM modeling if it supports updating.
Specifically, the property updateable must be True. All of the volatility
processes in the package support updating. A process that is written by the
user must provide a volatility updater, see Volatility Processes.
In [9]: from arch.univariate import GARCH, EGARCH
In [10]: GARCH().updateable
Out[10]: True
In [11]: EGARCH().updateable
Out[11]: True
Writing New Mean Models¶
All mean models must inherit from ARCHModel and provide all public
methods. There are two optional private methods that should be provided if
applicable.
|
Abstract base class for mean models in ARCH processes. |