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

> Built-in lag transformations

# Lag transforms

##

### `RollingQuantile`

```python theme={null}
RollingQuantile(
    p, window_size, min_samples=None, global_=False, groupby=None, **kwargs
)
```

Bases: <code>[\_RollingBase](#mlforecast.lag_transforms._RollingBase)</code>

Rolling statistic

### `RollingMax`

Bases: <code>[\_RollingBase](#mlforecast.lag_transforms._RollingBase)</code>

Rolling statistic

### `RollingMin`

Bases: <code>[\_RollingBase](#mlforecast.lag_transforms._RollingBase)</code>

Rolling statistic

### `RollingStd`

Bases: <code>[\_RollingBase](#mlforecast.lag_transforms._RollingBase)</code>

Rolling statistic

### `RollingMean`

Bases: <code>[\_RollingBase](#mlforecast.lag_transforms._RollingBase)</code>

Rolling statistic

### `SeasonalRollingQuantile`

```python theme={null}
SeasonalRollingQuantile(
    p,
    season_length,
    window_size,
    min_samples=None,
    global_=False,
    groupby=None,
    **kwargs
)
```

Bases: <code>[\_Seasonal\_RollingBase](#mlforecast.lag_transforms._Seasonal_RollingBase)</code>

Rolling statistic over seasonal periods

### `SeasonalRollingMax`

Bases: <code>[\_Seasonal\_RollingBase](#mlforecast.lag_transforms._Seasonal_RollingBase)</code>

Rolling statistic over seasonal periods

### `SeasonalRollingMin`

Bases: <code>[\_Seasonal\_RollingBase](#mlforecast.lag_transforms._Seasonal_RollingBase)</code>

Rolling statistic over seasonal periods

### `SeasonalRollingStd`

Bases: <code>[\_Seasonal\_RollingBase](#mlforecast.lag_transforms._Seasonal_RollingBase)</code>

Rolling statistic over seasonal periods

### `SeasonalRollingMean`

Bases: <code>[\_Seasonal\_RollingBase](#mlforecast.lag_transforms._Seasonal_RollingBase)</code>

Rolling statistic over seasonal periods

### `ExpandingQuantile`

```python theme={null}
ExpandingQuantile(p, global_=False, groupby=None, **kwargs)
```

Bases: <code>[\_ExpandingBase](#mlforecast.lag_transforms._ExpandingBase)</code>

Expanding statistic

**Parameters:**

| Name      | Type                        | Description                                                                                                                                    | Default    |
| --------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `global_` | <code>bool</code>           | If True, compute the statistic across all series aggregated by timestamp. Requires all series to end at the same timestamp. Defaults to False. | *required* |
| `groupby` | <code>Sequence\[str]</code> | Column names to group by before computing the statistic. Columns must be static features. Mutually exclusive with `global_`. Defaults to None. | *required* |

### `ExpandingMax`

Bases: <code>[\_ExpandingBase](#mlforecast.lag_transforms._ExpandingBase)</code>

Expanding statistic

**Parameters:**

| Name      | Type                        | Description                                                                                                                                    | Default    |
| --------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `global_` | <code>bool</code>           | If True, compute the statistic across all series aggregated by timestamp. Requires all series to end at the same timestamp. Defaults to False. | *required* |
| `groupby` | <code>Sequence\[str]</code> | Column names to group by before computing the statistic. Columns must be static features. Mutually exclusive with `global_`. Defaults to None. | *required* |

### `ExpandingMin`

Bases: <code>[\_ExpandingBase](#mlforecast.lag_transforms._ExpandingBase)</code>

Expanding statistic

**Parameters:**

| Name      | Type                        | Description                                                                                                                                    | Default    |
| --------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `global_` | <code>bool</code>           | If True, compute the statistic across all series aggregated by timestamp. Requires all series to end at the same timestamp. Defaults to False. | *required* |
| `groupby` | <code>Sequence\[str]</code> | Column names to group by before computing the statistic. Columns must be static features. Mutually exclusive with `global_`. Defaults to None. | *required* |

### `ExpandingStd`

Bases: <code>[\_ExpandingBase](#mlforecast.lag_transforms._ExpandingBase)</code>

Expanding statistic

**Parameters:**

| Name      | Type                        | Description                                                                                                                                    | Default    |
| --------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `global_` | <code>bool</code>           | If True, compute the statistic across all series aggregated by timestamp. Requires all series to end at the same timestamp. Defaults to False. | *required* |
| `groupby` | <code>Sequence\[str]</code> | Column names to group by before computing the statistic. Columns must be static features. Mutually exclusive with `global_`. Defaults to None. | *required* |

### `ExpandingMean`

Bases: <code>[\_ExpandingBase](#mlforecast.lag_transforms._ExpandingBase)</code>

Expanding statistic

**Parameters:**

| Name      | Type                        | Description                                                                                                                                    | Default    |
| --------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `global_` | <code>bool</code>           | If True, compute the statistic across all series aggregated by timestamp. Requires all series to end at the same timestamp. Defaults to False. | *required* |
| `groupby` | <code>Sequence\[str]</code> | Column names to group by before computing the statistic. Columns must be static features. Mutually exclusive with `global_`. Defaults to None. | *required* |

### `ExponentiallyWeightedMean`

```python theme={null}
ExponentiallyWeightedMean(alpha, global_=False, groupby=None, **kwargs)
```

Bases: <code>[\_BaseLagTransform](#mlforecast.lag_transforms._BaseLagTransform)</code>

Exponentially weighted average

**Parameters:**

| Name      | Type                                                    | Description                                                                                                                                    | Default            |
| --------- | ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| `alpha`   | <code>[float](#float)</code>                            | Smoothing factor.                                                                                                                              | *required*         |
| `global_` | <code>[bool](#bool)</code>                              | If True, compute the statistic across all series aggregated by timestamp. Requires all series to end at the same timestamp. Defaults to False. | <code>False</code> |
| `groupby` | <code>[Sequence](#typing.Sequence)\[[str](#str)]</code> | Column names to group by before computing the statistic. Columns must be static features. Mutually exclusive with `global_`. Defaults to None. | <code>None</code>  |

### `Offset`

```python theme={null}
Offset(tfm, n)
```

Bases: <code>[\_BaseLagTransform](#mlforecast.lag_transforms._BaseLagTransform)</code>

Shift series before computing transformation

**Parameters:**

| Name  | Type                                       | Description                                                                  | Default    |
| ----- | ------------------------------------------ | ---------------------------------------------------------------------------- | ---------- |
| `tfm` | <code>[LagTransform](#LagTransform)</code> | Transformation to be applied                                                 | *required* |
| `n`   | <code>[int](#int)</code>                   | Number of positions to shift (lag) series before applying the transformation | *required* |

### `Combine`

```python theme={null}
Combine(tfm1, tfm2, operator)
```

Bases: <code>[\_BaseLagTransform](#mlforecast.lag_transforms._BaseLagTransform)</code>

Combine two lag transformations using an operator

**Parameters:**

| Name       | Type                                       | Description                                                          | Default    |
| ---------- | ------------------------------------------ | -------------------------------------------------------------------- | ---------- |
| `tfm1`     | <code>[LagTransform](#LagTransform)</code> | First transformation.                                                | *required* |
| `tfm2`     | <code>[LagTransform](#LagTransform)</code> | Second transformation.                                               | *required* |
| `operator` | <code>[callable](#callable)</code>         | Binary operator that defines how to combine the two transformations. | *required* |
