?? define_lin_pred_struct_main.asv
字號:
function lin_pred_struct=define_lin_pred_struct_main(equiv_class,parents)
%defines structure of the linear predictor for the CPTs when only main
%effects of parents are incorporated for each node
%e.g. for two parents
%0 refers to effects already included in pred_mat (main effects are included if not explicitly specified otherwise)
%pred_mat is given by user, or is identity matrix
%1,... refer to parents (ordered)
%lin_pred={1, 2}: linear predictor of the prob contains main effects of
%parents, in addition to main effects of pred_mat
%lin_pred={[0 2],1 }: main effects of first parent,
%variables in pred_mat have different effect for different values of second parent
%lin_pred={[0 1], [0 2]}:
%variables in pred_mat have different effect for different values of first parent
%variables in pred_mat have different effect for different values of second parent
%lin_pred={[1 2]} :interaction effects of
%parents, in addition to main effects of pred_mat
%lin_pred={[0 1 2]}, free cond probs THIS IS THE DEFAULT
%!! if 0 appears in an effect, it should be the first element !!
%structure of the linear predictor :
%first all f0 vectors that contain 0, then all f0 vectors that contain no
%within f0 and f1:
%ordering according to order of nodenr:
%last cell element
%corresponds to highest nodenumber (children). for interactions: lowest nodenr of
%interactions counts
lin_pred_struct=cell(max(equiv_class),1);
for i=1:length(lin_pred_struct)
a=cell(1,1+length(parents(i)));
for k=0:length(parents(i))
a(k+1)={k};
end
lin_pred_struct(i)={a};
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -