Given a vector of values, computes the empirical density for each observation.

density_points(x, ...)

Arguments

x

A numeric vector.

...

Additional arguments to be passed to the density function.

Value

A list with...

  • x = the sorted values for the original input;

  • y = the associated empirical densities.

Examples

plot(c(-4,4),c(0,.5),type='n',ylab='Density',xlab='z-scores')
x = rnorm( 100 )
dp = density_points( x )
points( dp$x, dp$y, pch = 19 )