SeasonalityACFqstat
Find candidate seasonality parameter using autocorrelation function LB q-stat.
Quickstart
from sktime.param_est.seasonality import SeasonalityACFqstat
estimator = SeasonalityACFqstat(candidate_sp=None, p_threshold=0.05, p_adjust='fdr_by', adjusted=False, nlags=None, fft=True, missing='none')Parameters(7)
- candidate_spNone, int or list of int, optional, default = None
candidate sp to test, and to restrict tests to; ints must be 2 or larger if None, will test all integer lags between 2 and
nlags(inclusive)- p_thresholdfloat, optional, default=0.05
- significance threshold to apply in testing for seasonality
- p_adjuststr, optional, default=”fdr_by” (Benjamini/Yekutieli)
multiple testing correction applied to p-values of candidate sp in acf test multiple testing correction is applied to Ljung-Box tests on candidate_sp values can be “none” or strings accepted by
statsmodelsmultipletests“none” = no multiple testim correction is applied, raw p-values are used “fdr_by” = Benjamini-Yekutieli FDR control procedure for other possible strings, seestatsmodels.stats.multitest.multipletests- adjustedbool, optional, default=False
- If True, then denominators for autocovariance are n-k, otherwise n.
- nlagsint, optional, default=None
Number of lags to compute autocorrelations for and select from. At default None, uses
min(10 * np.log10(nobs), nobs - 1). Will be ignored ifcandidate_spis provided.- fftbool, optional, default=True
- If True, computes the ACF via FFT.
- missingstr, [“none”, “raise”, “conservative”, “drop”], optional, default=”none”
Specifies how NaNs are to be treated. “none” performs no checks. “raise” raises an exception if NaN values are found. “drop” removes the missing observations and treats non-missing as contiguous. “conservative” computes the autocovariance using nan-ops so that nans are
removed when computing the mean and cross-products that are used to estimate the autocovariance. When using “conservative”, n is set to the number of non-missing observations.
Examples
>>> from sktime.datasets import load_airline
>>> from sktime.param_est.seasonality import SeasonalityACFqstat
>>> X = load_airline (). diff ()[1:]
>>> sp_est = SeasonalityACFqstat (candidate_sp = [3, 7, 12 ])
>>> sp_est. fit (X) SeasonalityACFqstat(
... )
>>> sp_est. get_fitted_params ()["sp_significant" ] array([12, 7, 3])