* current states (beta and the global mean), i.e. a draw from (x_t, x_{t-1} | y_t). FIXME XXX
* The above isn't currently being done
*/
final MultivariateGaussian priorBetaSmoothedDist = getSmoothedPriorDist(particle.getPriorBeta(),
augResponseDist, observation, particle.getPriorPredictiveMean());
final Vector priorBetaSmoothedSample = priorBetaSmoothedDist.sample(random);
final MultivariateGaussian postBetaSmoothedDist = getSmoothedPostDist(particle.getPriorBeta(),
augResponseDist, observation, particle.getPriorPredictiveMean());
final Vector postBetaSmoothedSample = postBetaSmoothedDist.sample(random);
final Vector priorGlobalMeanSample = particle.getPriorBeta().getMean();
final Vector postGlobalMeanSample = particle.getPriorBeta().sample(random);
/*
* Perform the actual Gaussian Bayes update. FIXME This is a very poor implementation.
*/
mvGaussianBayesUpdate(augResponseDist, priorGlobalMeanSample,
updatedBetaMean, observation.getObservedData());
final Vector betaMeanError = postBetaSmoothedSample.minus(priorBetaSmoothedSample);
final ScaledInverseGammaCovDistribution updatedBetaCov = particle.getPriorBetaCov().clone();
updateCovariancePrior(updatedBetaCov, betaMeanError);
final Matrix betaCovSmpl = updatedBetaCov.sample(random);
Preconditions.checkState(betaCovSmpl.getElement(0, 0) >= 0d);
updatedBetaMean.setCovariance(lambdaSamplesMatrix.times(betaCovSmpl
.times(updatedBetaMean.getCovariance())));
/*
* Now, do the above for the the global mean term.
*/
final MultivariateGaussian updatedGlobalMean =
particle.getPriorBeta().times(particle.getAugmentedResponseDistribution());
mvGaussianBayesUpdate(augResponseDist,
observation.getObservedData().times(priorBetaSmoothedSample), updatedGlobalMean,
MatrixFactory.getDenseDefault().createIdentity(
augResponseDist.getInputDimensionality(), augResponseDist.getInputDimensionality()));
final Vector globalMeanError = postGlobalMeanSample.minus(priorGlobalMeanSample);
final ScaledInverseGammaCovDistribution updatedGlobalMeanCov =
particle.getPriorBetaCov().clone();
updateCovariancePrior(updatedGlobalMeanCov, globalMeanError);
final Matrix globalMeanCovSmpl = updatedGlobalMeanCov.sample(random)
.times(updatedGlobalMean.getCovariance());