sur: update M_.Sigma_e using estimated parameters

time-shift
Houtan Bastani 2019-02-12 19:57:39 +01:00
parent a110896483
commit 98591af846
No known key found for this signature in database
GPG Key ID: 000094FB955BE169
1 changed files with 4 additions and 0 deletions

View File

@ -137,6 +137,10 @@ kLeye = kron(chol(inv(M_.Sigma_e)), eye(oo_.sur.(model_name).dof));
[q, r] = qr(kLeye*X.data, 0);
oo_.sur.(model_name).beta = r\(q'*kLeye*Y.data);
resid = Y.data - X.data * oo_.sur.(model_name).beta;
resid = reshape(resid, oo_.sur.(model_name).dof, neqs);
M_.Sigma_e = resid'*resid/oo_.sur.(model_name).dof;
M_.params(opidxs) = oo_.sur.(model_name).beta;
% Yhat