Fixed bug manifesting if a model is first estimated with cova_compute=0 and if the resulting mode file is loaded after.

Added condition on the existence of hh in the mode_file.
time-shift
Stéphane Adjemian (Charybdis) 2013-09-19 15:25:23 +02:00
parent b95f000d8f
commit 22968497ad
1 changed files with 9 additions and 3 deletions

View File

@ -176,7 +176,9 @@ if ~isempty(estim_params_) && ~isempty(options_.mode_file) && ~options_.mh_poste
disp('==> Fix mode file (remove unused parameters).')
mode_file.parameter_names = mode_file.parameter_names(Id,:);
mode_file.xparam1 = mode_file.xparam1(Id);
mode_file.hh = mode_file.hh(Id,Id);
if isfield(mode_file,'hh')
mode_file.hh = mode_file.hh(Id,Id);
end
end
end
else
@ -208,13 +210,17 @@ if ~isempty(estim_params_) && ~isempty(options_.mode_file) && ~options_.mh_poste
disp('==> Fix mode file (reorder the parameters).')
mode_file.parameter_names = mode_file.parameter_names(Id,:);
mode_file.xparam1 = mode_file.xparam1(Id);
mode_file.hh = mode_file.hh(Id,Id);
if isfield(mode_file,'hh')
mode_file.hh = mode_file.hh(Id,Id);
end
end
end
end
end
xparam1 = mode_file.xparam1;
hh = mode_file.hh;
if isfield(mode_file,'hh')
hh = mode_file.hh;
end
skipline()
end