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

📄 franks_init_pot.m

📁 The BNL toolbox is a set of Matlab functions for defining and estimating the parameters of a Bayesi
💻 M
字号:
function [cliquetable, septable,schaal]=franks_init_pot(cliquetable,septable,CPT,parents)
%initialization of cliques , CPT is cell array of conditional probability tables
numb_clqs=length(cliquetable.ind);
a=size(cliquetable.pots{1});
N=a(end);
schaal=0;
for i=1:numb_clqs
    nodes=cliquetable.nod{i};
    cliquetable.pots{i}=ones([ cliquetable.dim{i}]);
    for j=nodes
        set=[parents{j} j];
        %enter_evidence
        %map=parents{nodes(j)} ;%identification number of the nodes to replicate across
        %over=find_equiv_posns(map,set);
        table=CPT{j};
        %table=table.*replicate_pot(likelihood{nodes(j)},over,size(table));
        %absorb cpts into potentials
        map=mysetdiff(cliquetable.ind{i},set);%identification number of the nodes to replicate across
        over=find_equiv_posns(map,cliquetable.ind{i});
        %if ~isempty(over)
        cliquetable.pots{i}=cliquetable.pots{i}.*replicate_pot(table,over,cliquetable.dim{i});
        %end
    end
    %new lines
    [cliquetable.pots{i},sch]=franksnormalize(cliquetable.pots{i},N,1);
        schaal=schaal+sch;
        %%%
end

%put potentials of separators to 1
a= find(~isemptycell(septable.pots));
for i=a'
    septable.pots{i}(:)=1;
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -