mk_nbrs_of_pdag_del.m.svn-base
来自「bayesian network structrue learning mat」· SVN-BASE 代码 · 共 65 行
SVN-BASE
65 行
function [PDAGs, nodes] = mk_nbrs_of_pdag_del(cpdag)% MK_NBRS_OF_PDAG_ADD Make the inferior inclusion boundary of CPDAG.% [PDAGs, nodes] = mk_nbrs_of_pdag_del(CPDAG)%% PDAGs{i} is the i'th neighbor of CPDAG0 generated by DELETE(X,Y,H) with% nodes{i,1:2}=[X Y]% nodes{i,3}=H%% See D.M. Chickering 2002 : "Optimal Structure Identification with Greedy Search".%% philippe.leray@insa-rouen.fr% 25 july 2003compteur=0 ;N=length(cpdag);bnet_tmp=mk_bnet(pdag_to_dag(cpdag),2*ones(N,1));engine_tmp=struct(jtree_inf_engine(bnet_tmp));cliques=engine_tmp.cliques;nbcliques=length(cliques);clear bnet_tmp engine_tmp;verbose=0;if verbose fprintf('---- Les cliques (maximales) du DAG\n'); for i=1:nbcliques, disp(cliques{i}); end fprintf('---- Variables \n');end% find in the PDAG all the X Y connected[LX LY]=find(cpdag==1);nlinks=length(LX);for i=1:nlinks X=LX(i); Y=LY(i); % Neighbors of Y NY = myintersect(find(cpdag(:,Y)), find(cpdag(Y,:))); % Adjacents of X AX = myunion(find(cpdag(:,X)), find(cpdag(X,:))); % Neighbors of Y adjacent to X NAYX = myintersect(NY,AX); % this function recursively "walks" (dfs) in the graph representation of NA powerset if verbose X, Y, NY, AX, NAYX fprintf('---- NA Powerset\n\n'); end liste=NAYX; if ~isempty(liste) premier=liste(1); dernier=liste(end); end; current_set=[]; fini=0; evite2 = 0 ; while ~fini if verbose % sert uniquement
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?