CategoricalDistribution function ( RandomVariable [ ] arg0 , AssignmentProposition [ ] arg1 , BayesianNetwork arg2 , int arg3 ) { double [ ] loc0 = new double [ ProbUtil . expectedSizeOfCategoricalDistribution ( arg0 ) ] ; for ( int loc1 = 0 ; loc1 < arg3 ; loc1 ++ ) { Pair < Map < RandomVariable , Object > , Double > loc2 = weightedSample ( arg2 , arg1 ) ; loc0 [ ProbUtil . indexOf ( arg0 , loc2 . getFirst ( ) ) ] += loc2 . getSecond ( ) ; } return new ProbabilityTable ( loc0 , arg0 ) . normalize ( ) ; }
the likelihood-weighting algorithm in figure 14.15 . for answering queries given evidence in a bayesian network . concode_field_sep Randomizer randomizer concode_field_sep Pair<Map<RandomVariable,Object>,Double> weightedSample concode_elem_sep CategoricalDistribution ask