createmarkovmodel.m

来自「UMDA. a kind of estimation of distributi」· M 代码 · 共 38 行

M
38
字号
function[Cliques] = CreateMarkovModel(NumbVar,dim)  % Creates the structure of a junction tree where each variable% depends on its dim previous variables % INPUTS% NumbVar: Number of variables% dim: Number of previous variables each variables depends on % OUTPUTS% Cliques: Structure of the model in a list of cliques that defines the (chain shaped)  junction tree. %---Each row of Cliques is a clique. The first value is the number of overlapping variables. %---The second, is the number of new variables.%---Then, overlapping variables are listed and  finally new variables are listed. if(dim==0) for i=1:NumbVar  Cliques(i,1) = 0;  Cliques(i,2) = 1;  Cliques(i,3) = i; endelse  Cliques(1,1) = 0;  Cliques(1,2) = dim;  Cliques(1,3:dim+2) = 1:dim;  for i=dim+1:NumbVar    Cliques(i-dim+1,1) = dim;    Cliques(i-dim+1,2) = 1;    Cliques(i-dim+1,3:dim+2) = [i-dim:i-1];    Cliques(i-dim+1,dim+3) = i;  endend% Last version 9/26/2005. Roberto Santana (rsantana@si.ehu.es) 

⌨️ 快捷键说明

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