Description Usage Arguments Details Examples
This function estimates parameters of the latent class model using the maximum likelihood method.
As a subroutine it uses constrOptim()
.
1 |
counts |
The array of counts of format |
k |
The number of latent classes fitted |
tries |
The number of times the algorithm reruns from different random starting points. The default value is tries=3 |
theta |
The vector of parameters from which the algorithm starts. If not specified, the algorithm starts from a random point. |
tol |
The convergence criterion for the EM algorithm. The maximal decrease of the log-likelihood function that will terminate the algorithm. |
mode |
The algorithm used to compute the MLE. Write |
This function works as an alternative to LC.EM()
that uses the EM algorithm.
1 2 3 4 5 6 7 8 9 | theta0 <- list()
theta0[[1]] <- matrix(c(0.9,0.2,0.1,0.8),2,2)
theta0[[2]] <- matrix(c(0.7,0.2,0.3,0.8),2,2)
theta0[[3]] <- matrix(c(0.9,0.1,0.1,0.9),2,2)
theta0[[4]] <- matrix(c(0.7,0.1,0.3,0.9),2,2)
theta0[[5]] <- matrix(c(0.7,0.1,0.3,0.9),2,2)
theta0[[6]] <- c(0.3,0.7)
data <- sample.counts(500,theta0)
LC.MLE(data,2,tries=3,tol=1e-8,margin.size=3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.