Optimization of an objective function with matrix as a variable

22 次查看(过去 30 天)
I have a function to be maximized with takes as input a 100 x 100 matrix. How do i dynamically optimize this using optimization toolbox, i.e. varying the entire (100 x 100) matrix simultaneously [not cell by cell or row by row]. In addition, i also need to put constraint on every element of matrix. In short it becomes a single objective function, 10000 variables, 10001 constraints problem. Code attached (main & function) in which I want to optimize the Terminal_Wealth with constraint on variable alpha matrix [0<a(i,j)<1] & Risk<10 (--> this would be a non-linear constraint, I suppose).

回答(1 个)

Matt J
Matt J 2014-5-15
编辑:Matt J 2014-5-15
This is probably what you're looking for
Essentially, there is nothing stopping you from writing an objective function that takes a 100x100 matrix as input. However, if you have linear in/equality constraint matrix data A,b,Aeq,beq then A,Aeq will have 10000 columns and will be expected to be written so that
A*X(:)<=b
Aeq*X(:)=beq
are the constraints on a given 100x100 matrix X.
  2 个评论
Matt J
Matt J 2014-5-15
Maybe an example would be best. Suppose, I have a 2x2 matrix X and I want to minimize the sum over all the elements, subect to the constraints 0<=X(i,j)<=1 and
sum(X(i,j)^2)=1
Then I could do so as follows
nonlcon=@(X) deal([],norm(X(:))^2-1);
X= fmincon(@(X) sum(X(:)),rand(2),[],[],[],[],...
zeros(2), ones(2), nonlcon );

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Get Started with Optimization Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by