If possible define boundaries for the share of optimizing agents in PAC/NLS.
The parameter is constrained to be in (0,1) for the following algorithms - lsqnonlin (without Levenberg-Marquardt) - fmincon - annealing - particleswarm Other algorithms do not allow the definition of boundaries... We should add a penality function to the objective for these algorithms.time-shift
parent
df57bf7eb9
commit
c829e7968d
|
@ -195,6 +195,8 @@ else
|
|||
case 'lsqnonlin'
|
||||
bounds = ones(length(params0),1)*[-Inf,Inf];
|
||||
bounds(strcmp(fieldnames(params), M_.param_names(M_.pac.(pacmodl).ec.params)),1) = .0;
|
||||
bounds(ipnames_==M_.pac.(pacmodl).share_of_optimizing_agents_index, 1) = 0.0;
|
||||
bounds(ipnames_==M_.pac.(pacmodl).share_of_optimizing_agents_index, 2) = 1.0;
|
||||
case 'fmincon'
|
||||
if isoctave
|
||||
error('Optimization algorithm ''fmincon'' is not available under Octave')
|
||||
|
@ -204,6 +206,8 @@ else
|
|||
minalgo = 1;
|
||||
bounds = ones(length(params0),1)*[-Inf,Inf];
|
||||
bounds(strcmp(fieldnames(params), M_.param_names(M_.pac.(pacmodl).ec.params)),1) = .0;
|
||||
bounds(ipnames_==M_.pac.(pacmodl).share_of_optimizing_agents_index, 1) = 0.0;
|
||||
bounds(ipnames_==M_.pac.(pacmodl).share_of_optimizing_agents_index, 2) = 1.0;
|
||||
case 'fminunc'
|
||||
if isoctave && ~user_has_octave_forge_package('optim')
|
||||
error('Optimization algorithm ''fminunc'' requires the optim package')
|
||||
|
@ -224,8 +228,10 @@ else
|
|||
minalgo = 8;
|
||||
case 'annealing'
|
||||
minalgo = 2;
|
||||
bounds = ones(length(params0),1)*[-Inf,Inf];
|
||||
bounds = ones(length(params0),1)*[-100,100];
|
||||
bounds(strcmp(fieldnames(params), M_.param_names(M_.pac.(pacmodl).ec.params)),1) = .0;
|
||||
bounds(ipnames_==M_.pac.(pacmodl).share_of_optimizing_agents_index, 1) = 0.0;
|
||||
bounds(ipnames_==M_.pac.(pacmodl).share_of_optimizing_agents_index, 2) = 1.0;
|
||||
parameter_names = fieldnames(params);
|
||||
case 'particleswarm'
|
||||
if isoctave
|
||||
|
@ -234,8 +240,10 @@ else
|
|||
error('Optimization ''particleswarm'' requires the Global Optimization Toolbox')
|
||||
end
|
||||
minalgo = 12;
|
||||
bounds = ones(length(params0),1)*[-Inf,Inf];
|
||||
bounds = ones(length(params0),1)*[-100,100];
|
||||
bounds(strcmp(fieldnames(params), M_.param_names(M_.pac.(pacmodl).ec.params)),1) = .0;
|
||||
bounds(ipnames_==M_.pac.(pacmodl).share_of_optimizing_agents_index, 1) = 0.0;
|
||||
bounds(ipnames_==M_.pac.(pacmodl).share_of_optimizing_agents_index, 2) = 1.0;
|
||||
parameter_names = fieldnames(params);
|
||||
otherwise
|
||||
msg = sprintf('%s is not an implemented optimization routine.\n', optimizer);
|
||||
|
|
Loading…
Reference in New Issue