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

Added test on the reciprocical condition number of PredictedObservedVariance.

parent fbec03fe
......@@ -148,7 +148,12 @@ for t=1:sample_size
PredictionError = bsxfun(@minus,Y(:,t),tmp(mf1,:));
dPredictedObservedMean = bsxfun(@minus,tmp(mf1,:),PredictedObservedMean);
PredictedObservedVariance = bsxfun(@times,dPredictedObservedMean,weights)*dPredictedObservedMean' + H;
lnw = -.5*(const_lik+log(det(PredictedObservedVariance))+sum(PredictionError.*(PredictedObservedVariance\PredictionError),1));
if rcond(PredictedObservedVariance) > 1e-16
lnw = -.5*(const_lik+log(det(PredictedObservedVariance))+sum(PredictionError.*(PredictedObservedVariance\PredictionError),1));
else
LIK = NaN;
return
end
dfac = max(lnw);
wtilde = weights.*exp(lnw-dfac);
lik(t) = log(sum(wtilde))+dfac;
......
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