Plot the Poisson CDF with the Standard Normal Distribution CDF

6 visualizaciones (últimos 30 días)
Meng Fei Wong
Meng Fei Wong el 7 de En. de 2022
Editada: Torsten el 8 de En. de 2022
Hello all, I have a question on plotting the Poisson cdf together with the standard normal distribution cdf. Below is the task description:
Let X be a random variable with and be the normalized version of X.
The following figure shows the cdf of for some and the cdf Φ of the standard normal distribution.
I have tried my best to plot as same as the given figure but still I am not able to get it looks similiar as the given figure. Below is my result:
May I know what do I miss? Below is my code:
pe = makedist('Normal')
x1 = -3:.1:3;
p = cdf(pe,x1);
%plot(x1,p)
x3 = -3:3;
y3 = poisscdf(x3,1);
figure
stairs(x3,y3)
hold on
plot(x1,p)
xlabel('Observation')
ylabel('Cumulative Probability')

Respuestas (2)

John D'Errico
John D'Errico el 8 de En. de 2022
Editada: John D'Errico el 8 de En. de 2022
Note that a Poisson random variable will ALWAYS be a non-negative number. It CANNOT have mass on the negative end of the real line. So the plot that you show, with a supposedly Poisson random variable that goes negative? It cannot exist. (At least not for a standard Poisson.)
Perhaps the intent is to have a Poisson random variable that has been transformed into the range of a normal distribution.
For example, Poisson distributions with large Poisson parameters will tend to look very normally distributed. (Not difficult to prove as I recall.)
fplot(@(x) poisscdf(x,50),[0,100])
So a Poisson CDF that does look quite normal. A quick glance at Wikipedia...
tells me that for a Poisson distribution with parameter lamnda, the mean will be lambda, as well as the variance. So we can simply do this:
lambda = 30;
fplot(@(x) poisscdf(x,lambda),[0,2*lambda])
hold on
fplot(@(x) normcdf(x,lambda,sqrt(lambda)))
grid on
hold off
s you should see, the two curves nearly overlay on top of each other.
In your figure, the Poisson was apparently transformed, via a transformation to look like a normal.
lambda = 30;
fplot(@(x) poisscdf(lambda + x*sqrt(lambda),lambda),[-3,3])
hold on
fplot(@(x) normcdf(x),[-3,3])
grid on
hold off
However, that is NOT a Poisson distibution because it is shown to have mass for negative x. It is derived from one.

Torsten
Torsten el 8 de En. de 2022
Editada: Torsten el 8 de En. de 2022
I suspect the graphics shows that the arithmetic mean of normalized independent Poisson random variables converges in distribution to the standard normal distribution.
You can see it from the following plot:
function main
lambda = 3;
m = 2000; % number of RVs
n = 3000; % number of samples
a = poissrnd(lambda,m,n);
for i=1:n
b(i) = (sum(a(:,i))/m-lambda)/sqrt(lambda/m); % normalized arithmetic mean of Poisson RVs
end
cdfplot(b); % plot empirical cdf of b
hold on
x = linspace(min(b),max(b));
plot(x,normcfd(x,0,1)) % compare with standard normal distribution
end

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by