Merge branch 'enterprise' into 'enterprise'

Add residuals to olsgibbs function output.

See merge request Enterprise/dynare!7
time-shift
Sébastien Villemot 2019-12-02 17:09:31 +00:00
commit 7f9ba036b7
1 changed files with 5 additions and 1 deletions

View File

@ -224,9 +224,13 @@ if ~isempty(fitted_names_dict)
yhatname = fitted_names_dict{idx, 2};
end
end
oo_.olsgibbs.(model_name).Yhat = dseries(X*oo_.olsgibbs.(model_name).posterior.mean.beta, fp, yhatname) + lhssub{1};
oo_.olsgibbs.(model_name).Yhat = dseries(X*oo_.olsgibbs.(model_name).posterior.mean.beta, fp, yhatname);
% Residuals
oo_.olsgibbs.(model_name).resid = Y - oo_.olsgibbs.(model_name).Yhat.data;
% Apply correcting function for Yhat if it was passed
oo_.olsgibbs.(model_name).Yhat = oo_.olsgibbs.(model_name).Yhat + lhssub{1};
if any(idx) ...
&& length(fitted_names_dict(idx, :)) == 3 ...
&& ~isempty(fitted_names_dict{idx, 3})