mvnHMM2: Multivariate Normal Hidden Markov Model

View source: R/MVNSeq.r

mvnHMM2R Documentation

Multivariate Normal Hidden Markov Model

Description

Fit multivariate Normal 2 State Hidden Markov models by EM.

Usage

mvnHMM2(
  y,
  cl,
  formula1,
  formula2,
  data,
  min.iters = 10,
  max.iters = 50,
  tol = 0.001,
  verbose = interactive()
)

gmvnHMM2(
  y,
  cl,
  gr,
  formula1,
  formula2,
  data,
  min.iters = 10,
  max.iters = 50,
  tol = 0.001,
  verbose = interactive()
)

grmvnHMM2(
  y,
  cl,
  gr,
  formula1,
  formula2,
  data,
  min.iters = 10,
  max.iters = 100,
  tol = 0.001,
  verbose = interactive()
)

Arguments

y

the sequence of observations

cl

an integer vector allocating observations to classes

formula1

formula for the logistic model relating the transition from state 1 to state 2 to the covariates

formula2

formula for the logistic model relating the transition from state 2 to state 1 to the covariates

data

a dataframe of covariates

min.iters

minimum number of EM iterations

max.iters

maximum number of EM iterations

tol

tolerance for the log likelihood

verbose

should the log likelihood be reported.

gr

an integer vector allocating observations to groups

Details

These functions fit multivariate Normal 2 state hidden Markov models to sequences of observations, where the transition probabilities are governed by logistic regression. mvnHMM2 fits a hidden Markov model to a single sequence of observations. gmvnHMM2 and grmvnHMM2 fit separate Markov models to several groups (sequences) of observations. gmvnHMM2 fits a hidden Markov model to each group so that each state has a different mean across groups, but a common covariance. grmvnHMM2 constrains the means of the states to be Normally distributed across groups.

Value

the fitted model


SWotherspoon/MVNSeq documentation built on June 1, 2022, 10:49 p.m.