public void influencedBy(BayesNetNode parent1, BayesNetNode parent2) { influencedBy(parent1); influencedBy(parent2); distribution = new ProbabilityDistribution(parent1.getVariable(), parent2.getVariable()); }
public BayesNetNode(String variable) { this.variable = variable; parents = new List<BayesNetNode>(); children = new List<BayesNetNode>(); distribution = new ProbabilityDistribution(variable); }
public BayesNetNode(String variable) { this.variable = variable; parents = new List <BayesNetNode>(); children = new List <BayesNetNode>(); distribution = new ProbabilityDistribution(variable); }
internal Row(double probability, ProbabilityDistribution probabilityDistribution, params bool [] vals) { this.probabilityDistribution = probabilityDistribution; this.probability = probability; values = new bool[vals.Length]; System.Array.Copy(vals, 0, values, 0, vals.Length); }
public static double[] ask(Query q, ProbabilityDistribution pd) { double[] probDist = new double[2]; Dictionary<String, bool> h = q.getEvidenceVariables(); // true probability h[q.getQueryVariable()] = true; probDist[0] = pd.probabilityOf(h); // false probability h[q.getQueryVariable()] = false; probDist[1] = pd.probabilityOf(h); return Util.normalize(probDist); }
public void influencedBy(BayesNetNode parent1) { addParent(parent1); parent1.addChild(this); distribution = new ProbabilityDistribution(parent1.getVariable()); }