Is it possible to use the fmincon function to minimize a function with respect to multiple variables simultaneously?

Hello Everyone! I would like to ask for your help regarding a project I am working on. This is the part of the script recalling the minimization problem:
min_result=Wishart_to_Call_min(Method,CallPrices,ImpliedVol,upper,...
lower,rate,lambdax,LambdaV,LambdaI,Tau,x_t,M,Q,R,I,Sigma,beta,Strikes);
%here starts the minimization procedure
fmincon(@(M,Q,R,Sigma,beta)Wishart_to_Call_min(Method,CallPrices,ImpliedVol,upper,...
lower,rate,lambdax,LambdaV,LambdaI,Tau,x_t,M,Q,R,I,Sigma,beta,Strikes),(M,Q,R,Sigma,beta))
The function Wishart_to_Call_min computes the least squares of the model estimates and the market observations.I have to minimize this function with regard to multiple conditions, namely: M, Q, R and Sigma which are all 2x2 non-symmetrical matrices and beta which is a scalar.
I thought of using fmincon to solve the problem but I do not know whether:
  • It could be done in the first place
  • How to correctly impose the conditions.
Also consider the following constriction on the parameters:
M has all the elements negative.
Q and Sigma all the elements positive.
R theoretically has all the elements ranging in [-1,1].
beta musy be greater than 0.
Thank you in advance for your time.
-Ixhino

 Accepted Answer

lb_M = -inf * ones(2,2); ub_M = -eps(realmin) * ones(2,2);
lb_Q = eps(realmin) * ones(2,2); ub_Q = inf * ones(2,2);
lb_Sigma = eps(realmin) * ones(2,2); ub_Sigma = inf * ones(2,2);
lb_R = -1 * ones(2,2); ub_R = 1 * ones(2,2);
lb_beta = eps(realmin); ub_beta = inf;
x0 = [M0(:); Q0(:); R0(:); Sigma0(:); beta0];
A = []; b = [];
Aeq = []; beq = [];
lb = [lb_M(:); lb_Q(:); lb_R(:); lb_Sigma(:); lb_beta(:)];
ub = [ub_M(:); ub_Q(:); ub_R(:); ub_Sigma(:); ub_beta(:)];
nonlcon = [];
options = optimoptions(@fmincon, 'Algorithm', 'interior-point', 'MaxIterations', 1500, 'display', 'iter', 'PlotFcn', {@optimplotx, @optimplotfval});
[x, fval, exitflag] = fmincon(@(x) Wishart_to_Call_min(Method, CallPrices, ImpliedVol, upper, lower, rate, lambdax, LambdaV, LambdaI, Tau, x_t, reshape(x(1:4),2,2), reshape(x(5:8),2,2), reshape(x(9:12),2,2), I, reshape(x(13:16),2,2), x(17), Strikes), x0, A, b, Aeq, beq, lb, ub, nonlcon, options);
M = reshape(x(1:4),2,2);
Q = reshape(x(5:8),2,2);
R = reshape(x(9:12),2,2);
Sigma = reshape(x(13:16),2,2);
beta = x(17);

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!