Skip to content

Commit 93437e0

Browse files
jaksletpapp
andauthored
Adding help to kde method (#121)
* Update univariate.jl * Update src/univariate.jl Co-authored-by: Tamas K. Papp <[email protected]> * Update src/univariate.jl Co-authored-by: Tamas K. Papp <[email protected]> --------- Co-authored-by: Tamas K. Papp <[email protected]>
1 parent ab69a51 commit 93437e0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/univariate.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,20 @@ function conv(k::UnivariateKDE, dist::UnivariateDistribution)
147147
end
148148

149149
# main kde interface methods
150+
151+
"""
152+
153+
kde(data; kwargs...)
154+
kde((xdata, ydata); kwargs...)
155+
156+
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.
157+
158+
The keyword arguments are
159+
* `boundary`: the lower and upper limits of the kde, tuple in 1D case, tuple of tuples in 2D case,
160+
* `npoints`: the number of interpolation points to use,
161+
* `kernel = Normal`: the distributional family from [Distributions.jl](https://github.com/JuliaStats/Distributions.jl),
162+
* `bandwidth`: the bandwidth of the kernel; default is calculated using Silverman's rule.
163+
"""
150164
function kde(data::AbstractVector{<:Real}, weights::Weights, midpoints::R, dist::UnivariateDistribution) where R<:AbstractRange
151165
k = tabulate(data, midpoints, weights)
152166
conv(k,dist)

0 commit comments

Comments
 (0)