multi_HMM_DM: Fitting a Hidden Markov Model via the Direct Maximisation

Description Usage Arguments Details Value

View source: R/multi_HMM_DM.R

Description

Estimation of the transition probabilites, the initial state probabilites and the hidden state parameters of a Hidden Markov Model by using the Direct Maximisation of the global log-likelihood.

Usage

1
multi_HMM_DM(x, theta, m, L1, L2, L3, L4, L5)

Arguments

x

a sample of a Hidden Markov Model

theta

initial parameters for the estimation of the likelihood parameters. See details for more information.

m

the number of states

L1

likelihood of the first hidden state

L2

likelihood of the second hidden state

L3

optional. likelihood of the third hidden state

L4

optional. likelihood of the 4th hidden state

L5

optional. likelihood of the 5th hidden state

Details

This function estimates the Hidden Markov states by maximising the normalized log-likelihood of the forward propabilities. Due to the fact that both the Gamma matrix as well as the Delta vector have some constraints, the function first applies some restrictions and then uses the base-R maximisation to gain the most likely variables.

This function is able to calculate with multiple Theta values for the individual likelihoods. For each likelihood the right number initial starting parameter has to be set in order to compute the estimation of the corresponding Thetas. For each Likelihood the starting values must be in the format of a vector, which is then saved as a list element.

e.g.: theta[[i]] <- c(parameter1, parameter2, ...)

The function then extracts the right number of parameters per likelihood and optimizes the values.

Value

The estimated parameters are rounded by 3 decimals and returned in a list.


pneff93/HMM documentation built on Oct. 26, 2019, 8:16 a.m.