Viterbi algorithm for Hidden Markov Model with duration
duration_viterbi(aa_sample, pipar, tpmpar, od, params)
character
vector representing single aminoacid sequence.
probabilities of initial state in Markov Model.
matrix of transition probabilities between states.
matrix of response probabilities. Eg. od[1,2] is a probability of signal 2 in state 1.
matrix of probability distribution for duration. Eg. params[10,2] is probability of duration of time 10 in state 2.
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.