Guest User

Untitled

a guest
Feb 18th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. def N(o_t, mu_j, sigma_j):
  2.     p = len(o_t)
  3.     o_t = matrix(o_t).T # px1 vector
  4.     mu_j = matrix(mu_j).T # px1 vector
  5.     sigma_j = matrix(sigma_j) # pxp matrix
  6.     det = linalg.det(sigma_j)
  7.     normalizer = 1.0 / (pow(2*pi,p/2)*sqrt(det))
  8.     a = o_t - mu_j
  9.     d = normalizer * exp(-0.5 * a.T * sigma_j.I * a)
  10.     return d
Add Comment
Please, Sign In to add comment