// rediculous hack to get around java bug
for (T particle : distribution.getDomain()) {
final double particleWeight = distribution.getFraction(particle);
Object tmpParticle = particle;
if (tmpParticle instanceof GaussianArTransitionState) {
GaussianArTransitionState gParticle = (GaussianArTransitionState) tmpParticle;
stateMean.accumulate(VectorFactory.getDefault().copyValues(
gParticle.getSuffStat().getMean() * particleWeight));
} else if (tmpParticle instanceof GaussianArHpTransitionState) {
GaussianArHpTransitionState gParticle = (GaussianArHpTransitionState) tmpParticle;
stateMean.accumulate(gParticle.getState().getMean().scale(particleWeight));
}
}
final double rmse = stateMean.getSum().minus(trueState).norm2();
runningRate.accumulate(new MutableDouble(rmse));