running_median¶
- eazy.utils.running_median(xi, yi, NBIN=10, reverse=False, bins=None, x_func=<function median>, y_func=<function median>, std_func=<function mad_std>, x_kwargs={}, y_kwargs={}, std_kwargs={}, use_biweight=False, integrate=False, **kwargs)[source]¶
Binned median/biweight/nmad statistics
- Parameters:
- xiarray-like
Data of independent variable
- yiarray-like
Data of dependent variable
- NBINint
Number of bins along
xi
- reversebool
Calculate bins starting at largest values of
xi
- binsarray-like
Fixed bins, rather than calculating with
NBIN
- x_funcfunction
Function to compute moments of
xi
- y_func, std_funcfunction
Functions to compute moments of
yi
. Assumed to be the central value and dispersion, but don’t have to be- x_kwargs, y_kwargs, std_kwargsdict
Keyword arguments to pass to moment functions
- use_biweightbool
Use robust biweight estimators:
x_func
:astropy.stats.biweight_location
y_func
:astropy.stats.biweight_location
std_func
:astropy.stats.biweight_midvariance
- integratebool
Numerically integrate
yi
with the trapezoidal rule within the bins
- Returns:
- xm, ym, ysarray-like
Binned moments of
xi
andyi
- ynarray-like
Number of entries per bin