pyhctsa.operations.model_fit.armax

pyhctsa.operations.model_fit.armax(y, orders=(3, 3), p_train=0.8, num_steps=1)

The coefficients of a fitted ARMA model, and how well it predicts the later part of the series.

Fits an autoregressive moving-average (ARMA) model with orders [p, q] to the whole time series by conditional least squares from a Hannan-Rissanen start (hctsa’s MF_armax). The coefficients, their uncertainties, and the goodness of fit are from this fit. The model is then fitted again to the first p_train proportion of the time series and used to predict the remainder num_steps samples ahead; the prediction residuals (prediction minus data) are summarized with residual_analysis().

Parameters:
y : array-like

The input time series.

orders : sequence of two ints, optional

[p, q], the AR and MA orders of the model. Default is (3, 3).

p_train : float, optional

The proportion of the data to train the model on (the remainder is used for testing). Default is 0.8.

num_steps : int, optional

The number of steps ahead to predict when testing the model. Default is 1.

Returns:

From the model fitted to the entire series, in the signal-processing polynomial convention y(t) + a_1 y(t-1) + ... + a_p y(t-p) = e(t) + c_1 e(t-1) + ... + c_q e(t-q):

  • AR_1, …, AR_p: the AR coefficients a_1, ..., a_p (the negatives of the usual AR coefficients)

  • MA_1, …, MA_q: the MA coefficients c_1, ..., c_q

  • maxda, maxdc: the largest estimated standard deviation of the AR and MA coefficients (from the covariance of the parameter estimates)

  • noisevar, lossfn, fpe: the noise variance, the loss function (mean squared prediction error), and Akaike’s final prediction error of the fit

From the residuals of the predictions of the held-out portion (see residual_analysis(), 'full'): meane, meanabs, stde, maxonstd, ac1, ac2, ac3, propbth, ftbth, taurat, sws, swm, normksstat, popt, minsbc.

Return type:

dict

Notes

The model is fitted by conditional least squares (Levenberg-Marquardt) from a Hannan-Rissanen start (_armax_fit()), a fully specified deterministic procedure; maxda and maxdc are the standard errors from the Jacobian at the optimum. The loss is the mean squared one-step prediction error from a diffuse initial state, and the held-out predictions also start from a diffuse state (_prediction_errors()). The coefficients are poorly determined where an ARMA model is poorly identified (nearly cancelling AR and MA polynomials, as for near-white series, where only the loss, noisevar and fpe are well-determined).