Modify the inputs of gaussian_density.

rm-particles^2
Frédéric Karamé 2015-10-06 17:21:02 +02:00
parent 93039cd92e
commit 5b5e88b50d
2 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
function IncrementalWeights = gaussian_densities(obs,mut_t,sqr_Pss_t_t,st_t_1,sqr_Pss_t_t_1,particles,H,normconst,weigths1,weigths2,ReducedForm,ThreadsOptions)
function IncrementalWeights = gaussian_densities(obs,mut_t,sqr_Pss_t_t,st_t_1,sqr_Pss_t_t_1,particles,H,normconst,ReducedForm,ThreadsOptions)
%
% Elements to calculate the importance sampling ratio
%

View File

@ -115,7 +115,7 @@ for t=1:sample_size
gaussian_densities(Y(:,t),StateVectorMean,...
StateVectorVarianceSquareRoot,PredictedStateMean,...
PredictedStateVarianceSquareRoot,StateParticles,H,const_lik,...
weights2,weights_c2,ReducedForm,ThreadsOptions) ;
ReducedForm,ThreadsOptions) ;
SampleWeights = weights2.*IncrementalWeights ;
else
StateParticles = bsxfun(@plus,StateVectorVarianceSquareRoot*randn(state_variance_rank,number_of_particles),StateVectorMean) ;
@ -123,7 +123,7 @@ for t=1:sample_size
gaussian_densities(Y(:,t),StateVectorMean,...
StateVectorVarianceSquareRoot,PredictedStateMean,...
PredictedStateVarianceSquareRoot,StateParticles,H,const_lik,...
1/number_of_particles,1/number_of_particles,ReducedForm,ThreadsOptions) ;
ReducedForm,ThreadsOptions) ;
SampleWeights = IncrementalWeights/number_of_particles ;
end
SampleWeights = SampleWeights + 1e-6*ones(size(SampleWeights,1),1) ;