Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zero density error at bounds #10

Open
drbenvincent opened this issue Feb 13, 2021 · 0 comments
Open

zero density error at bounds #10

drbenvincent opened this issue Feb 13, 2021 · 0 comments

Comments

@drbenvincent
Copy link

drbenvincent commented Feb 13, 2021

There are examples of situations where the density at a bound is returned as zero when it shouldn't be.

An example:

using KernelEstimator, Distributions, StatsPlots

dist = Exponential(1)
x = rand(dist, 1000);
histogram(x, normalize=:pdf, alpha=0.2, label=false)
xs = LinRange(0, maximum(x)+1, 399);
den = kerneldensity(x, xeval=xs, kernel=gammakernel, lb=0.0, ub=Inf);
plot!(xs, den, lw=2, colour=:red, label="kerneldensity")
plot!(xs, pdf(dist, xs), color=:black, lw=2, label="true")

Screenshot 2021-02-13 at 13 21 23

and all(den .> 0) results in false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant