mhmm: Mixture model of Hidden Markov Models.

Description Usage Arguments Value References Examples

View source: R/MHMM.R

Description

This function performs maximum likelihood inference of mixture of hidden Markov models

Usage

1
2
mhmm(y, K, M, smartinit = TRUE, nbinit = 100, tol = 10^(-4),
  nbKeep = min(20, nbinit), iterSmall = 10, nbcores = 1)

Arguments

y

list. Observations (one element of the list per subject, missing values should be encoded by NA).

K

numeric. Number of mixture components.

M

numeric. Number of states.

smartinit

boolean. If TRUE, MLE of the mixture neglecting the time dependency is used for the initialization of the algorithm.

nbinit

numeric.Number of initializations.

tol

numeric. It indicates the maximal gap between two successive iterations of EM algorithm which stops the algorithm

nbKeep

numeric. It indicates the number of chains used for the final EM algorithm

iterSmall

numeric. It indicates the number of iterations for each SmallEM algorithm

nbcores

numeric. It defines the numerber of cores used by the algorithme

Value

Returns an instance of mhmmresults.

References

Du Roy de Chaumaray, M. and Marbac, M. and Navarro, F. (2019). Mixture of hidden Markov models for accelerometer data. arXiv preprint arXiv:1906.01547

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(accelero)
# To make the estimation <5
res <- mhmm(accelero, K = 2, M = 4, nbcores = 1, nbinit = 5, iterSmall = 2)
plot(res, 1)

 
data(accelero)
# It is better to increase the number of random initializations
res <- mhmm(accelero, K = 2, M = 4, nbcores = 1)
plot(res, 1)

MHMM documentation built on March 26, 2020, 7:46 p.m.