comparison toolboxes/FullBNT-1.0.7/bnt/inference/dynamic/@kalman_inf_engine/private/dbn_to_lds.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function [trans_mat, trans_cov, obs_mat, obs_cov, init_state, init_cov] = dbn_to_lds(bnet)
2 % DBN_TO_LDS Compute the Linear Dynamical System parameters from the Gaussian DBN.
3 % [trans_mat, trans_cov, obs_mat, obs_cov, init_state, init_cov] = dbn_to_lds(bnet)
4
5 onodes = bnet.observed;
6 ss = length(bnet.intra);
7 num_nodes = ss*2;
8 assert(isequal(bnet.cnodes_slice, 1:ss));
9 [W,D,mu] = extract_params_from_gbn(bnet);
10
11 hnodes = mysetdiff(1:ss, onodes);
12 bs = bnet.node_sizes(:); % block sizes
13
14 obs_mat = W(block(hnodes,bs), block(onodes,bs))';
15 u = block(onodes,bs);
16 obs_cov = D(u,u);
17
18 trans_mat = W(block(hnodes,bs), block(hnodes + ss, bs))';
19 u = block(hnodes + ss, bs);
20 trans_cov = D(u,u);
21
22 u = block(hnodes,bs);
23 init_cov = D(u,u);
24 init_state = mu(u);
25
26