@Test public void test() throws Exception { ModifiyingBayesianNetworks.main(null); }
public static void main (String[] args){ BayesianNetworkGenerator.setNumberOfGaussianVars(1); BayesianNetworkGenerator.setNumberOfMultinomialVars(1,2); BayesianNetworkGenerator.setNumberOfLinks(1); BayesianNetwork bn = BayesianNetworkGenerator.generateBayesianNetwork(); System.out.println(bn.toString()); Variable multiVar = bn.getVariables().getVariableByName("DiscreteVar0"); Multinomial multinomial = bn.getConditionalDistribution(multiVar); multinomial.setProbabilities(new double[]{0.2, 0.8}); Variable normalVar = bn.getVariables().getVariableByName("GaussianVar0"); Normal_MultinomialParents normalMultiDist = bn.getConditionalDistribution(normalVar); normalMultiDist.getNormal(0).setMean(1.0); normalMultiDist.getNormal(0).setVariance(1.0); normalMultiDist.getNormal(1).setMean(0.0); normalMultiDist.getNormal(1).setVariance(1.0); System.out.println(bn.toString()); }
ModifiyingBayesianNetworks { public static void main (String[] args){ BayesianNetworkGenerator.setNumberOfGaussianVars(1); BayesianNetworkGenerator.setNumberOfMultinomialVars(1,2); BayesianNetworkGenerator.setNumberOfLinks(1); BayesianNetwork bn = BayesianNetworkGenerator.generateBayesianNetwork(); System.out.println(bn.toString()); Variable multiVar = bn.getVariables().getVariableByName("DiscreteVar0"); Multinomial multinomial = bn.getConditionalDistribution(multiVar); multinomial.setProbabilities(new double[]{0.2, 0.8}); Variable normalVar = bn.getVariables().getVariableByName("GaussianVar0"); Normal_MultinomialParents normalMultiDist = bn.getConditionalDistribution(normalVar); normalMultiDist.getNormal(0).setMean(1.0); normalMultiDist.getNormal(0).setVariance(1.0); normalMultiDist.getNormal(1).setMean(0.0); normalMultiDist.getNormal(1).setVariance(1.0); System.out.println(bn.toString()); } }
ModifiyingBayesianNetworks { public static void main (String[] args){ BayesianNetworkGenerator.setNumberOfGaussianVars(1); BayesianNetworkGenerator.setNumberOfMultinomialVars(1,2); BayesianNetworkGenerator.setNumberOfLinks(1); BayesianNetwork bn = BayesianNetworkGenerator.generateBayesianNetwork(); System.out.println(bn.toString()); Variable multiVar = bn.getVariables().getVariableByName("DiscreteVar0"); Multinomial multinomial = bn.getConditionalDistribution(multiVar); multinomial.setProbabilities(new double[]{0.2, 0.8}); Variable normalVar = bn.getVariables().getVariableByName("GaussianVar0"); Normal_MultinomialParents normalMultiDist = bn.getConditionalDistribution(normalVar); normalMultiDist.getNormal(0).setMean(1.0); normalMultiDist.getNormal(0).setVariance(1.0); normalMultiDist.getNormal(1).setMean(0.0); normalMultiDist.getNormal(1).setVariance(1.0); System.out.println(bn.toString()); }  }
ModifiyingBayesianNetworks { public static void main (String[] args){ BayesianNetworkGenerator.setNumberOfGaussianVars(1); BayesianNetworkGenerator.setNumberOfMultinomialVars(1,2); BayesianNetworkGenerator.setNumberOfLinks(1); BayesianNetwork bn = BayesianNetworkGenerator.generateBayesianNetwork(); System.out.println(bn.toString()); Variable multiVar = bn.getVariables().getVariableByName("DiscreteVar0"); Multinomial multinomial = bn.getConditionalDistribution(multiVar); multinomial.setProbabilities(new double[]{0.2, 0.8}); Variable normalVar = bn.getVariables().getVariableByName("GaussianVar0"); Normal_MultinomialParents normalMultiDist = bn.getConditionalDistribution(normalVar); normalMultiDist.getNormal(0).setMean(1.0); normalMultiDist.getNormal(0).setVariance(1.0); normalMultiDist.getNormal(1).setMean(0.0); normalMultiDist.getNormal(1).setVariance(1.0); System.out.println(bn.toString()); }  static void main(String[] args); }
ModifiyingBayesianNetworks { public static void main (String[] args){ BayesianNetworkGenerator.setNumberOfGaussianVars(1); BayesianNetworkGenerator.setNumberOfMultinomialVars(1,2); BayesianNetworkGenerator.setNumberOfLinks(1); BayesianNetwork bn = BayesianNetworkGenerator.generateBayesianNetwork(); System.out.println(bn.toString()); Variable multiVar = bn.getVariables().getVariableByName("DiscreteVar0"); Multinomial multinomial = bn.getConditionalDistribution(multiVar); multinomial.setProbabilities(new double[]{0.2, 0.8}); Variable normalVar = bn.getVariables().getVariableByName("GaussianVar0"); Normal_MultinomialParents normalMultiDist = bn.getConditionalDistribution(normalVar); normalMultiDist.getNormal(0).setMean(1.0); normalMultiDist.getNormal(0).setVariance(1.0); normalMultiDist.getNormal(1).setMean(0.0); normalMultiDist.getNormal(1).setVariance(1.0); System.out.println(bn.toString()); }  static void main(String[] args);  }