how to avoid error when Creating the Bayes net shell.
Show older comments
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?
1 Comment
Rasel Biswas
on 20 May 2016
Answers (0)
Categories
Find more on Numerical Integration and Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!