How to express integration of mutual information in MATLAB?
이전 댓글 표시
Hello,
I am currently working on a project where I have to plot the exit chart of the mutual information exchanged between two entities. The following function is necessary:
J = integral [-inf,inf] {e^(-(y-1)^2/4)*log2(1+e^-y)}dy
However, I am having a hard time trying to code it in MATLAB.
Can anyone please tell me the necessary lines needed in code to do this?
댓글 수: 3
Walter Roberson
2013년 8월 9일
Is it exp(-(y-1)^2)/4 or is it exp(-(y-1)^2/4) ?
Rana
2013년 8월 10일
Walter Roberson
2013년 8월 10일
It appears there is no (obvious) closed-form solution for that. (Perhaps there is a change of variable that could be done, but I could not see it.) You will likely need to use numeric integration like Andrei shows.
답변 (1개)
Andrei Bobrov
2013년 8월 9일
편집: Andrei Bobrov
2013년 8월 9일
f = @(y) exp (-(y - 1) .^ 2 / 4) .* log2 (1 + exp (-y));
out = integral(f,-100,inf);
or
out = quadgk(f,-100,inf);
댓글 수: 2
Rana
2013년 8월 12일
Walter Roberson
2013년 8월 12일
The plot of what? For any given u, there is only a single result_u . Are you plotting over a range of u? If so, what range? What result are you getting that shows that it is not a function of u? Show your code.
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!