Forecaster
ARCH
Directly interfaces ARCH models from python package arch.
Quickstart
python
from sktime.forecasting.arch import ARCH
estimator = 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)Parameters(28)
- 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.
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)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