weighted_kde: Weighted Kernel Density Estimation

View source: R/adaptive_sampling.R

weighted_kdeR Documentation

Weighted Kernel Density Estimation

Description

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).

Usage

weighted_kde(x, weights, n = 512, from = min(x), to = max(x))

Arguments

x

A numeric vector of samples.

weights

A numeric vector of weights corresponding to each sample in x.

n

The integer number of points at which to evaluate the density.

from, to

The range over which to evaluate the density.

Value

A list containing the evaluation points (x) and the estimated density values (y).


topolow documentation built on Aug. 31, 2025, 1:07 a.m.