pyhctsa.operations.model_fit.ar_fit¶
-
pyhctsa.operations.model_fit.ar_fit(y, p_min=
1, p_max=10, selector='sbc')¶ Statistics of a fitted AR model to a time series.
Fits zero-mean autoregressive (AR) models of orders p = p_min, …, p_max to the input time series with the ARFIT algorithm [1] [2], selects the optimal order using Schwarz’s Bayesian Criterion (SBC) or the final prediction error (FPE), and returns statistics on the fitted model, its residuals, confidence intervals and eigenmodes. As in ARFIT, all orders are fitted to the same
N - p_maxequations.References
- Parameters:¶
- y : array-like¶
The input time series.
- p_min : int, optional¶
The minimum AR model order to fit. Default is 1.
- p_max : int, optional¶
The maximum AR model order to fit. Default is 10.
- selector : {'sbc', 'fpe'}, optional¶
Criterion to select the optimal model order (cf. the ARFIT documentation;
'bic'and'aic'are accepted as aliases). Default is'sbc'.
- Returns:¶
A1…A6: the first six AR coefficients (NaN beyond the selected order)maxA,minA,meanA,stdA,sumA,rmsA: summaries of the coefficientsC: the noise variancesbc_k,minsbc,popt_sbc,aroundmin_sbc: Schwarz’s criterion for each order, its minimum, the position (1-based, withinp_min..p_max) of the minimum, and its size relative to the neighboring valuesfpe_k,minfpe,popt_fpe,aroundmin_fpe: the same for the logarithm of Akaike’s final prediction errorres_siglev: significance level of the Li-McLeod test for autocorrelation in the residuals (up to lag 20)the 11
'core'statistics of the residuals (seeresidual_analysis())aerr_min,aerr_max,aerr_mean: 95% confidence intervals on the coefficientsmaxReLambda,maxImLambda,maxabsLambda,stdabsLambda: the eigenvalues of the AR model’s companion matrixhasInfper,meanper,stdper,maxper,minper,meanpererr,meantau,maxtau,mintau,stdtau,meantauerr,maxexctn,minexctn,meanexctn,stdexctn: periods, damping times (with confidence intervals) and excitations of the eigenmodes
NaN if the series is too short for ARFIT, and for a (nearly) exactly predictable series (estimated noise variance below 1e-12 of the variance of the series, e.g. an exact sinusoid): the coefficients are not determined and the residuals are rounding noise.
- Return type:¶
dict