def _calc_loglikelihood(self, model=None, tile=None):
if model is None:<EOL><INDENT>res = self.residuals<EOL><DEDENT>else:<EOL><INDENT>res = model - self._data[tile.slicer]<EOL><DEDENT>sig, isig = self.sigma, <NUM_LIT:1.0>/self.sigma<EOL>nlogs = -np.log(np.sqrt(<NUM_LIT:2>*np.pi)*sig)*res.size<EOL>return -<NUM_LIT:0.5>*isig*isig*np.dot(res.flat, res.flat) + nlogs<EOL>
Allows for fast local updates of log-likelihood