arviz_stats.base.array_stats.quantile

arviz_stats.base.array_stats.quantile#

array_stats.quantile(ary, quantile, axis=-1, method='linear', skipna=False, weights=None)#

Compute the quantile of an array of samples.

Implementation wise, the version in arviz_stats.base.array_stats calls either numpy.quantile or numpy.nanquantile and ensures the added dimension is the last one for compatibility with xarray.apply_ufunc when using it as part of the DataArray interface.

Parameters:
aryarray_like
quantilefloat or array_like
axisint or sequence of int or None, default -1
methodstr, default “linear”
skipnabool, default False
weightsarray_like, optional

Array with the same shape as a with the weights associated to the values of a.

Notes

Should default to NumPy’s “linear” method, which corresponds to type 7 from H&F [1].

References

[1]

R. J. Hyndman and Y. Fan, “Sample quantiles in statistical packages,” The American Statistician, 50(4), pp. 361-365, 1996