Skip to content

Commit

Permalink
The inverse of Q is now calculated via its Cholesky decomposition. Sh…
Browse files Browse the repository at this point in the history
…ould be a bit more stable, but unlikely that all numerical issues will go away with this fix. Closes #1
  • Loading branch information
Jose Gomez-Dans committed Oct 25, 2015
1 parent 5672139 commit 7c375d0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions gp_emulator/GaussianProcess.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@ def _prepare_likelihood ( self ):
self.Q = self.Z +\
exp_theta[self.D+1]*np.eye ( self.n )
L = np.linalg.cholesky ( self.Q )
self.invQt = np.dot ( np.linalg.inv(L).dot( np.linalg.inv(L).T) )
self.invQ = np.linalg.inv(L.T).dot( np.linalg.inv(L) )
#self.invQ = np.linalg.inv ( self.Q )
self.invQt = np.dot ( self.invQ, self.targets )

self.logdetQ = 2.0 * np.sum ( np.log ( np.diag ( \
np.linalg.cholesky ( self.Q ))))
self.logdetQ = 2.0 * np.sum ( np.log ( np.diag ( L )))


def loglikelihood ( self, theta ):
Expand Down

0 comments on commit 7c375d0

Please sign in to comment.