psytest.info_criteria module

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:
Returns:

bic – The BIC value.

Return type:

float

psytest.info_criteria.aic(y: ndarray[tuple[int, ...], dtype[float64]], k: int) float[source]#

Akaike Information Criterion (AIC)

Parameters:
Returns:

aic – The AIC value.

Return type:

float

psytest.info_criteria.aicc(y: ndarray[tuple[int, ...], dtype[float64]], k: int) float[source]#

Corrected Akaike Information Criterion (AICc)

Parameters:
Returns:

aicc – The AICc value.

Return type:

float

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.

  • klimit (int) – Maximum number of lags to consider.

  • criteria ("aic", "bic" or "aicc".) – Information criteria to use for evaluation. Defaults to “bic”.

Raises:
Returns:

best_model – The optimal value of KMAX.

Return type:

int