arch.univariate.ARCHInMean

class arch.univariate.ARCHInMean(y=None, x=None, lags=None, constant=True, hold_back=None, volatility=None, distribution=None, rescale=None, form='vol')[source]

(G)ARCH-in-mean model and simulation

Parameters:
y{ndarray, Series}

nobs element vector containing the dependent variable

x{ndarray, DataFrame}, optional

nobs by k element array containing exogenous regressors

lags{scalar, 1-d array}, optional

Description of lag structure of the HAR. Scalar included all lags between 1 and the value. A 1-d array includes the AR lags lags[0], lags[1], …

constantbool, optional

Flag whether the model should include a constant

hold_backint, optional

Number of observations at the start of the sample to exclude when estimating model parameters. Used when comparing models with different lag lengths to estimate on the common sample.

volatilityVolatilityProcess, optional

Volatility process to use in the model. volatility.updateable must return True.

distributionDistribution, optional

Error distribution to use in the model

rescalebool, optional

Flag indicating whether to automatically rescale data if the scale of the data is likely to produce convergence issues when estimating model parameters. If False, the model is estimated on the data without transformation. If True, than y is rescaled and the new scale is reported in the estimation results.

form{“log”, “vol”, “var”, int, float}

The form of the conditional variance that appears in the mean equation. The string names use the log of the conditional variance (“log”), the square-root of the conditional variance (“vol”) or the conditional variance. When specified using a float, interpreted as \(\sigma_t^{form}\) so that 1 is equivalent to “vol” and 2 is equivalent to “var”. When using a number, must be different from 0.

Notes

The (G)arch-in-mean model with exogenous regressors (-X) is described by

\[y_t = \mu + \kappa f(\sigma^2_t)+ \sum_{i=1}^p \phi_{L_{i}} y_{t-L_{i}} + \gamma' x_t + \epsilon_t\]

where \(f(\cdot)\) is the function specified by form.

Examples

>>> import numpy as np
>>> from arch.univariate import ARCHInMean, GARCH
>>> from arch.data.sp500 import load
>>> sp500 = load()
>>> rets = 100 * sp500["Adj Close"].pct_change().dropna()
>>> gim = ARCHInMean(rets, lags=[1, 2], volatility=GARCH())
>>> res = gim.fit()
Attributes:
distribution

Set or gets the error distribution

form

The form of the conditional variance in the mean

name

The name of the model.

num_params

Returns the number of parameters

volatility

Set or gets the volatility process

x

Gets the value of the exogenous regressors in the model

y

Returns the dependent variable

Methods

bounds()

Construct bounds for parameters to use in non-linear optimization

compute_param_cov(params[, backcast, robust])

Computes parameter covariances using numerical derivatives.

constraints()

Construct linear constraint arrays for use in non-linear optimization

fit([update_freq, disp, starting_values, ...])

Estimate model parameters

fix(params[, first_obs, last_obs])

Allows an ARCHModelFixedResult to be constructed from fixed parameters.

forecast(params[, horizon, start, align, ...])

Construct forecasts from estimated model

parameter_names()

List of parameters names

resids(params[, y, regressors])

Compute model residuals

simulate(params, nobs[, burn, ...])

Simulates data from a linear regression, AR or HAR models

starting_values()

Returns starting values for the mean model, often the same as the values returned from fit

Properties

distribution

Set or gets the error distribution

form

The form of the conditional variance in the mean

name

The name of the model.

num_params

Returns the number of parameters

volatility

Set or gets the volatility process

x

Gets the value of the exogenous regressors in the model

y

Returns the dependent variable