arviz_stats.numba.array_stats.histogram

arviz_stats.numba.array_stats.histogram#

array_stats.histogram(ary, bins=None, range=None, weights=None, axis=-1, density=None)#

Compute histogram over provided axis.

Parameters:
aryarray_like
binsstr, scalar or array_like, optional
range(float, float), optional
weightsarray_like, optional
axisint, sequence of int or None, default -1
densitybool, optional
Returns:
hist, bin_edgesarray_like

The shape of hist will be that of ary minus the dimensions in axis plus an extra dimension of length nbins, same for bin_edges with the difference the extra dimension has length nbins+1.

Notes

The weights argument is not supported, but the density argument is supported. It uses the jit compiled histogram function to accelerate computations. histogram is called in multiple places along the codebase (like the kde function for instance), so this function alone accelerates slightly a significant part of the codebase.