Skip to content

Commit

Permalink
use choleksy decomposition to calculate inverse, might be more stable…
Browse files Browse the repository at this point in the history
… for some cases there Q matrix is not symmetric
  • Loading branch information
Jose Gomez-Dans committed Oct 23, 2015
1 parent 1b9cb80 commit 5672139
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gp_emulator/GaussianProcess.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ def _prepare_likelihood ( self ):
self.Z = exp_theta[self.D]*np.exp ( -0.5*self.Z)
self.Q = self.Z +\
exp_theta[self.D+1]*np.eye ( self.n )
self.invQ = np.linalg.inv ( self.Q )
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 ( self.Q )
self.invQt = np.dot ( self.invQ, self.targets )

self.logdetQ = 2.0 * np.sum ( np.log ( np.diag ( \
Expand Down

0 comments on commit 5672139

Please sign in to comment.