Description Usage Arguments Value Author(s) Examples
Stochastic EM algorithm
1 2 3 4 |
model |
String defining model |
modelpar |
Model parameters |
theta0 |
Initial parameter vector |
data |
data-frame |
cluster |
See |
eta |
See |
control |
See |
Mfun |
Function defining M-step |
CondVarEta |
Variance of proposal distribution (defaults to the identity matrix). |
update |
Adaptive algorithm, where the variance of the proposal distribution is updated in each E-step from the empirical distribution of the latent variables given the data (obtained from previous E-step). |
m |
The number of imputations to base the E-step on (m=1 => StEM) |
nsim |
Number of samples to draw in the E-step (a burnin period is needed!) |
iter |
Number of iterations of the EM-algorithm |
stepsize |
Scaling of the variance of the proposal distribution |
burnin |
For development testing only |
plot |
Plot coordinates 'idx' of chain |
idx |
Trace these coordinates |
printidx |
Print these coordinates in each M-step |
printvar |
Boolean indicating whether variance parameters should be printed |
... |
Additional parameters parsed on to lower-level functions. |
list
Klaus K. Holst
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
modelpar <- list(nlatent=3, ny1=4, ny2=3, npred=2)
modelpar$model <- "nsem1"
nparreg <- with(modelpar, ny1+ny2 + (ny1-1) + (ny2-1) + 2 + npred)
nparvar <- with(modelpar, ny1+ny2+nlatent)
modelpar$theta <- rep(5,nparreg+nparvar)
npar <- with(modelpar, ny1+ny2 + (ny1-1) + (ny2-1) + npred + 2 + ny1 +
ny2 + nlatent)
aa <- StEM(modelpar$model,modelpar=modelpar,theta0=modelpar$theta,data=yy,cluster=1:NROW(yy),nsim=200,iter=500,plot=FALSE,update=FALSE,stepsize=0.2,idx=15:16,m=5)
plot(aa,idx=15:16)
bb <- lava.nlin::restart(aa,stepsize=0.1,nsim=1000,update=TRUE,m=1)
bb
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.