Skip to content

ARCH

ARCH

class ARCH(mean='Constant', lags=0, vol='GARCH', p=1, o=0, q=1, power=2.0, dist='Normal', hold_back=None, rescale=False, update_freq=0, disp=False, starting_values=None, cov_type='robust', show_warning=False, first_obs=None, last_obs=None, tol=None, options=None, backcast=None, params=None, start=None, align='origin', method='simulation', simulations=10, rng=None, random_state=None, reindex=False)[source]

ARCH models from arch package, including (E)(G/H)AR(X)CH, FIAR(X)CH.

ARCH models are a popular class of volatility models that use observed values of returns or residuals as volatility shocks to forecast the volatility in high frequency time series data..

A complete ARCH model is divided into three components:

  • a mean model, e.g., a constant mean or an ARX;

  • a volatility process, e.g., a GARCH or an EGARCH process; and

  • a distribution for the standardized residuals.

Includes but is not limited to the following commonly used models: ARCH, GARCH, EGARCH, HARCH, FIARCH, ARX, HARX.

Parameters:
meanstr, optional

Name of the mean model. Currently supported options are: ‘Constant’, ‘Zero’, ‘LS’, ‘AR’, ‘ARX’, ‘HAR’ and ‘HARX’

lagsint or list (int), optional

Either a scalar integer value indicating lag length or a list of integers specifying lag locations.

volstr, optional

Name of the volatility model. Currently supported options are: ‘GARCH’ (default), ‘ARCH’, ‘EGARCH’, ‘FIARCH’ and ‘HARCH’

pint, optional

Lag order of the symmetric innovation

oint, optional

Lag order of the asymmetric innovation

qint, optional

Lag order of lagged volatility or equivalent

powerfloat, optional

Power to use with GARCH and related models

distint, optional

Name of the error distribution. Currently supported options are:

  • Normal: ‘normal’, ‘gaussian’ (default)

  • Students’s t: ‘t’, ‘studentst’

  • Skewed Student’s t: ‘skewstudent’, ‘skewt’

  • Generalized Error Distribution: ‘ged’, ‘generalized error”

hold_backint

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.

rescalebool

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.

update_freqint, optional

Frequency of iteration updates. Output is generated every update_freq iterations. Set to 0 to disable iterative output.

disp{bool, “off”, “final”}

Either ‘final’ to print optimization result or ‘off’ to display nothing. If using a boolean, False is “off” and True is “final”

starting_valuesnp.ndarray, optional

Array of starting values to use. If not provided, starting values are constructed by the model components.

cov_typestr, optional

Estimation method of parameter covariance. Supported options are ‘robust’, which does not assume the Information Matrix Equality holds and ‘classic’ which does. In the ARCH literature, ‘robust’ corresponds to Bollerslev-Wooldridge covariance estimator.

show_warningbool, optional

Flag indicating whether convergence warnings should be shown

first_obs{int, str, datetime, Timestamp}

First observation to use when estimating model

last_obs{int, str, datetime, Timestamp}

Last observation to use when estimating model

tolfloat, optional

Tolerance for termination.

optionsdict, optional

Options to pass to scipy.optimize.minimize. Valid entries include ‘ftol’, ‘eps’, ‘disp’, and ‘maxiter’.

backcast{float, np.ndarray}, optional

Value to use as backcast. Should be measure \sigma^2_0 since model-specific non-linear transformations are applied to value before computing the variance recursions.

params{np.ndarray, Series}

Parameters required to forecast. Must be identical in shape to the parameters computed by fitting the model.

start{int, datetime, Timestamp, str}, optional

An integer, datetime or str indicating the first observation to produce the forecast for. Datetimes can only be used with pandas inputs that have a datetime index. Strings must be convertible to a date time, such as in ‘1945-01-01’.

alignstr, optional

Either ‘origin’ or ‘target’. When set of ‘origin’, the t-th row of forecast contains the forecasts for t+1, t+2, …, t+h. When set to ‘target’, the t-th row contains the 1-step ahead forecast from time t-1, the 2 step from time t-2, …, and the h-step from time t-h. ‘target’ simplified computing forecast errors since the realization and h-step forecast are aligned.

method{‘analytic’, ‘simulation’, ‘bootstrap’}

Method to use when producing the forecast. The default is analytic. The method only affects the variance forecast generation. Not all volatility models support all methods. In particular, volatility models that do not evolve in squares such as EGARCH or TARCH do not support the ‘analytic’ method for horizons > 1.

simulationsint

Number of simulations to run when computing the forecast using either simulation or bootstrap.

rngcallable, optional

Custom random number generator to use in simulation-based forecasts. Must produce random samples using the syntax rng(size) where size the 2-element tuple (simulations, horizon).

random_stateRandomState, optional

NumPy RandomState instance to use when method is ‘bootstrap’

reindexbool, optional

Whether to reindex the forecasts to have the same dimension as the series being forecast. Prior to 4.18 this was the default. As of 4.19 this is now optional. If not provided, a warning is raised about the future change in the default which will occur after September 2021.

Attributes:
cutoff

Cut-off = “present time” state of forecaster.

fh

Forecasting horizon that was passed.

is_fitted

Whether fit has been called.

state

State of the estimator.

References

[1]

GitHub repository of arch package (soft dependency). https://github.com/bashtage/arch

[2]

Documentation of arch package (soft dependency). Forecasting Volatility with ARCH and it’s variants. https://arch.readthedocs.io/en/latest/univariate/introduction.html

Examples

>>> from sktime.datasets import load_airline
>>> from sktime.forecasting.arch import ARCH
>>> y = load_airline()
>>> forecaster = ARCH()
>>> forecaster.fit(y)
ARCH(...)
>>> y_pred = forecaster.predict(fh=1)

Methods

check_is_fitted([method_name])

Check if the estimator has been fitted.

clone()

Obtain a clone of the object with same hyper-parameters and config.

clone_tags(estimator[, tag_names])

Clone tags from another object as dynamic override.

create_test_instance([parameter_set])

Construct an instance of the class, using first test parameter set.

create_test_instances_and_names([parameter_set])

Create list of all test instances and a list of names for them.

fit(y[, X, fh])

Fit forecaster to training data.

fit_predict(y[, X, fh, X_pred])

Fit and forecast time series at future horizon.

get_class_tag(tag_name[, tag_value_default])

Get class tag value from class, with tag level inheritance from parents.

get_class_tags()

Get class tags from class, with tag level inheritance from parent classes.

get_config()

Get config flags for self.

get_fitted_params([deep])

Get fitted parameters.

get_param_defaults()

Get object's parameter defaults.

get_param_names([sort])

Get object's parameter names.

get_params([deep])

Get a dict of parameters values for this object.

get_pretrained_params([deep])

Get pretrained parameters of this estimator.

get_tag(tag_name[, tag_value_default, ...])

Get tag value from instance, with tag level inheritance and overrides.

get_tags()

Get tags from instance, with tag level inheritance and overrides.

get_test_params()

Return testing parameter settings for the estimator.

is_composite()

Check if the object is composed of other BaseObjects.

load_from_path(serial)

Load object from file location.

load_from_serial(serial)

Load object from serialized memory container.

predict([fh, X])

Forecast time series at future horizon.

predict_interval([fh, X, coverage])

Compute/return prediction interval forecasts.

predict_proba([fh, X, marginal])

Compute/return fully probabilistic forecasts.

predict_quantiles([fh, X, alpha])

Compute/return quantile forecasts.

predict_residuals([y, X])

Return residuals of time series forecasts.

predict_var([fh, X, cov])

Compute/return variance forecasts.

pretrain(y[, X, fh])

Pre-train forecaster on panel (global) data.

reset()

Reset the object to a clean post-init state.

save([path, serialization_format])

Save serialized self to bytes-like object or to (.zip) file.

score(y[, X, fh])

Scores forecast against ground truth, using MAPE (non-symmetric).

set_config(**config_dict)

Set config flags to given values.

set_params(**params)

Set the parameters of this object.

set_random_state([random_state, deep, ...])

Set random_state pseudo-random seed parameters for self.

set_tags(**tag_dict)

Set instance level tag overrides to given values.

summary()

Summary of the fitted model.

update(y[, X, update_params])

Update cutoff value and, optionally, fitted parameters.

update_predict(y[, cv, X, update_params, ...])

Make predictions and update model iteratively over the test set.

update_predict_single([y, fh, X, update_params])

Update model with new data and make forecasts.