Learn R Programming

hhsmm (version 0.4.2)

hhsmmspec: hhsmm specification

Description

Specify a model of class "hhsmmspec" using the model parameters

Usage

hhsmmspec(
  init,
  transition,
  parms.emission,
  sojourn = NULL,
  dens.emission,
  remission = NULL,
  mstep = NULL,
  semi = NULL
)

Value

a model of class "hhsmmspec"

Arguments

init

vector of initial probabilities

transition

the transition matrix

parms.emission

the parameters of the emission distribution

sojourn

the sojourn distribution, which is one of the following cases:

  • a list containing d, which is a nobs (number of observations) times nstates (number of states) matrix of probabilities, and type = "nonparametric" for non-parametric sojourn distribution

  • a list containing the parameters mu, shift and size of a shifted negative binomial distribution, for each semi-Markovian state, and type = "nbinom" for negative binomial sojourn distribution

  • a list containing the parameters shape and shift of a shifted logarithmic distribution, for each semi-Markovian state, and type = "logarithmic" for logarithmic sojourn distribution

  • a list containing the parameters lambda and shift of the shifted poisson distribution, for each semi-Markovian state, and type = "poisson" for Poisson sojourn distribution

  • a list containing the parameters shape and scale of the gamma distribution, for each semi-Markovian state, and type = "gamma" for gamma sojourn distribution

  • a list containing the parameters shape and scale of the Weibull distribution, for each semi-Markovian state, and type = "weibull" for Weibull sojourn distribution

  • a list containing the parameters meanlog and sdlog of the log-normal distribution, for each semi-Markovian state, and type = "lnorm" for log-normal sojourn distribution

dens.emission

the probability density function of the emission

remission

the random sample generation from the emission distribution

mstep

the M step function for the EM algorithm

semi

a logical vector of length nstate: the TRUE associated states are considered as semi-markov

Author

Morteza Amini, morteza.amini@ut.ac.ir, Afarin Bayat, aftbayat@gmail.com

Examples

Run this code
init = c(1, 0)
transition = matrix(c(0, 1, 1, 0), 2, 2)
parms.emission = list(mix.p = list(c(0.5, 0.5), 1),
				mu = list(list(c(1, 2), c(5, 1)), c(2, 7)),
              sigma = list(list(diag(2), 2 * diag(2)), 0.5 * diag(2)))
sojourn = list(lambda = 1, shift = 5, type = "poisson")
dens.emission = dmixmvnorm
remission = rmixmvnorm
mstep = mixmvnorm_mstep
semi = rep(TRUE,2)
model = hhsmmspec(init, transition, parms.emission, sojourn, 
dens.emission, remission, mstep, semi)

Run the code above in your browser using DataLab