To implement the poisson distribution using R programming.
dpois(x, lambda= )
Gives height of the probability distribution at each point pnbinom(x, lambda= )
Gives the cumulative probability of an event qnbinom(p, lambda= )
It takes the probability value and gives a number whose cumulative value matches the probability value.
rnbinom(x, lambda= ) Used to generate random numbers whose distribution is binomial.
x -- vector
Lambda -- vector of (non-negative) means.
#Poisson Distribution
#dpois
x<-seq(0,100,by=1)
y<-dpois(x,lambda = 10)
plot(x,y,col=”blue”)
#ppois
y<-ppois(x,lambda = 50)
plot(x,y,col=”red”)
#qpois
y<-qpois(p=0.6,lambda = 20)
print(y)
#rpois
x<-rpois(200,lambda = 30)
hist(x,col=285)