8.2.4. Stats#
Provide functions for statistics.
- junifer.stats.get_aggfunc_by_name(name, func_params=None)#
Get an aggregation function by its name.
- Parameters:
- name
str
Name to identify the function. Currently supported names and corresponding functions are:
winsorized_mean
->scipy.stats.mstats.winsorize()
mean
->numpy.mean()
std
->numpy.std()
trim_mean
->scipy.stats.trim_mean()
- func_params
dict
, optional Parameters to pass to the function. E.g. for
winsorized_mean
:func_params = {'limits': [0.1, 0.1]}
(default None).
- name
- Returns:
- function
Respective function with
func_params
parameter set.
- junifer.stats.winsorized_mean(data, axis=None, **win_params)#
Compute a winsorized mean by chaining winsorization and mean.
- Parameters:
- data
numpy.ndarray
Data to calculate winsorized mean on.
- axis
int
, optional The axis to calculate winsorized mean on (default None).
- **win_params
dict
Dictionary containing the keyword arguments for the winsorize function. E.g.
{'limits': [0.1, 0.1]}
.
- data
- Returns:
numpy.ndarray
Winsorized mean of the inputted data with the winsorize settings applied as specified in
win_params
.
See also
scipy.stats.mstats.winsorize
The winsorize function used in this function.