# Estimate the Parameters of an HMM solved by 92

Sept. 16, 2015, 3 a.m. by Rosalind Team

Topics: HMM

## HMM Parameter Estimation Problem

Given: A sequence of emitted symbols x = x1 . . . xn in an alphabet ∑ and a path π = π1 . . . πn generated by a k-state HMM with unknown transition and emission probabilities.

Return: A matrix of transition probabilities Transition and a matrix of emission probabilities Emission that maximize Pr(x,π) over all possible matrices of transition and emission probabilities.

## Sample Dataset

yzzzyxzxxx
--------
x   y   z
--------
BBABABABAB
--------
A   B   C


## Sample Output

A   B   C
A   0.0 1.0 0.0
B   0.8 0.2 0.0
C   0.333   0.333   0.333
--------
x   y   z
A   0.25    0.25    0.5
B   0.5 0.167   0.333
C   0.333   0.333   0.333