ClickClust_EM {ClickClustCont} | R Documentation |
EM Algorithm for Continuous Time Markov Models
Description
This function fits the continuous time first-order Markov model for a specified set of groups and returns the model chosen by the BIC. This is an implementation of the methodology developed in Gallaugher and McNicholas (2019).
Usage
ClickClust_EM(x, t, J, G, itemEM = 5, starts = 100, maxit = 5000,
tol = 0.001, Contin = TRUE, Verbose = TRUE, seed = 1,
known = NULL, crit = "BIC", returnall = FALSE)
Arguments
x |
A list of states |
t |
A list of times spent in each state |
J |
The total number of states |
G |
A vector containing the number of groups to test |
itemEM |
The number of emEM iterations for initialization (defaults to 5) |
starts |
The number of random starting values for the emEM algorithm (defaults to 100) |
maxit |
The maximum number of iterations after initialization (defaults to 5000) |
tol |
The tolerance for convergence (defaults to 0.001) |
Contin |
Fit the continuous time model (defaults to TRUE). If FALSE, fit the discrete model. |
Verbose |
Display Messages (defaults to TRUE) |
seed |
Sets the seed for the emEM algorithm (defaults to 1) |
known |
A vector of labels for semi-supervised classification. 0 indicates unknown observations. The known labels are denoted by their group number (1,2,3, etc.). |
crit |
The model selection criterion to use ("BIC" or "ICL"). Defaults to "BIC". |
returnall |
If true, returns the results for all groups considered. Defaults to FALSE. |
Value
Returns a list with parameter and classification estimates for the best model chosen by the selection criterion.
References
Michael P.B. Gallaugher and Paul D. McNicholas (2019). Clustering and semi-supervised classification for clickstream data via mixture models. arXiv preprint arXiv:1802.04849v2.
Examples
library(gtools)
data(SimData)
x<-SimData[[1]]
t<-SimData[[2]]
Click_2G<-ClickClust_EM(x=x,t=t,J=5,G=2,starts=10)