⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 define_lin_pred_struct_main.asv

📁 The BNL toolbox is a set of Matlab functions for defining and estimating the parameters of a Bayesi
💻 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 + -