*/
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());
Preconditions.checkState(globalMeanCovSmpl.getElement(0, 0) > 0d);
updatedGlobalMean.setCovariance(globalMeanCovSmpl);
final PolyaGammaLogitDistribution updatedParticle =