set_mhmm: 'S3' Class for Hidden Markov Models with multivariate...

Description Usage Arguments Value References See Also Examples

View source: R/setmHMM.R

Description

This function creates an object of S3 class mhmm, which contains the elements of a Hidden Markov Model with multivariate response whose components can be correlated through a gaussian copula.

Usage

1
2
3
set_mhmm(Obs, bT = NULL, nStates = NULL, nu = rep(1/nStates,
  nStates), A = matrix(1/nStates, nStates, nStates), corr = NULL,
  params = NULL, distr = NULL)

Arguments

Obs

a n x p matrix containing the data.

bT

the vector of the beginning times for the statistical units.

nStates

an integer representing the number of state of the Hidden Markov Model.

nu

a vector of the initial probabilities of the Hidden Markov Model.

A

the transition matrix of the Hidden Markov Model.

corr

an array containing a number of matrix equal to the number of states for the gaussian copula distribution

params

a list containing the state-dependent parameters of the Hidden Markov Model. Each element of the list corresponds to a component of the response vector. Each element of the list is a n x d matrix, where n is the number of states of the HMM while d is the number of parameters of the specified distribution.

distr

a vector containing the name of the distribution for each component, "gaussian" for the normal distribution, "gamma" for the gamma distribution, "exp" for the exponential distribution

Value

The function returns an object of S3 class mhmm, containing the initialization and the data of your HMM

References

Martino A., Guatteri, G. and Paganoni A. M., Multivariate Hidden Markov Models for disease progression, Mox Report 59/2018, 2018

See Also

fitBM_mhmm

Examples

1
2
3
4
5
6
7
8
9
data(copulahmmdata)
Obs <- copulahmmdata
n <- 20 #number of observations per statistical unit
n_tot <- dim(Obs)[1]
bt <- seq(1, n_tot, by = n)
distr <- c("exp", "gaussian")

#Initialize the HMM
hmm <- set_mhmm(Obs, bT = bt, nStates = 2, distr = distr)

hmmhdd documentation built on Sept. 4, 2019, 5:03 p.m.

Related to set_mhmm in hmmhdd...