Computing the Poisson distribution function of the matrix
Here, we are creating the matrix of data points and using them to plot the Poisson density curve as same as above graph.
R
# Declaring the data points data_points <- matrix (1:20,ncol=4) print (data_points) # Specifying the lambda value val<- 3 # Plotting the data points plot ( dpois (x= data_points,lambda= val),type= "b" , xlab = "Idx Value" , ylab = "Poisson Density Function" ) |
Output:
> print(data_points)
[,1] [,2] [,3] [,4]
[1,] 1 6 11 16
[2,] 2 7 12 17
[3,] 3 8 13 18
[4,] 4 9 14 19
[5,] 5 10 15 20
How to Draw Poisson Density Curve in R?
In this article, we are going to learn how to draw the Poisson density curve in the R programming language.
Function used:
dpois(): The dpois() method is used to accept the vector of quantiles and the vector of means as the input parameters. The dpois() method has the following syntax :
Syntax: dpois (q, m)
Arguments :
- q – Vector of quantiles.
- m – Vector of means.