Commit 5b5e88b5 authored by Frédéric Karamé's avatar Frédéric Karamé

Modify the inputs of gaussian_density.

parent 93039cd9
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
%
......
......@@ -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) ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment