how to avoid error when Creating the Bayes net shell.
显示 更早的评论
N = 4;
dag = zeros( N, N );
C = 1; S = 2; R = 3; W = 4;
dag( C, [R S] ) = 1;
dag( R, W ) = 1;
dag( S, W ) = 1;
discrete_nodes = 1:N; node_sizes = [ 4 2 3 5]; % meaning that Cloudy has 4 possible values, Sprinkler has 2 possible values,etc.
onodes = []; bNet = mk_bnet( dag, node_sizes, 'discrete', discrete_nodes, 'observed', onodes );
bNet.CPD{C} = tabular_CPD( bNet, C, 'CPT', [0.5 0.4 0.1] ); % I understand the problem of assigning CPD of the node in the tabular_CPD function. Please do not tell me to write node_sizes = 2*ones(1,N); (this is for two state probability, means True and False) instead of node_sizes = [ 4 2 3 5]; because I need the three state probability, like, low, medium and high. What should I do in this regard?
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!