Compute most probable path with extended Viterbi algorithm.
Description
Viterbi algorithm for Hidden Markov Model with duration
Usage
1  duration_viterbi(aa_sample, pipar, tpmpar, od, params)

Arguments
aa_sample 

pipar 
probabilities of initial state in Markov Model. 
tpmpar 
matrix of transition probabilities between states. 
od 
matrix of response probabilities. Eg. od[1,2] is a probability of signal 2 in state 1. 
params 
matrix of probability distribution for duration. Eg. params[10,2] is probability of duration of time 10 in state 2. 
Value
A list of length four:
path a vector of most probable path
viterbi values of probability in all intermediate points,
psi matrix that gives for every signal and state the previous state in viterbi path,
duration matrix that gives for every signal and state gives the duration in that state on viterbi path.
Note
All computations are on logarithms of probabilities.