> ## 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.

# Rolling

> Compute rolling mean, std, min, max, and quantile

##

### `rolling_mean`

```python theme={null}
rolling_mean(x, window_size, min_samples=None, skipna=False)
```

Compute the rolling\_mean of the input array.

**Parameters:**

| Name          | Type                    | Description                                                                                                                                                                                                                                                                | Default    |
| ------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `x`           | <code>np.ndarray</code> | Input array.                                                                                                                                                                                                                                                               | *required* |
| `window_size` | <code>int</code>        | The size of the rolling window.                                                                                                                                                                                                                                            | *required* |
| `min_samples` | <code>int</code>        | The minimum number of samples required to compute the statistic. If None, it is set to `window_size`.                                                                                                                                                                      | *required* |
| `skipna`      | <code>bool</code>       | Exclude NaN values from calculations. When False (default), any NaN value in the window causes the result to be NaN. When True, NaN values are ignored and statistics are computed on remaining valid values in the window. Defaults to False for backwards compatibility. | *required* |

**Returns:**

| Type                                         | Description |
| -------------------------------------------- | ----------- |
| np.ndarray: Array with the rolling statistic |             |

### `rolling_std`

```python theme={null}
rolling_std(x, window_size, min_samples=None, skipna=False)
```

Compute the rolling\_std of the input array.

**Parameters:**

| Name          | Type                    | Description                                                                                                                                                                                                                                                                | Default    |
| ------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `x`           | <code>np.ndarray</code> | Input array.                                                                                                                                                                                                                                                               | *required* |
| `window_size` | <code>int</code>        | The size of the rolling window.                                                                                                                                                                                                                                            | *required* |
| `min_samples` | <code>int</code>        | The minimum number of samples required to compute the statistic. If None, it is set to `window_size`.                                                                                                                                                                      | *required* |
| `skipna`      | <code>bool</code>       | Exclude NaN values from calculations. When False (default), any NaN value in the window causes the result to be NaN. When True, NaN values are ignored and statistics are computed on remaining valid values in the window. Defaults to False for backwards compatibility. | *required* |

**Returns:**

| Type                                         | Description |
| -------------------------------------------- | ----------- |
| np.ndarray: Array with the rolling statistic |             |

### `rolling_min`

```python theme={null}
rolling_min(x, window_size, min_samples=None, skipna=False)
```

Compute the rolling\_min of the input array.

**Parameters:**

| Name          | Type                    | Description                                                                                                                                                                                                                                                                | Default    |
| ------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `x`           | <code>np.ndarray</code> | Input array.                                                                                                                                                                                                                                                               | *required* |
| `window_size` | <code>int</code>        | The size of the rolling window.                                                                                                                                                                                                                                            | *required* |
| `min_samples` | <code>int</code>        | The minimum number of samples required to compute the statistic. If None, it is set to `window_size`.                                                                                                                                                                      | *required* |
| `skipna`      | <code>bool</code>       | Exclude NaN values from calculations. When False (default), any NaN value in the window causes the result to be NaN. When True, NaN values are ignored and statistics are computed on remaining valid values in the window. Defaults to False for backwards compatibility. | *required* |

**Returns:**

| Type                                         | Description |
| -------------------------------------------- | ----------- |
| np.ndarray: Array with the rolling statistic |             |

### `rolling_max`

```python theme={null}
rolling_max(x, window_size, min_samples=None, skipna=False)
```

Compute the rolling\_max of the input array.

**Parameters:**

| Name          | Type                    | Description                                                                                                                                                                                                                                                                | Default    |
| ------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `x`           | <code>np.ndarray</code> | Input array.                                                                                                                                                                                                                                                               | *required* |
| `window_size` | <code>int</code>        | The size of the rolling window.                                                                                                                                                                                                                                            | *required* |
| `min_samples` | <code>int</code>        | The minimum number of samples required to compute the statistic. If None, it is set to `window_size`.                                                                                                                                                                      | *required* |
| `skipna`      | <code>bool</code>       | Exclude NaN values from calculations. When False (default), any NaN value in the window causes the result to be NaN. When True, NaN values are ignored and statistics are computed on remaining valid values in the window. Defaults to False for backwards compatibility. | *required* |

**Returns:**

| Type                                         | Description |
| -------------------------------------------- | ----------- |
| np.ndarray: Array with the rolling statistic |             |

### `rolling_quantile`

```python theme={null}
rolling_quantile(x, p, window_size, min_samples=None, skipna=False)
```

Compute the rolling\_quantile of the input array.

**Parameters:**

| Name          | Type                                   | Description                                                                                                                                                                                                                                                                | Default            |
| ------------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| `x`           | <code>[ndarray](#numpy.ndarray)</code> | Input array.                                                                                                                                                                                                                                                               | *required*         |
| `p`           | <code>[float](#float)</code>           | Quantile to compute.                                                                                                                                                                                                                                                       | *required*         |
| `window_size` | <code>[int](#int)</code>               | The size of the rolling window.                                                                                                                                                                                                                                            | *required*         |
| `min_samples` | <code>[int](#int)</code>               | The minimum number of samples required to compute the statistic. If None, it is set to `window_size`.                                                                                                                                                                      | <code>None</code>  |
| `skipna`      | <code>[bool](#bool)</code>             | Exclude NaN values from calculations. When False (default), any NaN value in the window causes the result to be NaN. When True, NaN values are ignored and statistics are computed on remaining valid values in the window. Defaults to False for backwards compatibility. | <code>False</code> |

**Returns:**

| Type                                   | Description                              |
| -------------------------------------- | ---------------------------------------- |
| <code>[ndarray](#numpy.ndarray)</code> | np.ndarray: Array with rolling statistic |

### `seasonal_rolling_mean`

```python theme={null}
seasonal_rolling_mean(x, season_length, window_size, min_samples=None, skipna=False)
```

Compute the seasonal\_rolling\_mean of the input array

**Parameters:**

| Name            | Type                    | Description                                                                                                                                                                                                                                                                | Default    |
| --------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `x`             | <code>np.ndarray</code> | Input array.                                                                                                                                                                                                                                                               | *required* |
| `season_length` | <code>int</code>        | The length of the seasonal period.                                                                                                                                                                                                                                         | *required* |
| `window_size`   | <code>int</code>        | The size of the rolling window.                                                                                                                                                                                                                                            | *required* |
| `min_samples`   | <code>int</code>        | The minimum number of samples required to compute the statistic. If None, it is set to `window_size`.                                                                                                                                                                      | *required* |
| `skipna`        | <code>bool</code>       | Exclude NaN values from calculations. When False (default), any NaN value in the window causes the result to be NaN. When True, NaN values are ignored and statistics are computed on remaining valid values in the window. Defaults to False for backwards compatibility. | *required* |

**Returns:**

| Type                                                  | Description |
| ----------------------------------------------------- | ----------- |
| np.ndarray: Array with the seasonal rolling statistic |             |

### `seasonal_rolling_std`

```python theme={null}
seasonal_rolling_std(x, season_length, window_size, min_samples=None, skipna=False)
```

Compute the seasonal\_rolling\_std of the input array

**Parameters:**

| Name            | Type                    | Description                                                                                                                                                                                                                                                                | Default    |
| --------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `x`             | <code>np.ndarray</code> | Input array.                                                                                                                                                                                                                                                               | *required* |
| `season_length` | <code>int</code>        | The length of the seasonal period.                                                                                                                                                                                                                                         | *required* |
| `window_size`   | <code>int</code>        | The size of the rolling window.                                                                                                                                                                                                                                            | *required* |
| `min_samples`   | <code>int</code>        | The minimum number of samples required to compute the statistic. If None, it is set to `window_size`.                                                                                                                                                                      | *required* |
| `skipna`        | <code>bool</code>       | Exclude NaN values from calculations. When False (default), any NaN value in the window causes the result to be NaN. When True, NaN values are ignored and statistics are computed on remaining valid values in the window. Defaults to False for backwards compatibility. | *required* |

**Returns:**

| Type                                                  | Description |
| ----------------------------------------------------- | ----------- |
| np.ndarray: Array with the seasonal rolling statistic |             |

### `seasonal_rolling_min`

```python theme={null}
seasonal_rolling_min(x, season_length, window_size, min_samples=None, skipna=False)
```

Compute the seasonal\_rolling\_min of the input array

**Parameters:**

| Name            | Type                    | Description                                                                                                                                                                                                                                                                | Default    |
| --------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `x`             | <code>np.ndarray</code> | Input array.                                                                                                                                                                                                                                                               | *required* |
| `season_length` | <code>int</code>        | The length of the seasonal period.                                                                                                                                                                                                                                         | *required* |
| `window_size`   | <code>int</code>        | The size of the rolling window.                                                                                                                                                                                                                                            | *required* |
| `min_samples`   | <code>int</code>        | The minimum number of samples required to compute the statistic. If None, it is set to `window_size`.                                                                                                                                                                      | *required* |
| `skipna`        | <code>bool</code>       | Exclude NaN values from calculations. When False (default), any NaN value in the window causes the result to be NaN. When True, NaN values are ignored and statistics are computed on remaining valid values in the window. Defaults to False for backwards compatibility. | *required* |

**Returns:**

| Type                                                  | Description |
| ----------------------------------------------------- | ----------- |
| np.ndarray: Array with the seasonal rolling statistic |             |

### `seasonal_rolling_max`

```python theme={null}
seasonal_rolling_max(x, season_length, window_size, min_samples=None, skipna=False)
```

Compute the seasonal\_rolling\_max of the input array

**Parameters:**

| Name            | Type                    | Description                                                                                                                                                                                                                                                                | Default    |
| --------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `x`             | <code>np.ndarray</code> | Input array.                                                                                                                                                                                                                                                               | *required* |
| `season_length` | <code>int</code>        | The length of the seasonal period.                                                                                                                                                                                                                                         | *required* |
| `window_size`   | <code>int</code>        | The size of the rolling window.                                                                                                                                                                                                                                            | *required* |
| `min_samples`   | <code>int</code>        | The minimum number of samples required to compute the statistic. If None, it is set to `window_size`.                                                                                                                                                                      | *required* |
| `skipna`        | <code>bool</code>       | Exclude NaN values from calculations. When False (default), any NaN value in the window causes the result to be NaN. When True, NaN values are ignored and statistics are computed on remaining valid values in the window. Defaults to False for backwards compatibility. | *required* |

**Returns:**

| Type                                                  | Description |
| ----------------------------------------------------- | ----------- |
| np.ndarray: Array with the seasonal rolling statistic |             |

### `seasonal_rolling_quantile`

```python theme={null}
seasonal_rolling_quantile(x, p, season_length, window_size, min_samples=None, skipna=False)
```

Compute the seasonal\_rolling\_quantile of the input array.

**Parameters:**

| Name            | Type                                   | Description                                                                                                                                                                                                                                                                | Default            |
| --------------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| `x`             | <code>[ndarray](#numpy.ndarray)</code> | Input array.                                                                                                                                                                                                                                                               | *required*         |
| `p`             | <code>[float](#float)</code>           | Quantile to compute.                                                                                                                                                                                                                                                       | *required*         |
| `season_length` | <code>[int](#int)</code>               | The length of the seasonal period.                                                                                                                                                                                                                                         | *required*         |
| `window_size`   | <code>[int](#int)</code>               | The size of the rolling window.                                                                                                                                                                                                                                            | *required*         |
| `min_samples`   | <code>[int](#int)</code>               | The minimum number of samples required to compute the statistic. If None, it is set to `window_size`.                                                                                                                                                                      | <code>None</code>  |
| `skipna`        | <code>[bool](#bool)</code>             | Exclude NaN values from calculations. When False (default), any NaN value in the window causes the result to be NaN. When True, NaN values are ignored and statistics are computed on remaining valid values in the window. Defaults to False for backwards compatibility. | <code>False</code> |

**Returns:**

| Type                                   | Description                              |
| -------------------------------------- | ---------------------------------------- |
| <code>[ndarray](#numpy.ndarray)</code> | np.ndarray: Array with rolling statistic |
