filterpy
filterpy copied to clipboard
How to get (log)likelihood of the measurement after update step?
Hi Roger, Just have a confusion between line 1180 and line 1132 in kalman_filter.py
def log_likelihood_of(self, z):
"""
log likelihood of the measurement `z`. This should only be called
after a call to update(). Calling after predict() will yield an
incorrect result."""
if z is None:
return log(sys.float_info.min)
return logpdf(z, dot(self.H, self.x), self.S)
@property
def log_likelihood(self):
"""
log-likelihood of the last measurement.
"""
if self._log_likelihood is None:
self._log_likelihood = logpdf(x=self.y, cov=self.S)
return self._log_likelihood
What do you mean by "log_likelihood of the last measurement" in log_likelihood function? Shouldn't only log_likelihood_of be used to calculate the multivariate normal pdf of measurement z_k at time k? What is the difference between them? Appreciate your clarification.