Add more explicit error message.

pac.print does not work in PAC/MCE equations.
pac-components
Stéphane Adjemian (Charybdis) 2021-10-25 19:23:51 +02:00
parent 4f5e0c7faa
commit ceb67c42c7
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
1 changed files with 11 additions and 7 deletions

View File

@ -93,14 +93,18 @@ end
expectationmodel = M_.(expectationmodelfield).(expectationmodelname);
% Get the name of the associated VAR model and test its existence.
if ~isfield(M_.(expectationmodel.auxiliary_model_type), expectationmodel.auxiliary_model_name)
switch expectationmodelkind
case 'var'
error('Unknown VAR/TREND_COMPONENT model (%s) in VAR_EXPECTATION_MODEL (%s)!', expectationmodel.auxiliary_model_name, expectationmodelname)
case 'pac'
error('Unknown VAR/TREND_COMPONENT model (%s) in PAC_EXPECTATION_MODEL (%s)!', expectationmodel.auxiliary_model_name, expectationmodelname)
otherwise
if isfield(M_.(expectationmodelfield), 'auxiliary_model_type')
if ~isfield(M_.(expectationmodel.auxiliary_model_type), expectationmodel.auxiliary_model_name)
switch expectationmodelkind
case 'var'
error('Unknown VAR/TREND_COMPONENT model (%s) in VAR_EXPECTATION_MODEL (%s)!', expectationmodel.auxiliary_model_name, expectationmodelname)
case 'pac'
error('Unknown VAR/TREND_COMPONENT model (%s) in PAC_EXPECTATION_MODEL (%s)!', expectationmodel.auxiliary_model_name, expectationmodelname)
otherwise
end
end
else
error('print method does not work in PAC/MCE.')
end
auxmodel = M_.(expectationmodel.auxiliary_model_type).(expectationmodel.auxiliary_model_name);