This is a convex optimization problem, which can easily be formed (and solved), in CVX, among other convex optimization tools.
Let $A = x_1I_1 + x_2I_2 + ... + x_nI_n$, where the $I_i$ are m by m matrices (this does not require $m = n)$.
$A$ is symmetric positive definite, because each $x_iI_i$ is symmetric positive definite, and hence the sum of these terms also is (unless all $x_i = 0$ (in which case it would still be symmetric positive semidefinite), but the optimizer would never choose that solution because it is non-optimal).
The objective function is a matrix fractional form, as is shown in example 3.4 of Convex Optimization, by Boyd and Vandenberghe. This is done by use of epigraph formulation, which utilizes a semidefinite constraint, which is shown in the YALMIP code at the end of this post.
CVX (under MATLAB) conveniently has a function, matrix_frac
, which under the hood, converts this to the epigraph formulation shown in example 3.4 (and below in the YALMIP (under MATLAB) code). That formulation can be used if using a convex optimization tool, such as YALMIP, which doesn't have a built-in matrix_frac
function. The popular tool, CVXPY (under Python), also has a matrix_frac
, which is used the same way as CVX's.
The CVX code below (as well as the YALMIP code at the end of this post) assumes that I is an m by m by n array, for which $I(:,:,i) = I_i$.
cvx_begin
variable x(n)
A=0;
for i=1:n
A=A+x(i)*I(:,:,i);
end
minimize(matrix_frac(ones(m,1),A))
0 <= x <= 1
sum(x) <= 1
cvx_end
After successful execution, x will be populated with the optimal solution.
Note: the formulation could be changed, with no effect on optimal solution, to change the constraints to 0 <= x , sum(x) == 1
.
Here is the explicit epigraph formulation, which I'll show in YALMIP.
x = sdpvar(n,1);
t = sdpvar;
A=0;
for j=1:n
A=A+x(j)*I(:,:,j);
end
Constraints = [[A ones(m,1);ones(1,m) t] >= 0,0 <= x <= 1,sum(x) <= 1];
optimize(Constraints,t) % minimizes t, subject to Constraints
at the successful conclusion of which, value(x)
is the optimal value of x. Note that the constraint [A ones(m,1);ones(1,m) t] >= 0
denotes in YALMIP that the matrix [A ones(m,1);ones(1,m) t]
is constrained to be symmetric positive semidefinite. Minimizing t
, subject to that semidefinite constraint is the epigraph formulation previously mentioned.