dyn_ols: fix bug in correction of fitted values
parent
4bbfb35a6e
commit
01d416da45
|
@ -200,20 +200,22 @@ for i = 1:length(jsonmodel)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
oo_.ols.(tag).Yhat = dseries(X*oo_.ols.(tag).beta, fp, yhatname);
|
oo_.ols.(tag).Yhat = dseries(X*oo_.ols.(tag).beta, fp, yhatname);
|
||||||
|
|
||||||
|
% Residuals
|
||||||
|
oo_.ols.(tag).resid = Y - oo_.ols.(tag).Yhat;
|
||||||
|
|
||||||
|
% Correct Yhat reported back to user
|
||||||
|
for j = 1:lhssub.vobs
|
||||||
|
oo_.ols.(tag).Yhat = oo_.ols.(tag).Yhat + lhssub{j}(fp:lp);
|
||||||
|
end
|
||||||
|
|
||||||
|
% Apply correcting function for Yhat if it was passed
|
||||||
if any(idx) ...
|
if any(idx) ...
|
||||||
&& length(fitted_names_dict(idx, :)) == 3 ...
|
&& length(fitted_names_dict(idx, :)) == 3 ...
|
||||||
&& ~isempty(fitted_names_dict{idx, 3})
|
&& ~isempty(fitted_names_dict{idx, 3})
|
||||||
oo_.ols.(tag).Yhat = ...
|
oo_.ols.(tag).Yhat = ...
|
||||||
feval(fitted_names_dict{idx, 3}, oo_.ols.(tag).Yhat);
|
feval(fitted_names_dict{idx, 3}, oo_.ols.(tag).Yhat);
|
||||||
end
|
end
|
||||||
|
|
||||||
% Residuals
|
|
||||||
oo_.ols.(tag).resid = Y - oo_.ols.(tag).Yhat;
|
|
||||||
|
|
||||||
% Correct Yhat reported back to user for given
|
|
||||||
for j = 1:lhssub.vobs
|
|
||||||
oo_.ols.(tag).Yhat = oo_.ols.(tag).Yhat + lhssub{j}(fp:lp);
|
|
||||||
end
|
|
||||||
ds = [ds oo_.ols.(tag).Yhat];
|
ds = [ds oo_.ols.(tag).Yhat];
|
||||||
|
|
||||||
%% Calculate statistics
|
%% Calculate statistics
|
||||||
|
|
Loading…
Reference in New Issue