arviz_stats.base.dataarray_stats.kde

arviz_stats.base.dataarray_stats.kde#

dataarray_stats.kde(da, dim=None, circular=False, grid_len=512, **kwargs)#

Compute KDE on DataArray input.

Parameters:
daxarray.DataArray

Input data.

dimstr or sequence of str, optional

Dimension(s) over which to compute the KDE.

circularbool, default False

Whether the data is circular (e.g., angles).

grid_lenint, default 512

Number of points on the KDE grid.

**kwargsdict, optional

Additional keyword arguments passed to the array-level KDE implementation. See the underlying array kde method for a complete list of supported arguments (like bw and adaptive).

Returns:
outxarray.DataArray

An xarray DataArray containing the grid and pdf values along the plot_axis dimension, with the bandwidth bw stored as a coordinate.