Description Usage Arguments Details Functions
View source: R/forward_probabilities.R
Calculate matrices of forward and backward (log-)probabilities for a given data set and parameters in a hidden Markov model. Essentially just a wrapper for the true function written in C++. Useful for avoiding underflow (by using the log-exp-sum-trick) when the HMM is large. Not expected to be called by the user, instead only being used during the EM-algorithm.
1 2 3 4 5 6 7 | backward_logprobabilities(x, Gamma, p)
backward_probabilities(x, Gamma, p)
forward_logprobabilities(x, Gamma, p, delta)
forward_probabilities(x, Gamma, p, delta)
|
x |
Vector of observed emissions |
Gamma |
Matrix (m x m) of transition probabilities of the underlying Markov chain |
p |
A function where p(i, x)=P(X_t=x | Y_t=i) |
Let (X, Y)_i, i=1,...,n constitute a HMM, that is, Y_1,...,Y_n is a Markov chain with states 1,...,m and the X_i's are dependent only through the Y_i's with common conditional distributions X_i | Y_i=j = P_j for all i=1,...,n. This function then generates a matrix where the i,j'th entry is log P(X_j+1=x_j+1, ..., X_n=x_n | Y_j=i), where x_1,...,x_n are the observed values (emissions) of X.
backward_logprobabilities
: Matrix of backwards log-probabilities
backward_probabilities
: Matrix of backward probabilities
forward_logprobabilities
: Matrix of forward log-probabilities
forward_probabilities
: Matrix of forward probabilities
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.