Documentation Index
Fetch the complete documentation index at: https://nixtlaverse.nixtla.io/llms.txt
Use this file to discover all available pages before exploring further.
num_seas_diffs
num_seas_diffs(x, season_length, max_d=1)
Determine the optimal number of seasonal differences for stationarity.
Uses a seasonal strength heuristic based on STL decomposition to determine
if seasonal differencing is needed. The function applies seasonal differencing
iteratively until the seasonal strength falls below the threshold or the
maximum number of differences is reached.
Parameters:
| Name | Type | Description | Default |
|---|
x | ndarray | Array with the time series. | required |
season_length | int | Length of the seasonal pattern. | required |
max_d | int | Maximum number of differences to consider. Defaults to 1. | 1 |
Returns:
| Name | Type | Description |
|---|
int | int | Optimal number of seasonal differences. |
num_diffs
Determine the optimal number of non-seasonal differences for stationarity.
Uses the KPSS (Kwiatkowski-Phillips-Schmidt-Shin) test to determine how many
times the series needs to be differenced to achieve stationarity. The function
applies differencing iteratively until the KPSS statistic falls below the
threshold or the maximum number of differences is reached.
Parameters:
| Name | Type | Description | Default |
|---|
x | ndarray | Array with the time series. | required |
max_d | int | Maximum number of differences to consider. Defaults to 1. | 1 |
Returns:
| Name | Type | Description |
|---|
int | int | Optimal number of differences. |
diff
Subtract previous values of the series
Parameters:
| Name | Type | Description | Default |
|---|
x | ndarray | Array with the time series. | required |
d | int | Lag to subtract | required |
Returns:
| Type | Description |
|---|
ndarray | np.ndarray: Differenced time series. |