diff --git a/Project.toml b/Project.toml index e0df42fe..e9ed4a9d 100644 --- a/Project.toml +++ b/Project.toml @@ -11,6 +11,7 @@ Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" [compat] +Compat = "2.2.0" Distributions = "0.23, 0.24, 0.25" DocStringExtensions = "0.8, 0.9" FFTW = "1" diff --git a/src/KernelDensity.jl b/src/KernelDensity.jl index b6201c8a..61cde468 100644 --- a/src/KernelDensity.jl +++ b/src/KernelDensity.jl @@ -4,6 +4,7 @@ using DocStringExtensions: TYPEDEF, FIELDS using StatsBase using Distributions using Interpolations +using Compat import Distributions: twoπ, pdf import FFTW: rfft, irfft diff --git a/src/interp.jl b/src/interp.jl index 3f2e726a..a404ec7d 100644 --- a/src/interp.jl +++ b/src/interp.jl @@ -30,7 +30,7 @@ InterpKDE(kde::BivariateKDE) = InterpKDE(kde::BivariateKDE, BSpline(Quadratic(Li # any dimension pdf(ik::InterpKDE,x::Real...) = ik.itp(x...) pdf(ik::InterpKDE, V::AbstractVector) = ik.itp(V...) -pdf(ik::InterpKDE, M::AbstractArray{<:Real, N}) where N = pdf.(ik,eachslice(M, dims=ntuple(i->i+1, N-1)) ) +@compat pdf(ik::InterpKDE, M::AbstractArray{<:Real, N}) where N = pdf.(ik,eachslice(M, dims=ntuple(i->i+1, N-1)) ) # 1 dimension pdf(k::UnivariateKDE,x) = pdf(InterpKDE(k),x)