how to avoid error when Creating the Bayes net shell.

% Please the below program and if needed see, http://bayesnet.github.io/bnt/docs/usage.html#basics
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 个评论

node_sizes = [ 3 2 2 2]; %%meaning that Cloudy has 3 possible values, Sprinkler has 2 possible values,etc.

请先登录,再进行评论。

回答(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!

Translated by