The Poisson distribution represents the probability of a provided number of cases happening in a set period of space or time if these cases happen with an identified constant mean rate (free of the period since the ultimate event). Poisson distribution has been named after Siméon Denis Poisson(French Mathematician).

Many probability distributions can be easily implemented in R language with the help of R’s inbuilt functions.

There are four Poisson functions available in R:

- dpois
- ppois
- qpois
- rpois

Consider a Random Variable X with Poisson distribution given as The mean of this distribution is given by The variance of such a distribution is

So if there are ‘n’ which happened out of which the only k were successful when the probability of success is very less then the probability of success becomes

#### dpois()

This function is used for illustration of Poisson density in an R plot. The function `dpois()`

calculates the probability of a random variable that is available within a certain range.

**Syntax:**

**where,**

K:number of successful events happened in an interval

mean per interval

log:If TRUE then the function returns probability in form of log

**Example:**

`dpois(` `2` `, ` `3` `) ` `dpois(` `6` `, ` `6` `) ` |

*chevron_right*

*filter_none*

**Output:**

[1] 0.2240418 [1] 0.1606231

#### ppois()

This function is used for the illustration of cumulative probability function in an R plot. The function `ppois()`

calculates the probability of a random variable that will be equal to or less than a number.

**Syntax:**

**where,**

K:number of successful events happened in an interval

mean per interval

lower.tail:If TRUE then left tail is considered otherwise if the FALSE right tail is considered

log:If TRUE then the function returns probability in form of log

**Example:**

`ppois(` `2` `, ` `3` `) ` ` ` `ppois(` `6` `, ` `6` `) ` |

*chevron_right*

*filter_none*

**Output:**

[1] 0.4231901 [1] 0.6063028

#### rpois()

The function `rpois()`

is used for generating random numbers from a given Poisson’s distribution.

**Syntax:**

**where,**

q:number of randon numbers needed

mean per interval

**Example:**

`rpois(` `2` `, ` `3` `) ` `rpois(` `6` `, ` `6` `) ` |

*chevron_right*

*filter_none*

**Output:**

[1] 2 3 [1] 6 7 6 10 9 4

#### qpois()

The function `qpois()`

is used for generating quantile of a given Poisson’s distribution.

In probability, quantiles are marked points that divide the graph of a probability distribution into intervals (continuous ) which have equal probabilities.

**Syntax:**

**where,**

K:number of successful events happened in an interval

mean per interval

lower.tail:If TRUE then left tail is considered otherwise if the FALSE right tail is considered

log:If TRUE then the function returns probability in form of log

**Example:**

`y <` `-` `c(.` `01` `, .` `05` `, .` `1` `, .` `2` `) ` `qpois(y, ` `2` `) ` `qpois(y, ` `6` `) ` |

*chevron_right*

*filter_none*

**Output:**

[1] 0 0 0 1 [1] 1 2 3 4

## Recommended Posts:

- Getting the Modulus of the Determinant of a Matrix in R Programming - determinant() Function
- Set or View the Graphics Palette in R Programming - palette() Function
- tidyr Package in R Programming
- Get Exclusive Elements between Two Objects in R Programming - setdiff() Function
- Intersection of Two Objects in R Programming - intersect() Function
- Add Leading Zeros to the Elements of a Vector in R Programming - Using paste0() and sprintf() Function
- Clustering in R Programming
- Compute Variance and Standard Deviation of a value in R Programming - var() and sd() Function
- Compute Density of the Distribution Function in R Programming - dunif() Function
- Compute Randomly Drawn F Density in R Programming - rf() Function
- Data Handling in R Programming
- Return a Matrix with Lower Triangle as TRUE values in R Programming - lower.tri() Function
- Print the Value of an Object in R Programming - identity() Function
- Check if Two Objects are Equal in R Programming - setequal() Function
- Random Forest with Parallel Computing in R Programming
- R - Object Oriented Programming
- Check for Presence of Common Elements between Objects in R Programming - is.element() Function
- Check if Elements of a Vector are non-empty Strings in R Programming - nzchar() Function
- Finding the length of string in R programming - nchar() method
- Data Reshaping in R Programming