bayesnet / bnt

Bayes Net Toolbox for Matlab
465 stars 246 forks source link

BNT example code problem!!! #3

Open ido opened 10 years ago

ido commented 10 years ago

From usmanst...@gmail.com on May 09, 2010 09:31:43

What steps will reproduce the problem? 1. I am trying to run the example which is on this link " http://bnt.googlecode.com/svn/trunk/docs/usage.html " but I got some errors. I attached the file please run it and tell me if I did any mistake.

  1. I want to Marginalize the "S" node w.r.t "R".
  2. And I am getting these errors in MATLAB. I am pasting below: ??? Index exceeds matrix dimensions.

Error in ==> discrete_CPD.convert_to_table at 14 T = CPT(index{:});

Error in ==> discrete_CPD.convert_to_pot at 20 T = convert_to_table(CPD, domain, evidence);

Error in ==> jtree_inf_engine.enter_evidence at 57 pot{n} = convert_to_pot(bnet.CPD{e}, pot_type, fam(:), evidence);

Error in ==> BN_cct1 at 15 [engine, loglik] = enter_evidence(engine, evidence); What is the expected output? What do you see instead? Ans: Expected output should be a value of marginal probability. What version of the product are you using? On what operating system? MATLAB 7.6.0 ( R2008a ) at VISTA HOME PREMIUM. Please provide any additional information below.

Attachment: BN_cct1.m

Original issue: http://code.google.com/p/bnt/issues/detail?id=3

ido commented 10 years ago

From raghaven...@gmail.com on July 25, 2011 15:55:34

You forgot to put

discrete_nodes = 1:N; node_sizes = 2*ones(1,N);