Fixed bug.

PAC/NLS routine was only working if the PAC model was named `pacman`.
time-shift
Stéphane Adjemia (Scylla) 2018-12-19 16:00:57 +01:00
parent 11b24a0663
commit df57bf7eb9
Signed by untrusted user who does not match committer: stepan
GPG Key ID: A6D44CB9C64CE77B
1 changed files with 8 additions and 8 deletions

View File

@ -193,8 +193,8 @@ else
case 'GaussNewton'
% Nothing to do here.
case 'lsqnonlin'
bounds = ones(length(params0),1)*[-10,10];
bounds(strcmp(fieldnames(params), M_.param_names(M_.pac.pacman.ec.params)),1) = .0;
bounds = ones(length(params0),1)*[-Inf,Inf];
bounds(strcmp(fieldnames(params), M_.param_names(M_.pac.(pacmodl).ec.params)),1) = .0;
case 'fmincon'
if isoctave
error('Optimization algorithm ''fmincon'' is not available under Octave')
@ -202,8 +202,8 @@ else
error('Optimization algorithm ''fmincon'' requires the Optimization Toolbox')
end
minalgo = 1;
bounds = ones(length(params0),1)*[-10,10];
bounds(strcmp(fieldnames(params), M_.param_names(M_.pac.pacman.ec.params)),1) = .0;
bounds = ones(length(params0),1)*[-Inf,Inf];
bounds(strcmp(fieldnames(params), M_.param_names(M_.pac.(pacmodl).ec.params)),1) = .0;
case 'fminunc'
if isoctave && ~user_has_octave_forge_package('optim')
error('Optimization algorithm ''fminunc'' requires the optim package')
@ -224,8 +224,8 @@ else
minalgo = 8;
case 'annealing'
minalgo = 2;
bounds = ones(length(params0),1)*[-10,10];
bounds(strcmp(fieldnames(params), M_.param_names(M_.pac.pacman.ec.params)),1) = .0;
bounds = ones(length(params0),1)*[-Inf,Inf];
bounds(strcmp(fieldnames(params), M_.param_names(M_.pac.(pacmodl).ec.params)),1) = .0;
parameter_names = fieldnames(params);
case 'particleswarm'
if isoctave
@ -234,8 +234,8 @@ else
error('Optimization ''particleswarm'' requires the Global Optimization Toolbox')
end
minalgo = 12;
bounds = ones(length(params0),1)*[-10,10];
bounds(strcmp(fieldnames(params), M_.param_names(M_.pac.pacman.ec.params)),1) = .0;
bounds = ones(length(params0),1)*[-Inf,Inf];
bounds(strcmp(fieldnames(params), M_.param_names(M_.pac.(pacmodl).ec.params)),1) = .0;
parameter_names = fieldnames(params);
otherwise
msg = sprintf('%s is not an implemented optimization routine.\n', optimizer);