Skip to content

Commit

Permalink
Merge pull request #236 from jorenham/feature/kurt
Browse files Browse the repository at this point in the history
Add `l_kurt` and `l_cokurt` aliases
  • Loading branch information
jorenham authored May 23, 2024
2 parents 74db36f + 0b2dace commit 443169e
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 14 deletions.
41 changes: 27 additions & 14 deletions lmo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
"""Lmo: Robust statistics with trimmed L-moments and L-comoments."""
import sys
"""
Robust statistics with trimmed L-moments and L-comoments.
"""

import sys # noqa: I001
from typing import TYPE_CHECKING, Final

from ._lm import (
l_kurtosis,
l_loc,
l_moment,
l_moment_cov,
l_moment_influence,
l_ratio,
l_ratio_influence,
l_ratio_se,
l_scale,
l_variation,
l_skew,
l_kurtosis,

l_kurt,
l_moment,
l_ratio,
l_stats,

l_moment_cov,
l_ratio_se,
l_stats_se,
l_variation,

l_moment_influence,
l_ratio_influence,

l_weights,
)
from ._lm_co import (
l_cokurtosis,
l_coloc,
l_comoment,
l_coratio,
l_corr,
l_coscale,

l_corr,
l_coskew,
l_cokurtosis,
l_cokurt,

l_comoment,
l_coratio,
l_costats,
)
from ._meta import get_version as _get_version
Expand Down Expand Up @@ -60,6 +71,7 @@
'l_variation',
'l_skew',
'l_kurtosis',
'l_kurt',

'l_moment',
'l_ratio',
Expand All @@ -79,6 +91,7 @@
'l_corr',
'l_coskew',
'l_cokurtosis',
'l_cokurt',

'l_comoment',
'l_coratio',
Expand Down
4 changes: 4 additions & 0 deletions lmo/_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
'l_variation',
'l_skew',
'l_kurtosis',
'l_kurt',

'l_moment_cov',
'l_ratio_se',
Expand Down Expand Up @@ -923,6 +924,9 @@ def l_kurtosis(
return l_ratio(a, 4, 2, trim=trim, axis=axis, dtype=dtype, **kwds)


l_kurt = l_kurtosis


def l_moment_cov(
a: lnpt.AnyArrayFloat,
r_max: AnyOrder,
Expand Down
4 changes: 4 additions & 0 deletions lmo/_lm_co.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'l_corr',
'l_coskew',
'l_cokurtosis',
'l_cokurt',
)


Expand Down Expand Up @@ -429,3 +430,6 @@ def l_cokurtosis(
- [`lmo.l_kurtosis`][lmo.l_kurtosis]
"""
return l_coratio(a, 4, 2, trim=trim, dtype=dtype, **kwds)


l_cokurt = l_cokurtosis
4 changes: 4 additions & 0 deletions lmo/contrib/scipy_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ def l_kurtosis(
"""
return float(self.l_ratio(4, 2, *args, trim=trim, **kwds))

l_kurt = l_kurtosis

def l_moments_cov(
self,
r_max: int,
Expand Down Expand Up @@ -1448,6 +1450,8 @@ def l_skew(self, trim: AnyTrim = 0) -> float: # noqa: D102
def l_kurtosis(self, trim: AnyTrim = 0) -> float: # noqa: D102
return self.dist.l_kurtosis(*self.args, trim=trim, **self.kwds)

l_kurt = l_kurtosis

def l_moments_cov( # noqa: D102
self,
r_max: int,
Expand Down
2 changes: 2 additions & 0 deletions lmo/distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,8 @@ def l_kurtosis(self, trim: AnyTrim | None = None) -> float:
"""
return float(self.l_ratio(4, 2, trim=trim))

l_kurt = l_kurtosis

# `rv_continuous` and `rv_frozen` compatibility

@property
Expand Down

0 comments on commit 443169e

Please sign in to comment.