Commit 294dbdc5 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Fixed bug in the evaluation of the likelihood.

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