Exercise 4.57: Capacity of a communication channel
rand('state', 0);
n = 15;
m = 10;
P = rand(m,n);
P = P./repmat(sum(P),m,1);
c = sum(P.*log2(P))';
cvx_begin
variable x(n)
y = P*x;
maximize (c'*x + sum(entr(y))/log(2))
x >= 0;
sum(x) == 1;
cvx_end
C = cvx_optval;
display(['The channel capacity is: ' num2str(C) ' bits.'])
Successive approximation method to be employed.
sedumi will be called several times to refine the solution.
Original size: 45 variables, 21 equality constraints
10 exponentials add 80 variables, 50 equality constraints
-----------------------------------------------------------------
Errors
Act Centering Conic Status
-----------------------------------
10 2.317e+00 4.909e-01 Solved
10 1.577e-01 2.042e-03 Solved
10 1.404e-02 1.616e-05 Solved
10 1.721e-03 3.710e-07 Solved
10 2.694e-04 4.632e-08 Solved
10 5.890e-05 9.018e-08S Solved
10 6.989e-06 9.126e-08S Solved
10 1.372e-04S 1.811e-09 Solved
10 3.579e-05 0.000e+00 Solved
-----------------------------------------------------------------
Status: Solved
Optimal value (cvx_optval): +0.296291
The channel capacity is: 0.29629 bits.