This commit is contained in:
mu 2014-02-17 09:18:35 +00:00
parent f956590fdd
commit 55a9c5a423

View file

@ -463,10 +463,10 @@ class StateSpace_1(Model):
v = Y[:,k][None].T-H.dot(m)
S = H.dot(P).dot(H.T) + R*np.eye(Y.shape[0])
#Should be LL, isupper = ...
LL = linalg.cho_factor(S)
K = linalg.cho_solve(LL, H.dot(P)).T
# LL, isupper = linalg.cho_factor(H.dot(P).dot(H.T) + R*np.eye(Y.shape[1]))
# K = linalg.cho_solve((LL, isupper), H.dot(P)).T
#LL = linalg.cho_factor(S)
#K = linalg.cho_solve(LL, H.dot(P)).T
LL, isupper = linalg.cho_factor(H.dot(P).dot(H.T) + R*np.eye(Y.shape[1]))
K = linalg.cho_solve((LL, isupper), H.dot(P)).T
lik -= np.sum(np.log(np.diag(LL)))
lik -= 0.5*v.shape[0]*np.log(2*np.pi)
lik -= 0.5*linalg.cho_solve((LL, isupper),v).T.dot(v)[0,0]