x = c(rnorm(100, 0, 1), rnorm(100, 5, 1))
dens = smoothdens(x, par = list(mean = c(0, 5), sd = c(1, 1)))
# densities at the initial coefficients
pred = predict(dens, coef = dens$coef)
matplot(pred$x, pred$density, type = "l", lty = 1)
Run the code above in your browser using DataLab