analyse_stationarity#

anomalearn.analysis.stationarity.analyse_stationarity(series, method: str, method_params: dict | None = None, diff_order: int = 0) tuple[float, float, dict]#

Analyse the stationarity property of the time series.

Parameters:
  • series (array-like of shape (n_samples, n_features)) – The series to be analysed.

  • method (["adfuller", "kpss"]) – The stationarity test to be conducted on the time series.

  • method_params (dict, default=None) – The additional parameters to the test method. The parameters are based on the test implementation which is available in statsmodels package.

  • diff_order (int, default=0) – The number of times that the series must be differentiated. Normally, it is 0, which means that the series won’t be differentiated. If it is n the series will be differentiated n times.

Returns:

  • test_statistic (float) – The test statistic of the method for the time series.

  • p_value (float) – The p-value of the method for the time series.

  • critical_values (dict) – The critical values for the test statistic.

Raises:

NotImplementedError – If the method is not supported.