CS5340 Lab3 report

Name: HUANG Liu
Email: e0575772@u.nus.edu
Student ID: A0225138J

e_step(x_list, pi, A, phi)

Initialize arrays alpha and c with zeros. For each sequence($x_list[o]$) in $x_list$: $alpha[o][0][k] = pi[k] p(x_list[o][0] | phi[k])$, where $k$ is the state of the latent variable and $p$ iis defined as the value of x in the Gaussian probability density function with $phi[k]$ as the parameter: $p = scipy.stats.norm.pdf(x_list[o][0], phi[“mu”][k], phi[“sigma”][k])$
$p(x_list[o][n] | phi[k])
\sum_i alpha[o][n - 1][i] A[i][k]$
xi_list[o][n - 1][k][i] = (1 / c[o][n])
alpha[o][n - 1][k] p A[k][i] * beta[o][n][i]

m_step(x_list, gamma_list, xi_list)

fit_hmm(x_list, n_states)