Thanks Johannes. I have pushed your commits to master
All the best,
Michel
On 05/14/2012 07:07 PM, Johannes Pfeifer wrote:
Actually, the correct solution is
ifoptions_.prefilter == 1
ifoptions_.missing_data
data=rawdata;
bayestopt_.mean_varobs = zeros(n_varobs,1);
forvariable=1:n_varobs
rdx = find(~isnan(rawdata(:,variable))); m = mean(rawdata(rdx,variable)); data(rdx,variable) = rawdata(rdx,variable)-m; bayestopt_.mean_varobs(variable) = m;
end
else
bayestopt_.mean_varobs = mean(rawdata,1)'; data = rawdata-repmat(bayestopt_.mean_varobs',gend,1);
end
else
data=rawdata;
end
% Transpose the dataset array.
data = transpose(data);
I pushed the fix to the 4.2 branch.
Best, Johannes
Johannes Pfeifer
Haußerstr. 29
72076 Tübingen
Tel.: +49-(0)7071-6396184
Mobil: +49-(0)170-6936820
jpfeifer@gmx.de
*Von:*Johannes Pfeifer [mailto:jpfeifer@gmx.de] *Gesendet:* Freitag, 11. Mai 2012 20:14 *An:* List for Dynare developers (dev@dynare.org) *Betreff:* Bug in dynare_estimation_init in 4.2.5
Dear all,
dynare_estimation_init.m in 4.2.5 currently reads
ifoptions_.prefilter == 1
ifoptions_.missing_data
bayestopt_.mean_varobs = zeros(n_varobs,1);
forvariable=1:n_varobs
rdx = find(~isnan(rawdata(:,variable))); m = mean(rawdata(rdx,variable)); rawdata(rdx,variable) = rawdata(rdx,variable)-m; bayestopt_.mean_varobs(variable) = m;
end
else
bayestopt_.mean_varobs = mean(rawdata,1)'; rawdata = rawdata-repmat(bayestopt_.mean_varobs',gend,1);
end
end
% Transpose the dataset array.
data = transpose(rawdata);
Hence, rawdata is overwritten with the demeaned data. This leads to wrong smoother plots. The corresponding part should be:
ifoptions_.prefilter == 1
ifoptions_.missing_data
data=rawdata; bayestopt_.mean_varobs = zeros(n_varobs,1);
forvariable=1:n_varobs
rdx = find(~isnan(rawdata(:,variable))); m = mean(rawdata(rdx,variable)); data(rdx,variable) = rawdata(rdx,variable)-m; bayestopt_.mean_varobs(variable) = m;
end
else
bayestopt_.mean_varobs = mean(rawdata,1)'; data = rawdata-repmat(bayestopt_.mean_varobs',gend,1);
end
end
% Transpose the dataset array.
data = transpose(data);
I tried to push a fix for cherrypicking to 4.2 but I am not sure I succeeded.
Best,
Johannes
Johannes Pfeifer
Haußerstr. 29
72076 Tübingen
Tel.: +49-(0)7071-6396184
Mobil: +49-(0)170-6936820
jpfeifer@gmx.de mailto:jpfeifer@gmx.de
Dev mailing list Dev@dynare.org https://www.dynare.org/cgi-bin/mailman/listinfo/dev