Optimization of an objective function with matrix as a variable
28 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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).
0 comentarios
Respuestas (1)
Matt J
el 15 de Mayo de 2014
Editada: Matt J
el 15 de Mayo de 2014
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 comentarios
Matt J
el 15 de Mayo de 2014
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 );
Ver también
Categorías
Más información sobre Get Started with Optimization Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!