assertArray( new double[]{0.043, 0.957}, scaleDouble(3, bayesInstance.marginalize("Alarm").getDistribution()) );
}
@Test
public void testEarthquakeAndJohnCallsEvidence() {
BayesInstance bayesInstance = new BayesInstance(jTree);
bayesInstance.setLikelyhood("JohnCalls", new double[]{1.0, 0.0});
bayesInstance.setLikelyhood("Earthquake", new double[]{1.0, 0.0});
bayesInstance.globalUpdate();
assertArray( new double[]{1.0, 0.0}, scaleDouble(3, bayesInstance.marginalize("JohnCalls").getDistribution()) );
assertArray( new double[]{0.618, 0.382 }, scaleDouble( 3, bayesInstance.marginalize("MaryCalls").getDistribution() ) );
assertArray( new double[]{0.003, 0.997}, scaleDouble(3, bayesInstance.marginalize("Burglary").getDistribution()) );
assertArray( new double[]{ 1.0, 0.0}, scaleDouble( 3, bayesInstance.marginalize("Earthquake").getDistribution() ) );
assertArray( new double[]{0.881, 0.119}, scaleDouble(3, bayesInstance.marginalize("Alarm").getDistribution()) );
}