Mass point to the right in the estimated density
Closed this issue · 2 comments
pkofod commented
I am not sure if this is a bug, or my ignorance but running
using Distributions
using Gadfly
using KernelDensity
n = 300
dx = rand(TruncatedNormal(1., 20., 0, Inf),n)
x = cumsum(dx)
dx_kde = kde(dx)
dx_kde_midpoints = kde(dx, minimum(dx):maximum(dx)*2)
plot(x=1:n, y=x, Geom.line)
plot(x = dx_kde.x, y = dx_kde.density,Geom.line)
plot(x = dx_kde_midpoints.x, y = dx_kde_midpoints.density, Geom.line)
Gives the following two plots (in the same order as the code)
I really just wanted to truncate it to the left, which seems to work. No matter how high or low I set the upper limit in the kde(Array, Range)
call, I get that jump in the end.
simonbyrne commented
See #12 (comment)
pkofod commented
Ah, okay, so I am basically seemingly the probability i remove to the left being added to the right. I get it