Can I combine multiple objective functions that share same optimization parameters for lsqnonlin?
Mostrar comentarios más antiguos
Hello,
I have two objective functions that share common optimization parameters. Following the Matlab lsqnonlin documentation(https://www.mathworks.com/help/optim/ug/lsqnonlin.html) and this answer (https://www.mathworks.com/matlabcentral/answers/285211-how-to-combine-multiple-objective-functions-for-lsqnonlin), I combined these two functions using the following method:
%%% Example from https://www.mathworks.com/matlabcentral/answers/285211-how-to-combine-multiple-objective-functions-for-lsqnonlin
function [ rssOutput ] = objFunctions( params,X,Y)
a = params(1); % parameter 1
b = params(2); % parameter 2
rss1 = a.*exp(b.*X) - Y; % objective function 1 -> result in 1x21 vector
rss2 = a.*sin(b.*X) - Y; % objective function 2 -> result in 1x500 vector
rssOutput = [rss1; rss2]; % -> 1x521 vector || Why and how do we sum these two functions?
% How it is work? And why it is work well?
end
Initial parameters:
x0 = [1,1]';
Call lsqnonlin:
options = optimoptions('lsqnonlin','Display','iter','Algorithm','levenberg-marquardt',...
'DerivativeCheck','on','Diagnostics','on','ScaleProblem','jacobian');
options.StepTolerance = 1e-12;
options.FunctionTolerance = 1e-12;
options.OptimalityTolerance = 1e-12;
options.MaxFunctionEvaluations = 1e10;
options.MaxIterations = 200;
x=lsqnonlin(@objFunctions,x0,[],[],[],X,Y,options);
Don't we lose the weight of the functions with such simple summation?
Also, during the optimization process, we don't know which of the functions we are optimizing at the moment (which error do we reduce right now...although it depends more on the type of each objective function).
Can someone, please, explain me why and how it is work? What is the scientific (mathematical) explanation behind this "two objective function sum" action? How lsqnonlin handle with this? And why it works so well??? (If possible, please, provide proof/example of scientific articles, books, etc.)
Thank you very much!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Systems of Nonlinear Equations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!