multi_LH: Likelihood of the Hidden Markov Model

Description Usage Arguments Details Value

View source: R/multi_HMM_DM.R

Description

This function calculates the log-likelihood of the HMM mode. For this, the scaled forward probabilities are computed. In respect of the LH function, the multi_LH function incorporates the multi Thetas for the indivudal likelihoods.

Usage

1
2
multi_LH(factor, x, m, L1, L2, L3 = NULL, L4 = NULL, L5 = NULL,
  start_index)

Arguments

factor

Input of variables that are unrestricted

x

a sample of a Hidden Markov Model

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

start_index

index parameter to assign the Thetas to their corresponding individual hidden state likelihood.

Details

This function computes the log-likelihood of the forward probabilities of the HMM. Given the fact that the inputed factor vector is not restricted, we need to apply a transformation to transform the factor variables to our suitable canditates Delta, Gamma and Theta. For this we apply the function trans().

The likelihood is constructed using the scaling/normalizing of the forward probabilities such that for each time point the sum of the foward probability is equal to one. The scaling is neccesary to tackle the underflow problem, that arrises with an increasing sample size.

The multi_LH function only differes in the computation of the likelihood probability vector p, because we imput multiple Thetas in the corresponding individual likelihoods.

Value

negative Likelihood


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