Skip to main content

Module location_scale

Module location_scale 

Source
Expand description

More location, scale and shape summaries, following scipy.stats: trimmed means (trim_mean), standard scores (zscore), the mode, circular statistics (circmean, circvar, circstd), and the maximum-likelihood Box-Cox transform (boxcox, boxcox_llf, boxcox_normmax).

See the book entry More descriptive statistics and robust regression.

Functions§

boxcox
The maximum-likelihood Box-Cox transform of positive data and its λ (SciPy’s stats.boxcox).
boxcox_llf
The Box-Cox profile log-likelihood of λ for positive data (SciPy’s boxcox_llf): (λ − 1) Σ ln xᵢ − (n/2) ln σ̂²(λ), where σ̂² is the variance (ddof = 0) of the transformed data.
boxcox_normmax
The λ that maximises boxcox_llf (SciPy’s boxcox_normmax with method='mle'): the power that makes the data most nearly normal. A golden-section search on [−2, 2], widened while the maximum sits at an end of the interval.
circmean
The circular mean of angles with period high − low (SciPy’s circmean; use 0 and 2π for radians): the direction of the mean resultant vector, mapped into [low, high).
circstd
The circular standard deviation √(−2 ln R), in the units of the angles (SciPy’s circstd). It approaches the ordinary standard deviation for concentrated angles.
circvar
The circular variance 1 − R (SciPy’s circvar), between 0 (all angles equal) and 1.
mode
The most frequent value and its count; ties go to the smallest value (SciPy’s mode).
trim_mean
The mean after removing the ⌊proportion · n⌋ smallest and largest values (SciPy’s trim_mean). With proportion = 0 it is the mean; as it approaches ½ it approaches the median.
zscore
The standard scores (xᵢ − x̄)/s with s computed with ddof degrees of freedom removed (SciPy’s zscore, whose default is ddof = 0).