I have the following vectors/matrices:
a --> nx1
b --> nx1
C --> nxn
Given I know a and C, I want to maximize the following in Matlab by varying vector b:
S = a(1)*log(sum(b.*C(:,1),1))+...+a(n)*log(sum(b.*C(:,n),1))
So each element of the sum S to be maximized is formed by:
- i'th element of vector a multiplied by (2)
- natural logarithm of (3)
- sum of elements obtained in (4)
- element-by-element multiplication of the elements of vector b by the elements of the i'th column of matrix C
The constraints to the problem are that each element of b must be >=0 and <=1, and that they must sum to 1.
I assume I would have to use the fmincon function and minimze -S but not sure how to setup function S.