# CHANGE-POINT

The CHANGE_POINT command detects spikes, dips, and change points in a metric. It adds columns to the table indicating the change point type and a p-value, which reflects how extreme the change is (lower values indicate greater changes). The possible change point types are: `dip`, `distribution_change`, `spike`, `step_change`, and `trend_change`.

## Syntax

`CHANGE_POINT value [ON key] [AS type_name, pvalue_name]`

### Parameters

#### value

The column containing the metric where you want to detect change points.

#### key

Optional. The column used to order the values. If not specified, `@timestamp` is used.

#### type_name

Optional. The name of the output column for the change point type. Defaults to `type`.

#### pvalue_name

Optional. The name of the output column for the p-value indicating the extremity of the change point. Defaults to `pvalue`.

## Examples

Detects a statistically significant step change in the `value` column, ordered by `key`, and filters the results to show only detected change points.

```esql
ROW key=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]
| MV_EXPAND key
| EVAL value = CASE(key<13, 0, 42)
| CHANGE_POINT value ON key
| WHERE type IS NOT NULL
```
This example identifies a statistically significant step change in the `value` column, ordered by `key`, and filters the results to show only detected change points.

## Limitations

- At least 22 values are required for change point detection. Fewer than 1,000 values is preferred.
- The CHANGE_POINT command requires a platinum license.