def lnlike(self, pardict, use_cache=True):
mag, dmag = self.value<EOL>if np.isnan(dmag):<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>if self.relative:<EOL><INDENT>if self.reference is None:<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>mod = (self.model_mag(pardict, use_cache=use_cache) -<EOL>self.reference.model_mag(pardict, use_cache=use_cache))<EOL>mag -= self.reference.value[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>mod = self.model_mag(pardict, use_cache=use_cache)<EOL><DEDENT>lnl = -<NUM_LIT:0.5>*(mag - mod)**<NUM_LIT:2> / dmag**<NUM_LIT:2><EOL>return lnl<EOL>
returns log-likelihood of this observation

pardict is a dictionary of parameters for all leaves
gets converted back to traditional parameter vector