rsFilter.update(rsDistribution, obsState);
/*
* Compute and output RS forward errors
*/
ResampleType rsResampleType = rsDistribution.getMaxValueKey().getResampleType();
Vector rsStateProbDiffs = computeStateDiffs(i, hmm.getNumStates(), rsDistribution, forwardResults);
String[] rsLine = {Integer.toString(k), Integer.toString(i), "p(x_t=0|y^t)",
rsResampleType.toString(),
Double.toString(rsStateProbDiffs.getElement(0))};
writer.writeNext(rsLine);
log.info("rsStateProbDiffs=" + rsStateProbDiffs);
if (i > numPreRuns) {
wfFilter.update(wfDistribution, obsState);
RingAccumulator<MutableDouble> pfAtTRate = new RingAccumulator<MutableDouble>();
for (P state : wfDistribution.getDomain()) {
final double err = (x == state.getClassId()) ? wfDistribution.getFraction(state) : 0d;
pfAtTRate.accumulate(new MutableDouble(err));
}
pfRunningRate.accumulate(new MutableDouble(pfAtTRate.getSum()));
ResampleType wfResampleType = wfDistribution.getMaxValueKey().getResampleType();
Vector wfStateProbDiffs = computeStateDiffs(i, hmm.getNumStates(), wfDistribution, forwardResults);
String[] wfLine = {Integer.toString(k), Integer.toString(i), "p(x_t=0|y^t)", "water-filling",
wfResampleType.toString(),
Double.toString(wfStateProbDiffs.getElement(0))};
writer.writeNext(wfLine);
log.info("wfStateProbDiffs=" + wfStateProbDiffs);
}