reasoning under uncertainty it is more appropriate to plot the distribution of predictions over multiple runs the plot stats method plots the prediction of particular variable (or for the partition functionfor number of runs of the same algorithm on the xaxisis the prediction of the algorithm on the -axis is the number of runs with prediction less than or equal to the value thus this is like cumulative distribution over the predictionsbut with counts on the -axis note that for runs where there are no samples that are consistent with the observations (as can happen with rejection sampling)the prediction of probability is (as convention for / that variable what contains the query variableor what is "prob ev"the probability of evidence probstochsim py -(continued import matplotlib pyplot as plt def plot_stats(methodqvarqvalobsnumber_runs= **queryargs)"""plots cumulative distribution of the prediction of the model method is inferencemethod (that implements appropriate query)plots (qvar=qval obsqvar is the query variableqval is corresponding value obs is the {variable:valuedictionary representing the observations number_iterations is the number of runs that are plotted **queryargs is the arguments to query (often number_samples for sampling methods""plt ion(plt xlabel("value"plt ylabel("cumulative number"method max_display_levelprev_mdl method max_display_level #no display answers [method query(qvar,obs,**queryargsfor in range(number_runs)values [ans[qvalfor ans in answerslabel "{method method_namep({qvar}={qval}|{',join( '{var}={val}for (var,valin obs items())})values sort(plt plot(values,range(number_runs),label=labelplt legend(#loc="upper left"plt draw(method max_display_level prev_mdl restore display level tryplot_stats(bn_reportr,tamper,true,{report:true,smoke:true},number_samples= number_runs= plot_stats(bn_reportl,tamper,true,{report:true,smoke:true},number_samples= number_runs= version june