tests#

Statistical tests to check model results.

Contains diagnostic tests to check if model residuals/noise do not contain significant autocorrelation and are normally distributed, using hypothesis testing.

Examples

Run diagnostic tests on model after optimization:

ml.stats.diagnostics()

Functions#

durbin_watson(series) → float

Durbin-Watson test for autocorrelation.

ljung_box(series[, lags, nparam, full_output]) → tuple[float, float]

Test for autocorrelation using the Ljung-Box test.

runs_test(series[, cutoff]) → tuple[float, float]

Test for autocorrelation using the runs test.

stoffer_toloi(series[, lags, nparam, freq, ...]) → tuple[float, float]

Adapted Ljung-Box test to deal with missing data [Rcb3cfb20bb89-stoffer_1992].

diagnostics(series[, alpha, nparam, lags, stats, ...]) → pandas.DataFrame

Methods to compute various diagnostics checks for a time series.