Performs weighted kernel density estimation for univariate data. This is useful for analyzing parameter distributions where each sample has an associated importance weight (e.g., a likelihood).
weighted_kde(x, weights, n = 512, from = min(x), to = max(x))
A list containing the evaluation points (x
) and the estimated density values (y
).
A numeric vector of samples.
A numeric vector of weights corresponding to each sample in x.
The integer number of points at which to evaluate the density.
The range over which to evaluate the density.