Newer
Older
abgabensammlungSS15 / mr / ub9 / loc_framework / pf_reweight.m
@Jan-Peter Hohloch Jan-Peter Hohloch on 23 Jun 2015 339 bytes MR: Exercise
function [ wnew ] = pf_reweight( x, w, z, Q, measurement )
%PF_CORRECTION Particle Filter correction step

nSamples = size(x, 3);

% Reweighting based on expected and actual measurement:
z_exp = measurement(x);

tmp = num2cell(z_exp,1);
wnew = w.*reshape(cellfun(@(x) mvnpdf(x, z, Q) ,tmp), nSamples, 1, 1);
wnew = wnew / sum(wnew);

end