Skip to content

Commit

Permalink
Fix a bug in assertions in arCalcHierarchical
Browse files Browse the repository at this point in the history
Currently arCalcHierarchical requires no dependence of errors on any
fittable parameters, neither explicitly nor implicitly. Until now,
arCalcHierarchical has been asserting that there is no fitting of error
parameters, but at the same time has been allowing implicit dependence
of errors on fittable parameters of the model via observables. This is
a bug since with such implicit dependence of errors on fittable
parameters the results of arCalcHierarchical are incorrect. This commit
fixes it by asserting the use of experimental errors, which are
independent of the fittable parameters by definition.
  • Loading branch information
gdudziuk committed Feb 11, 2020
1 parent b0cc36b commit 1b7fb04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arFramework3/Subfunctions/arCalcHierarchical.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ function arCalcHierarchical(sensi)
end
end
end
errorFitting = ( (ar.config.fiterrors==1 || (ar.config.fiterrors==0 && haveNanExpStd)) && any(ar.qFit(ar.qError==1)==1) );
assert(~errorFitting,'Hierarchical optimization in combination with with error fitting is not supported yet.')
useErrorModel = (ar.config.fiterrors==1 || (ar.config.fiterrors==0 && haveNanExpStd));
assert(~useErrorModel,'Hierarchical optimization in combination with model-based errors is not supported yet. Please use experimental errors.')
useCustomResidual = isfield(ar.config,'user_residual_fun') && ~isempty(ar.config.user_residual_fun);
assert(~useCustomResidual,'Hierarchical optimization in combination with custom residuals is not supported yet.')
assert(~isfield(ar,'conditionconstraints'),'Hierarchical optimization in combination with condition constraints is not supported yet.')
Expand Down

0 comments on commit 1b7fb04

Please sign in to comment.