Normal kernel density estimate for semiparametric EM output
Takes an object of class
spEM and returns an object of class
density giving the kernel density estimate.
An object of class
Vector of points at which the density is to be evaluated
Mixture component number; should be an integer from 1 to the
number of columns of
Block of repeated measures. Only applicable in repeated measures
case, for which
Logical: If TRUE, multiply the density values by the
corresponding mixing proportions found in
Additional arguments; not used by this method.
The bandwidth is taken to be the same as that used to produce the
object, which is given by
density.spEM returns a list of type
density for details. In particular, the output of
density.spEM may be used directly by functions such as
1 2 3 4 5 6 7 8 9
set.seed(100) mu <- matrix(c(0, 15), 2, 3) sigma <- matrix(c(1, 5), 2, 3) x <- rmvnormmix(300, lambda = c(.4,.6), mu = mu, sigma = sigma) d <- spEM(x, mu0 = 2, blockid = rep(1,3), constbw = TRUE) plot(d, xlim=c(-10, 40), ylim = c(0, .16), xlab = "", breaks = 30, cex.lab=1.5, cex.axis=1.5) # plot.spEM calls density.spEM here
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.