Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: JuliaStats/KernelDensity.jl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.6.7
Choose a base ref
...
head repository: JuliaStats/KernelDensity.jl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 4 commits
  • 2 files changed
  • 5 contributors

Commits on Dec 15, 2023

  1. CompatHelper: bump compat for Interpolations to 0.15, (keep existing …

    …compat) (#119)
    
    Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org>
    github-actions[bot] and CompatHelper Julia authored Dec 15, 2023
    Copy the full SHA
    2c34861 View commit details
  2. Update Project.toml

    devmotion authored Dec 15, 2023
    2
    Copy the full SHA
    ab69a51 View commit details

Commits on Jan 29, 2024

  1. Adding help to kde method (#121)

    * Update univariate.jl
    
    * Update src/univariate.jl
    
    Co-authored-by: Tamas K. Papp <tkpapp@gmail.com>
    
    * Update src/univariate.jl
    
    Co-authored-by: Tamas K. Papp <tkpapp@gmail.com>
    
    ---------
    
    Co-authored-by: Tamas K. Papp <tkpapp@gmail.com>
    jaksle and tpapp authored Jan 29, 2024
    Copy the full SHA
    93437e0 View commit details

Commits on Apr 30, 2024

  1. Update Project.toml

    patch release
    tpapp authored Apr 30, 2024
    2
    Copy the full SHA
    45b3291 View commit details
Showing with 16 additions and 2 deletions.
  1. +2 −2 Project.toml
  2. +14 −0 src/univariate.jl
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "KernelDensity"
uuid = "5ab0869b-81aa-558d-bb23-cbf5423bbe9b"
authors = ["Simon Byrne and various contributors"]
version = "0.6.7"
version = "0.6.9"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
@@ -14,7 +14,7 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Distributions = "0.23, 0.24, 0.25"
DocStringExtensions = "0.8, 0.9"
FFTW = "1"
Interpolations = "0.9, 0.10, 0.11, 0.12, 0.13, 0.14"
Interpolations = "0.9, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15"
StatsBase = "0.33, 0.34"
julia = "1"

14 changes: 14 additions & 0 deletions src/univariate.jl
Original file line number Diff line number Diff line change
@@ -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)