Poisson PDF
y = distfun_poisspdf(x,lambda)
a matrix of doubles, the number of occurrences of events. x belongs to the set {0,1,2,3,.....}
a matrix of doubles, the average rate of occurrence. lambda>0.
a matrix of doubles, the probability density.
Computes the probability distribution function of the poisson distribution function.
Any scalar input argument is expanded to a matrix of doubles of the same size as the other input arguments.
The function definition is:
Note : x belongs to the set {0,1,2,3,...}.
//Test with x scalar, lambda scalar p = distfun_poisspdf(0,2) expected = 0.1353353; //Test with x expanded, lambda scalar computed = distfun_poisspdf([0 3],2) expected = [0.1353353 0.1804470]; //Test with x scalar, lambda expanded computed = distfun_poisspdf(3,[2 4]) expected = [0.1804470 0.1953668]; //Test with both the arguments expanded computed = distfun_poisspdf([3 4 8],[5 8 2]) expected = [0.1403739 0.0572523 0.0008593]; //Plot the function scf(); x = 0:20; y = distfun_poisspdf(x,1); plot(x,y,"ro-"); y1 = distfun_poisspdf(x,4); plot(x,y1,"go-"); y2 = distfun_poisspdf(x,10); plot(x,y2,"bo-"); xtitle("Poisson PDF","x","y"); legend(["lambda=1","lambda=4","lambda=10"]); | ![]() | ![]() |
http://en.wikipedia.org/wiki/Poisson_distribution