arch.univariate.LS

class arch.univariate.LS(y=None, x=None, constant=True, hold_back=None, volatility=None, distribution=None, rescale=None)[source]

Least squares model estimation and simulation

Parameters
  • y ({ndarray, DataFrame}, optional) -- nobs element vector containing the dependent variable

  • y -- nobs by k element array containing exogenous regressors

  • constant (bool, optional) -- Flag whether the model should include a constant

  • 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.

  • volatility (VolatilityProcess, optional) -- Volatility process to use in the model

  • distribution (Distribution, optional) -- Error distribution to use in the model

  • rescale (bool, 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.

Examples

>>> import numpy as np
>>> from arch.univariate import LS
>>> y = np.random.randn(100)
>>> x = np.random.randn(100,2)
>>> ls = LS(y, x)
>>> res = ls.fit()

Notes

The LS model is described by

\[y_t = \mu + \gamma' x_t + \epsilon_t\]

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, ...])

Fits the model given a nobs by 1 vector of sigma2 values

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

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