📄 test_ho_inf_enginge.m
字号:
function [engine,engine2] = test_ho_inf_enginge(order,T)assert(order >= 1)% Model a SISO system, i. e. all node are one-dimensional% The nodes are numbered as follows% u(t) = 1 input% y(t) = 2 model output% z(t) = 3 noise% q(t) = 4 observed output = noise + model outputns = [1 1 1 1];% Model a linear system, i.e. there are no discrete nodesdn = [];% Modeling of connections within a time sliceintra = zeros(4);intra(2,4) = 1; % Connection y(t) -> q(t)intra(3,4) = 1; % Connection z(t) -> q(t)% Connections to the next time sliceinter = zeros(4,4,order);inter(1,2,1) = 1; % u(t) -> y(t+1);inter(2,2,1) = 1; %y(t) -> y(t+1);inter(3,3,1) = 1; %z(t) -> z(t+1);if order >= 2 inter(1,2,2) = 1; % u(t) -> y(t+2); inter(2,2,2) = 1; % y(t) -> y(t+2);endfor i = 3: order inter(:,:,i) = inter(:,:,i-1); %u(t) -> y(t+i) y(t) -> y(t) +iend;% Compution of a higer order Markov Modelbnet = mk_higher_order_dbn(intra,inter,ns,'discrete',dn);bnet2 = mk_dbn(intra,inter(:,:,1),ns,'discrete',dn)%Calculation of the number of nodes with different parameters%There is one input and one output nodes 2%There are two different disturbance node 2%There are order +1 nodes for y 1 + ordernumOfNodes = 5 + order; % First input nodebnet.CPD{1} = gaussian_CPD(bnet,1,'mean',0);bnet2.CPD{1} = gaussian_CPD(bnet,1,'mean',0);% Modeled outputbnet.CPD{2} = gaussian_CPD(bnet,2,'mean',0);bnet2.CPD{2} = gaussian_CPD(bnet,2,'mean',0);%Disturbancebnet.CPD{3} = gaussian_CPD(bnet,3,'mean',0);bnet2.CPD{3} = gaussian_CPD(bnet,3,'mean',0);%Qutputbnet.CPD{4} = gaussian_CPD(bnet,4,'mean',0);bnet2.CPD{4} = gaussian_CPD(bnet,4,'mean',0);%Output node in the second time-slice%Remember that node number 6 is an example for %the fifth equivalence classbnet.CPD{5} = gaussian_CPD(bnet,6,'mean',0);bnet2.CPD{5} = gaussian_CPD(bnet,6,'mean',0);%Disturbance node in the second time slicebnet.CPD{6} = gaussian_CPD(bnet,7,'mean',0);bnet2.CPD{6} = gaussian_CPD(bnet,7,'mean',0);% Modeling of the remaining nodes for yfor i = 7:numOfNodes bnet.CPD{i} = gaussian_CPD(bnet,(i - 6)*4 + 7,'mean',0);end% Generation of the inference engineengine = dv_unrolled_dbn_inf_engine(bnet,T);engine2 = jtree_unrolled_dbn_inf_engine(bnet,T);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -