Docs /Templates/ sinapsis-sktime

ARCHSKTimeWrapper

sinapsis-sktimeSKTimedynamicinferencemodelsprediction

Python template · sinapsis_sktime.templates.sktime_forecasters

Overview

This template specifically handles sktime series forecasting tasks.

The goal is to train a model and predict future values of the input time series.

Attributes: WrapperEntry (WrapperEntryConfig): Configuration for dynamic template generation TASK_TYPE (str): The type of task (forecasting) CATEGORY (str): The category of the template AttributesBaseModel: Reference to the attributes' model class

ARCH — inherited documentation

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 ---------- mean : str, optional Name of the mean model. Currently supported options are: 'Constant', 'Zero', 'LS', 'AR', 'ARX', 'HAR' and 'HARX' lags : int or list (int), optional Either a scalar integer value indicating lag length or a list of integers specifying lag locations. vol : str, optional Name of the volatility model. Currently supported options are: 'GARCH' (default), 'ARCH', 'EGARCH', 'FIARCH' and 'HARCH' p : int, optional Lag order of the symmetric innovation o : int, optional Lag order of the asymmetric innovation q : int, optional Lag order of lagged volatility or equivalent power : float, optional Power to use with GARCH and related models dist : int, 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_back : int 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. rescale : bool 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_freq : int, 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_values : np.ndarray, optional Array of starting values to use. If not provided, starting values are constructed by the model components. cov_type : str, 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_warning : bool, 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 tol : float, optional Tolerance for termination. options : dict, 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'. align : str, 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. simulations : int Number of simulations to run when computing the forecast using either simulation or bootstrap. rng : callable, 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_state : RandomState, optional NumPy RandomState instance to use when method is 'bootstrap' reindex : bool, 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.

See Also -------- StatsForecastARCH StatsForecastGARCH

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 # doctest: +SKIP >>> from sktime.forecasting.arch import ARCH # doctest: +SKIP >>> y = load_airline() # doctest: +SKIP >>> forecaster = ARCH() # doctest: +SKIP >>> forecaster.fit(y) # doctest: +SKIP ARCH(...) >>> y_pred = forecaster.predict(fh=1) # doctest: +SKIP

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-sktime==1.0.0
uv pip install sinapsis-sktime==1.0.0
uv add sinapsis-sktime==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
root_dir
str
Optional
Default: "/sinapsis-hub/private/platform/sinapsis-hub/playground/publish"
arch_initRequired
ARCHAttributes
Required
Default: null
o
int
Optional
Default: 0
p
int
Optional
Default: 1
q
int
Optional
Default: 1
rng
NoneType
Optional
Default: null
tol
typing.Optional[float]
Optional
Default: null
vol
str
Optional
Default: "GARCH"
disp
bool
Optional
Default: false
dist
typing.Optional[int]
Optional
Default: "Normal"
lags
int
Optional
Default: 0
mean
str
Optional
Default: "Constant"
align
str
Optional
Default: "origin"
power
float
Optional
Default: 2
start
typing.Union[str, typing.Any, NoneType]
Optional
Default: null
method
typing.Union[str, typing.Any, NoneType]
Optional
Default: "simulation"
params
typing.Union[str, typing.Any, NoneType]
Optional
Default: null
options
typing.Optional[dict]
Optional
Default: null
reindex
bool
Optional
Default: false
rescale
bool
Optional
Default: false
backcast
typing.Union[str, typing.Any, NoneType]
Optional
Default: null
cov_type
str
Optional
Default: "robust"
last_obs
typing.Union[str, typing.Any, NoneType]
Optional
Default: null
first_obs
typing.Union[str, typing.Any, NoneType]
Optional
Default: null
hold_back
typing.Optional[int]
Optional
Default: null
simulations
int
Optional
Default: 10
update_freq
int
Optional
Default: 0
random_state
NoneType
Optional
Default: null
show_warning
bool
Optional
Default: false
starting_values
NoneType
Optional
Default: null
n_steps_ahead
Number of steps ahead to forecast. Defaults to 37. arch_init mean <class 'str'>: default: Constant lags <class 'int'>: default: 0 vol <class 'str'>: default: GARCH p <class 'int'>: default: 1 o <class 'int'>: default:… Read full field description

Number of steps ahead to forecast. Defaults to 37. arch_init mean <class 'str'>: default: Constant lags <class 'int'>: default: 0 vol <class 'str'>: default: GARCH p <class 'int'>: default: 1 o <class 'int'>: default: 0 q <class 'int'>: default: 1 power <class 'float'>: default: 2.0 dist typing.Optional[int]: default: Normal hold_back typing.Optional[int]: default: None rescale <class 'bool'>: default: False update_freq <class 'int'>: default: 0 disp <class 'bool'>: default: False starting_values <class 'NoneType'>: default: None cov_type <class 'str'>: default: robust show_warning <class 'bool'>: default: False first_obs typing.Union[str, typing.Any, NoneType]: default: None last_obs typing.Union[str, typing.Any, NoneType]: default: None tol typing.Optional[float]: default: None options typing.Optional[dict]: default: None backcast typing.Union[str, typing.Any, NoneType]: default: None params typing.Union[str, typing.Any, NoneType]: default: None start typing.Union[str, typing.Any, NoneType]: default: None align <class 'str'>: default: origin method typing.Union[str, typing.Any, NoneType]: default: simulation simulations <class 'int'>: default: 10 rng <class 'NoneType'>: default: None random_state <class 'NoneType'>: default: None reindex <class 'bool'>: default: False

int
Optional
Default: 37
model_save_pathRequired
str
Required
Default: null

Configuration example

Generated from documented defaults. Replace any placeholders and complete required nested settings before running.

yaml
templates:
  - template_name: "ARCHSKTimeWrapper"
    class_name: "ARCHSKTimeWrapper"
    attributes:
      root_dir: "/sinapsis-hub/private/platform/sinapsis-hub/playground/publish"
      arch_init:
        o: 0
        p: 1
        q: 1
        rng: null
        tol: null
        vol: "GARCH"
        disp: false
        dist: "Normal"
        lags: 0
        mean: "Constant"
        align: "origin"
        power: 2
        start: null
        method: "simulation"
        params: null
        options: null
        reindex: false
        rescale: false
        backcast: null
        cov_type: "robust"
        last_obs: null
        first_obs: null
        hold_back: null
        simulations: 10
        update_freq: 0
        random_state: null
        show_warning: false
        starting_values: null
      n_steps_ahead: 37
      model_save_path: "<required>"

Inheritance

Immediate parent: sinapsis_sktime.templates.sktime_forecasters.SKTimeArchForecaster

Environment variables

Environment definitions belong to their canonical Python modules.

SINAPSIS_BUILD_DOCS · defined elsewhere