arch.univariate.ARX¶
- class
arch.univariate.
ARX
(y=None, x=None, lags=None, constant=True, hold_back=None, volatility=None, distribution=None, rescale=None)[source]¶ Autoregressive model with optional exogenous regressors estimation 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], ...
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.
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 ARX >>> y = np.random.randn(100) >>> arx = ARX(y, lags=[1, 5, 22]) >>> res = arx.fit()
Estimating an AR with GARCH(1,1) errors >>> from arch.univariate import GARCH >>> arx.volatility = GARCH() >>> res = arx.fit(update_freq=0, disp='off')
Notes
The AR-X model is described by
\[y_t = \mu + \sum_{i=1}^p \phi_{L_{i}} y_{t-L_{i}} + \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.
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
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
Returns starting values for the mean model, often the same as the values returned from fit
Properties
Set or gets the error distribution
The name of the model.
Returns the number of parameters
Set or gets the volatility process
Gets the value of the exogenous regressors in the model
Returns the dependent variable