请教 贝叶斯网络工具箱使用问题
N=10;dag=zeros(N,N);
X1=1;X2=2;X3=3;X4=4;X5=5;R1=6;R2=7;R3=8;R4=9;S=10;
dag(X1,[R1 R3])=1;
dag(X2,[R2 R4])=1;
dag(X3,[R3 R4])=1;
dag(X4,[R1 R4])=1;
dag(X5,[R2 R3])=1;
dag([R1 R2 R3 R4],S)=1;
discrete_nodes=1:N;
node_sizes=2*ones(1,N);
bnet=mk_bnet(dag, node¬_sizes, ’discrete’, discrete_nodes);
bnet.CPD{X1}=tabuIar¬_CPD(bnet,X1,[0.7 0.3]);
bnet.CPD{X2}=tabuIar¬_CPD(bnet,X2,[0.5 0.5]);
bnet.CPD{X3}=tabular_CPD(bnet,X3,[0.3 0.7]):
bnet.CPD{X4}=tabuIar_CPD(bnet,X4,[0.4 0.6]):
bnet.CPD{X5}=tabular_CPD(bnet,X5,[0.9 0.1]):
bnet.CPD{R1}=tabuIar_CPD(bnet,R1,[1 1 1 0 0 0 0 1]):
bnet.CPD{R2}=tabuIar_CPD(bnet,R2,[1 1 1 0 0 0 0 1]):
bnet.CPD{R3}=tabuIar_CPD(bnet,R3,[1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1]):
bnet.CPD{R4}==tabuIar_CPD(bnet,R4,[1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1]);
bnet.CPD{S}=tabular_CPD(bnet,S,[1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]);
engine=jtree_inf_engine(bnet);
evidence=ceII(1,N);
evidence[S]=2;
evid.T
ans=
程序没法运行 请求帮助!谢谢!