pyhctsa.operations.model_fit.ar_cov

pyhctsa.operations.model_fit.ar_cov(y, p=2)

Fits an autoregressive (AR) model of a given order p.

Uses the arcov approach (covariance method) to fit an AR model to the input time series.

Parameters:
y : array-like

The input time series.

p : int, optional

The AR model order. Default is 2.

Returns:

Dictionary containing the variance estimate of the white noise input to the AR model (noisevar), the parameters of the fitted model (a1, …, a{p+1}, with a1 = 1), and the 11 'core' statistics of the residuals of the reconstructed time series (see residual_analysis()). The residuals are prediction minus data.

The residuals are the one-step prediction errors (prediction minus data) over the N - p samples that have p past values.

NaN for a (nearly) exactly predictable series: when the fitted noise variance is below 1e-12 of the variance of the series, the design is singular and the fitted coefficients and residuals are not meaningful (e.g., an exact sinusoid with p > 2).

Return type:

dict