> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify-poc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# kurtosis_y() | kurtosis_x()

> Calculate the kurtosis from a two-dimensional statistical aggregate for the dimension specified

<Icon icon="tag" iconType="duotone" /> Since [1.3.0][toolkit-1.3.0]

Calculate the kurtosis from a two-dimensional statistical aggregate for the given dimension. For example, `kurtosis_y()`
calculates the kurtosis for all the values of the `y` variable, independent of values of the `x` variable. The kurtosis
is the fourth statistical moment. It is a measure of "tailedness" of a data distribution compared to a normal
distribution.

## Samples

Calculate the kurtosis of a sample containing the integers from 0 to 100:

```sql theme={"dark"}
SELECT kurtosis_y(stats_agg(data, data))
  FROM generate_series(0, 100) data;
```

This returns something like:

```sql theme={"dark"}
kurtosis_y
----------
1.78195
```

## Arguments

The syntax is:

```sql theme={"dark"}
kurtosis_y(
  summary StatsSummary2D,
  [ method TEXT ]
) RETURNS DOUBLE PRECISION
```

```sql theme={"dark"}
kurtosis_x(
  summary StatsSummary2D,
  [ method TEXT ]
) RETURNS DOUBLE PRECISION
```

| Name    | Type           | Default  | Required | Description                                                                                                                              |
| ------- | -------------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| summary | StatsSummary2D | -        | ✔        | The statistical aggregate produced by a `stats_agg` call                                                                                 |
| method  | TEXT           | `sample` | -        | The method used for calculating the kurtosis. The two options are `population` and `sample`, which can be abbreviated to `pop` or `samp` |

## Returns

| Column                     | Type             | Description                                             |
| -------------------------- | ---------------- | ------------------------------------------------------- |
| kurtosis\_y \| kurtosis\_x | DOUBLE PRECISION | The kurtosis of the values in the statistical aggregate |

[toolkit-1.3.0]: https://github.com/timescale/timescaledb-toolkit/releases/tag/1.3.0
