-
Notifications
You must be signed in to change notification settings - Fork 6
/
getGSdata.m
executable file
·30 lines (26 loc) · 1.01 KB
/
getGSdata.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function [omu,osig,oll] = getGSdata(iweig,imu,isig,pf_samples,pf_w)
%
% Get the estimates for one particular Gaussian Sum
%
% omu - estimate the mean
% osig - estimate the covariance
% oll - log-likelihood of the particles
%
% Gabriel Terejanu ([email protected])
%% ------------------------------------------------------------------------
% omu - compute the mean of the Gaussian Sum
% osig - compute the covariance of the Gaussian Sum
%--------------------------------------------------------------------------
[omu,osig] = merge(iweig,imu,isig);
%% ------------------------------------------------------------------------
% oll - compute log-likelihood of the particles
%--------------------------------------------------------------------------
no_particles = length(pf_w);
% resampling
I = myresampling(pf_w);
I = round(I);
tmp_X_pf = zeros(size(pf_samples));
for j = 1 : no_particles
tmp_X_pf(:,j) = pf_samples(:,I(j));
end;
oll = getLoglikelihood(tmp_X_pf, imu, isig, iweig);