Description Usage Arguments Value See Also Examples
Calculates the backward probabilities.
The main purpose of this function is to be combined with forward function
to calculate smooth states and smooth consecutive pairwise states. This is done
by functions sstates
and scpstates
.
1 2 3 4 |
x |
A HMM model. |
y |
A vector with the observed events. It admits missing values. |
sfactors |
A vector with the scale factors from the forward algorithm. |
A matrix that contains the (rescaled) backward probabilities.
forward, sstates, scpstates
1 2 3 4 5 6 7 | model <- HMMrectangle(3,3)
emissions(model) <- Matrix(c(1, 1, 0.5, 1, 0.5, 0, 0.5, 0, 0,
0, 0, 0.5, 0, 0.5, 1, 0.5, 1, 1),
ncol = 2, sparse = TRUE)
model <- initparams(model)
fpass <- forward(model, c(1,2,1))
backward(model, c(1,2,1), fpass$scalefactors)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.