gmm_conditional.m

来自「高斯滤波器 matlab toolbox For GMMs and Gauss」· M 代码 · 共 26 行

M
26
字号
function [g, c] = gmm_conditional(g, x, idx)
% ALPHA VERSION
% Deriving the conditional, given the joint, is found by considering a
% perfect observation (ie, constraint) at x.
%
% In order to consider p(gmm|x) as a function of x, not just at x=x0,
% this function returns c, the original cross-correlations of g.
%
% see also: Bar p123

% TODO: A better way is to work this out longhand, and calculate directly, 
% but for now its easier to set it up as an observation.
D = size(g.x, 1);
Dc = size(x, 1);

H = zeros(Dc, D);
i = index_table(H, [1:Dc; idx]);
H(i) = 1;

gz.w = 1;
gz.x = x;
gz.P = zeros([Dc, Dc, 1]);

g = gmm_update(g, gz, H);
g = gmm_marginal(g, setdiff(1:D, idx));

⌨️ 快捷键说明

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