diff --git a/src/univariate.jl b/src/univariate.jl index cba5181d..5f71a809 100644 --- a/src/univariate.jl +++ b/src/univariate.jl @@ -147,6 +147,20 @@ function conv(k::UnivariateKDE, dist::UnivariateDistribution) end # main kde interface methods + +""" + + kde(data; kwargs...) + kde((xdata, ydata); kwargs...) + +Kernel density estimation method. Returns 1D or 2D KDE object. The grid used and the values of the estimated density can be obtained from fields `.x` and `.density` respectively. To obtain kde values at points different than the initial grid use the `pdf` method. + +The keyword arguments are +* `boundary`: the lower and upper limits of the kde, tuple in 1D case, tuple of tuples in 2D case, +* `npoints`: the number of interpolation points to use, +* `kernel = Normal`: the distributional family from [Distributions.jl](https://github.com/JuliaStats/Distributions.jl), +* `bandwidth`: the bandwidth of the kernel; default is calculated using Silverman's rule. +""" function kde(data::AbstractVector{<:Real}, weights::Weights, midpoints::R, dist::UnivariateDistribution) where R<:AbstractRange k = tabulate(data, midpoints, weights) conv(k,dist)