psytest.info_criteria module#
psytest.info_criteria_functions#
This module contains functions to calculate various information criteria which allow us to choose the parameters for the ADF test.
- psytest.info_criteria.bic(y: ndarray[tuple[int, ...], dtype[float64]], k: int) float [source]#
Bayes Information Criterion (BIC)
- Parameters:
y¶ (
numpy.ndarray
) – Fitted error values.
- Returns:
bic – The BIC value.
- Return type:
- psytest.info_criteria.aic(y: ndarray[tuple[int, ...], dtype[float64]], k: int) float [source]#
Akaike Information Criterion (AIC)
- Parameters:
y¶ (
numpy.ndarray
) – Fitted error values.
- Returns:
aic – The AIC value.
- Return type:
- psytest.info_criteria.aicc(y: ndarray[tuple[int, ...], dtype[float64]], k: int) float [source]#
Corrected Akaike Information Criterion (AICc)
- Parameters:
y¶ (
numpy.ndarray
) – Fitted error values.
- Returns:
aicc – The AICc value.
- Return type:
- psytest.info_criteria.find_optimal_kmax(y: ndarray[tuple[int, ...], dtype[float64]], klimit: int, criteria: Literal['aic', 'bic', 'aicc'] = 'bic') int [source]#
Find the best model based on the given criteria.
- Parameters:
y¶ (list of
numpy.ndarray
) – List of m data values for each model.criteria¶ ("aic", "bic" or "aicc".) – Information criteria to use for evaluation. Defaults to “bic”.
- Raises:
ValueError – If
klimit
is negative or greater than sample size. Ifcriteria
is not in (“aic”, “bic”, “aicc”)
- Returns:
best_model – The optimal value of KMAX.
- Return type: