# Probability distribution of alignments

### 1. Miyazawa model and Probalign model

\[

p^{(a)}(\theta|x,x’) = \frac{1}{Z(x,x’,T)} \exp \left(\frac{S(\theta)}{T}\right),

\]

where \(S(\theta)\) is the score of the alignment, and \(Z(x,x’,T)\) is the partition function defined as follows:

\[

Z(x,x’,T) = \sum_{\theta \in A(x,x’)} \exp \left(\frac{S(\theta)}{T}\right),

\]

### 2. Pair hidden Markov model

\[

p^{(a)}(\theta|x,x’) = \pi(s_1) ( \prod_{i=1}^{n-1}\alpha(s_i \rightarrow s_{i+1}) )( \prod_{i=1}^{n}\beta(o_i|d_i) ),

\]

where \(\pi(.)\) is the initial probability of starting state,

\(\alpha(. \rightarrow .)\) is the transition probability,

and \(\beta(.|.)\) is the emission probability.