nustattools.stats package

Module contents

Copyright (c) 2024 Lukas Koch. All rights reserved.

Statistical distributions that are useful, but not available in scipy.stats.

class nustattools.stats.Bee(momtype=1, a=None, b=None, xtol=1e-14, badvalue=None, name=None, longname=None, shapes=None, seed=None)[source]

Bases: rv_continuous

A random variable representing the maximum of df chi distributions.

Each chi disitribution has df = 1.

Note

You probably do not need to use this class directly. Instead work with the instance bee.

Parameters:

df (int) – The number of chi-distirbuted variables to take the maximum of.

class nustattools.stats.Bee2(momtype=1, a=None, b=None, xtol=1e-14, badvalue=None, name=None, longname=None, shapes=None, seed=None)[source]

Bases: rv_continuous

A random variable representing the maximum of df chi2 distributions.

Each chii2 disitribution has df = 1.

Note

You probably do not need to use this class directly. Instead work with the instance bee2.

Parameters:

df (int) – The number of chi-distirbuted variables to take the maximum of.

Notes

This distribution is discussed in [1] in the context of robust test statistics.

References

class nustattools.stats.Cee(momtype=1, a=None, b=None, xtol=1e-14, badvalue=None, name=None, longname=None, shapes=None, seed=None)[source]

Bases: rv_continuous

A random variable representing the maximum of multiple chi distributions.

Each chi disitribution can have a different df. If all df are equal to 1, this is identical to the Bee distribution with df = len(k).

Note

You probably do not need to use this class directly. Instead work with the instance cee.

Parameters:

k (DF or Iterable of DF) – Special class to pass variable length list of degrees of freedom of the chi-distirbuted variables to take the maximum of.

Examples

>>> cee(k=DF(1,2,3)).pdf(1)
0.2501359390297275
class nustattools.stats.Cee2(momtype=1, a=None, b=None, xtol=1e-14, badvalue=None, name=None, longname=None, shapes=None, seed=None)[source]

Bases: rv_continuous

A random variable representing the maximum of multiple chi2 distributions.

Each chi2 disitribution can have a different df. If all df are equal to 1, this is identical to a Bee2 disritbution with df = len(k).

Note

You probably do not need to use this class directly. Instead work with the instance cee2.

Parameters:

k (DF or Iterable of DF) – Special class to pass variable length list of degrees of freedom of the chi-distirbuted variables to take the maximum of.

Examples

>>> cee2(k=DF(1,2,3)).pdf(1)
0.12506796951321578

Notes

TODO: Add reference to paper.

class nustattools.stats.DF(*args)[source]

Bases: object

Helper class to get around limitations of rv_continuous.

This class represents the shape parameter for the Cee and Cee2 distributions.

Parameters:

*args (tuple of int) – The df for each chi(2) distribution

nustattools.stats.bee = <nustattools.stats._dist.Bee object>

Use this instance of Bee.

nustattools.stats.bee2 = <nustattools.stats._dist.Bee2 object>

Use this instance of Bee2.

nustattools.stats.cee = <nustattools.stats._dist.Cee object>

Use this instance of Cee.

nustattools.stats.cee2 = <nustattools.stats._dist.Cee2 object>

Use this instance of Cee2.