Fixed bug in the evaluation of the likelihood.

time-shift
Stéphane Adjemian (Charybdis) 2012-03-30 11:21:24 +02:00
parent 9cc4661942
commit 294dbdc52c
1 changed files with 1 additions and 1 deletions

View File

@ -128,7 +128,7 @@ for t=1:sample_size
lnw = -.5*(const_lik+log(det(PredictedObservedVariance))+sum(PredictionError.*(PredictedObservedVariance\PredictionError),1));
dfac = max(lnw);
wtilde = weights.*exp(lnw-dfac);
lik(t) = log(mean(wtilde))+dfac;
lik(t) = log(sum(wtilde))+dfac;
weights = wtilde/sum(wtilde);
% sum(weights>max(weights)*1e-6)
Neff = 1/(weights*weights');