Learn R Programming

LaMa (version 1.0.0)

stateprobs_g: Calculate conditional local state probabilities for inhomogeneous HMMs

Description

Computes

\(\Pr(S_t = j \mid X_1, ..., X_T)\)

Usage

stateprobs_g(delta, Gamma, allprobs)

Value

Matrix of conditional state probabilities of dimension c(n,N)

Arguments

delta

Initial distribution of length N

Gamma

Array of transition probability matrices of dimension c(N,N,n-1), as in a time series of length n, there are only n-1 transitions.

allprobs

Matrix of state-dependent probabilities/ density values of dimension c(n, N)

Examples

Run this code
Gamma = tpm_g(runif(99), matrix(c(-1,-1,1,-2), nrow = 2, byrow = TRUE))
delta = c(0.5, 0.5)
allprobs = matrix(runif(200), nrow = 100, ncol = 2)

probs = stateprobs_g(delta, Gamma, allprobs)

Run the code above in your browser using DataLab