Log-pdf kernel evaluation

It is easy to construct a kernel estimate for the probability density function (pdf) of a random variable given by the observation vector through:

plot(density(x)) 

I would like to do the same, but for log-pdf (probability density function log).

+4
source share
1 answer

You can do

 d <- density(x) plot(d$x, log(d$y), type="l") 

or maybe you prefer

 plot(d, log="y") 
+3
source

All Articles