Question about convolution of two discrete random variable

There is poisson random variable X with T*lambda_MUE.
There is poisson random variable Z with lambda_SMC.
And i define new random variable K=aX+bZ. (a and b is positive integer which is greater than 0)
To calculate pmf of K i used conv function.
And calculate using below command but it is not equal to E[K]
What i expect is 123 but result is 43 .
What is wrong?
Thank you
lambda_MUE = 2;
lambda_SMC = 3;
alpha = 3;
beta = 1;
T=20;
g=alpha*(0:1:110);
z=beta*(0:1:110);
K=0:1:(max(g)+max(z));
P_X = ((T*lambda_MUE).^(g/alpha))./(factorial(g./alpha)).*exp(-T*lambda_MUE);
P_Z = (lambda_SMC.^(z./beta))./(factorial(z./beta)).*exp(-lambda_SMC);
P_K = conv(P_X,P_Z);
sum(K(1:1:length(P_K)).*P_K)

12 件のコメント

Torsten
Torsten 2016 年 2 月 5 日
20*2+1*3=43
How do you arrive at 123 ?
Best wishes
Torsten.
h kim
h kim 2016 年 2 月 5 日
I expect below
T*lambda_MUE*alpha + lambda_SMC*beta=20*2*3+1*3=123
Torsten
Torsten 2016 年 2 月 5 日
編集済み: Torsten 2016 年 2 月 5 日
No. You form the convolution of two Poisson random variables with expected values T*lambda_MUE and lambda_SMC. The expected value of their sum is T*lambda_MUE + lambda_SMC = 43.
Best wishes
Torsten.
h kim
h kim 2016 年 2 月 5 日
There is mistake.
I written X and Y are poisson on outside code.
But in code P_X and P_Y is not poisson sorry about that.
Please check below page
P_X and P_Y is not poisson.
Torsten
Torsten 2016 年 2 月 5 日
X and Y in your code are Poisson random variables since g/alpha = (0:1:110) and z/beta = (0:1:110).
Best wishes
Torsten.
h kim
h kim 2016 年 2 月 5 日
But support of X is (0,alpha,2alpha,......) so expectation value of X is not lambda*T but alpha*lambda*T. And that of Y is (0, beta,2beta,....). Expectation value of P_X is 120 and that of P_Y is 3. Therefore i expect expectation value of Z is 123.
Torsten
Torsten 2016 年 2 月 5 日
I don't see any line in your code where the above comes into play.
All the calculations assume that the support for X and Y is 0,1,2,... .
Best wishes
Torsten.
h kim
h kim 2016 年 2 月 5 日
Oh.... i incorrectly think.
Thank you i solve!
I really appreciate you!
the cyclist
the cyclist 2016 年 2 月 5 日
The best form of thanks is to upvote and/or accept an answer that was helpful. This rewards the contributor, and may help guide future users trying to solve similar problems.
John D'Errico
John D'Errico 2016 年 2 月 5 日
Of course, where there is no explicit answer, it reflects a problem with the site, that we cannot up-vote comments.
the cyclist
the cyclist 2016 年 2 月 5 日
Indeed. (I'm so used to making that comment, that I failed to notice there was no answer here!)
John BG
John BG 2016 年 2 月 6 日
we are all glad you found out, can we now focus on the question?

サインインしてコメントする。

 採用された回答

h kim
h kim 2016 年 2 月 9 日
編集済み: h kim 2016 年 2 月 9 日

0 投票

If we use above code, P_X describe probability density in support [0,1,2,3.......]
But actual aim is probability density function describing probability density in support [0,alpha,2alpha,.....]
So we need additional code which make zero probability density when support is not multiple of alpha like below.
-----------------------------------------------------------------------------
for i=0:1:300
if(mod(i,alpha)==0)
P_X=[P_X ((lambda_MUE).^(i/alpha))./(factorial(i./alpha)).*exp(-lambda_MUE)];
else
P_X=[P_X 0];
end
end
-----------------------------------------------------------------------------

その他の回答 (0 件)

質問済み:

2016 年 2 月 5 日

編集済み:

2016 年 2 月 9 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by