Question about convolution of two discrete random variable

4 views (last 30 days)
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 Comments
the cyclist
the cyclist on 5 Feb 2016
Indeed. (I'm so used to making that comment, that I failed to notice there was no answer here!)
John BG
John BG on 6 Feb 2016
we are all glad you found out, can we now focus on the question?

Sign in to comment.

Accepted Answer

h kim
h kim on 9 Feb 2016
Edited: h kim on 9 Feb 2016
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
-----------------------------------------------------------------------------

More Answers (0)

Community Treasure Hunt

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

Start Hunting!