gabrieag / bayesian-change-detection

Bayesian model-based change detection
3 stars 5 forks source link

Add imputation for response variables #5

Open gabrieag opened 9 years ago

gabrieag commented 9 years ago

Maintain the sample mean and covariance of the response variables inside a private data member called __statistics. Every time the update method is called, possibly with missing values (i.e. numpy.nan) in the response matrix Y, do the following:

  1. Compute the conditional posterior mean and covariance over these missing values via a query to self.__statistics (if there are no missing values, then the mean is Y and the covariance is zero);
  2. Update self.__statistics incrementally using this posterior mean and covariance; and
  3. Inside the update loop, update each hypothesis in self.__hypotheses by passing in the stored basis functions evaluated at X, and posterior mean and covariance over Y.