npEM(x, mu0, blockid = 1:ncol(x),
bw = bw.nrd0(as.vector(as.matrix(x))), samebw = TRUE,
h = bw, eps = 1e-8,
maxiter = 500, stochastic = FALSE, verb = TRUE)x) that are
assumed to be identically distributed (i.e., in the same block). For instance,
the default has all distinct elements, indicating that no two coordinates
are assbw.nrd0
bandwidth used by TRUE, use the same bandwidth for
each iteration and for each component and block. If FALSE,
use a separate bandwidth for each component and block, and update
this bandwidth at each iteration of the algorithm lambda vector (of mixing proportion estimates) does not exceed
eps.stochastic = FALSE), convergence
may be declared before maxiter iterations (see eps abmaxiternpEM returns a list of class npEM with the following items:stochastic = TRUE, this matrix is computed
from an average over the maxiter iterations.samebw==TRUE,
same as the bw input argument; otherwise, value of bw matrix
at final iteration. This
information is needed by any method that produces density estimates from the
output.blockid input argument, but recoded to have
positive integer values. Also needed by any method that produces density
estimates from the output.stochastic = FALSE,
or the average mixing proportions if stochastic = TRUE.plot.npEM, normmixrm.sim, spEMsymloc,
spEM, plotseq.npEM## Examine and plot water-level task data set.
## First, try a 3-component solution where no two coordinates are
## assumed i.d.
data(Waterdata)
set.seed(100)
a <- npEM(Waterdata, mu0=3, bw=4) # Assume indep but not iid
plot(a) # This produces 8 plots, one for each coordinate
## Next, same thing but pairing clock angles that are directly opposite one
## another (1:00 with 7:00, 2:00 with 8:00, etc.)
b <- npEM(Waterdata, mu0=3, blockid=c(4,3,2,1,3,4,1,2), bw=4) # iid in pairs
plot(b) # Now only 4 plots, one for each blockRun the code above in your browser using DataLab