Skip to content

Kurtosis

Source code

Description

Compute the kurtosis (Fisher or Pearson) of a dataset.

Usage

<Expr>$kurtosis(fisher = TRUE, bias = TRUE)

Arguments

fisher If TRUE (default), Fisher’s definition is used (normal, centered at 0). Otherwise, Pearson’s definition is used (normal, centered at 3).
bias If FALSE, the calculations are corrected for statistical bias.

Details

Kurtosis is the fourth central moment divided by the square of the variance. If Fisher’s definition is used, then 3 is subtracted from the result to give 0 for a normal distribution.

If bias is FALSE, then the kurtosis is calculated using k statistics to eliminate bias coming from biased moment estimators.

Value

Expr

Examples

library("polars")

pl$DataFrame(a = c(1:3, 2:1))$
  with_columns(kurt = pl$col("a")$kurtosis())
#> shape: (5, 2)
#> ┌─────┬───────────┐
#> │ a   ┆ kurt      │
#> │ --- ┆ ---       │
#> │ i32 ┆ f64       │
#> ╞═════╪═══════════╡
#> │ 1   ┆ -1.153061 │
#> │ 2   ┆ -1.153061 │
#> │ 3   ┆ -1.153061 │
#> │ 2   ┆ -1.153061 │
#> │ 1   ┆ -1.153061 │
#> └─────┴───────────┘