Chapter 15 Other Distributions

A French Statypus Working on Geometric Statistics

Figure 15.1: A French Statypus Working on Geometric Statistics

Although platypuses do have webbed feet, they can retract the webbing between their toes to allow them to run, climb rocks, and even dig burrows.166

FILL INTRODUCTION

This chapter has not been finished. Contact the author with any questions!

New R Functions Used

All functions listed below have a help file built into RStudio. Most of these functions have options which are not fully covered or not mentioned in this chapter. To access more information about other functionality and uses for these functions, use the ? command. E.g. To see the help file for qnorm, you can run ?dgeom or ?dgeom() in either an R Script or in your Console.

  • dgeom(): Density function for the geometric distribution.

  • pgeom(): Distribution function for the geometric distribution.

  • qgeom(): Quantile function for the geometric distribution.

  • rgeom(): Random number generation for the geometric distribution.

  • ppois(): Distribution function for the Poisson distribution.

  • qpois(): Quantile function for the Poisson distribution.

  • rpois(): Random number generation for the Poisson distribution.

15.1 The Geometric Distribution

15.1.1 dgeom

The syntax of dgeom() is

dgeom(x, prob)     #This code will not run unless the necessary values are inputted.

where the parameters are:

  • x: Quantity to be evaluated for

  • prob: Probability of success on each trial.

15.1.2 pgeom

The syntax of pgeom() is

pgeom( q, prob, lower.tail )     #This code will not run unless the necessary values are inputted.

where the parameters are:

  • q: Quantile to be evaluated for

  • prob: Probability of success on each trial.

  • lower.tail: If TRUE (default), probabilities are \(P(X \leq q)\), otherwise, \(P(X > q)\).

15.1.3 qgeom

The syntax of qgeom() is

qgeom( p, prob, lower.tail )     #This code will not run unless the necessary values are inputted.

where the parameters are:

  • x: Quantity to be evaluated for

  • prob: Probability of success on each trial.

  • lower.tail: If TRUE, the result is q such that \({\text{p} = P(X \leq \text{q} )}\) and if FALSE, the result is q such that \({\text{p} = P(X > \text{q})}\). lower.tail is set to TRUE by default.

15.1.4 Random Geometric Quantities

The syntax of rgeom() is

rgeom(n, prob)     #This code will not run unless the necessary values are inputted.

where the parameters are:

  • n: Number of observations.

  • prob: Probability of success on each trial.

Example 15.1 Three way tool finally right

Socks <- rgeom(100,1/3)
head(Socks)
## [1] 0 0 2 3 3 1
table(Socks)
## Socks
##  0  1  2  3  4  5  6  8  9 10 11 18 
## 31 23 17  9  4  5  4  2  1  1  2  1

Example 15.2 Number of heads before first tails

set.seed(03271985)
FirstT <- rgeom(100,1/2)
table(FirstT)
## FirstT
##  0  1  2  3  4  5  6 13 
## 47 24 13  8  4  2  1  1

Example 15.3 First time rolling a 7167

rgeom(100,1/6)
##   [1]  1  0  4  2  3  4  2 11  2 14 23  4  5  2 12  4  6  4  1  3  1  3  0  0 12  9  4  0  1  7  1 11
##  [33]  1  5  3  0  2  1  2  0  1  1 12  5  1  6  6  3 17  4  0  0  0  7  9 15  2  4  4  3  3  1  2  2
##  [65]  0  6  1  2  2  8 16  5  1  4  2  0  8  9  3  0 10 20  1  1  8  1  2  3  3  0  5  0 13  2  0  1
##  [97]  2  6  3  7

15.2 Poisson Distribution

15.2.1 dpois

The syntax of dpois() is

dgeom( x, lambda )     #This code will not run unless the necessary values are inputted.

where the parameters are:

  • x: Quantity to be evaluated for.

  • lambda: Value of the mean, \(\lambda\), for the distribution.

15.2.2 ppois

The syntax of ppois() is

pgeom( q, lamdba, lower.tail )     #This code will not run unless the necessary values are inputted.

where the parameters are:

  • q: Quantile to be evaluated for.

  • lambda: Value of the mean, \(\lambda\), for the distribution.

  • lower.tail: If TRUE (default), probabilities are \(P(X \leq q)\), otherwise, \(P(X > q)\).

15.2.3 qpois

The syntax of qpois() is

qpois( p, lambda, lower.tail )     #This code will not run unless the necessary values are inputted.

where the parameters are:

  • x: Quantity to be evaluated for

  • lambda: Value of the mean, \(\lambda\), for the distribution.

  • lower.tail: If TRUE, the result is q such that \({\text{p} = P(X \leq \text{q} )}\) and if FALSE, the result is q such that \({\text{p} = P(X > \text{q})}\). lower.tail is set to TRUE by default.

15.2.4 Random Poisson Quantities

The syntax of rpois() is

rpois( n, lambda )     #This code will not run unless the necessary values are inputted.

where the parameters are:

  • n: Number of observations.

  • lambda: Value of the mean, \(\lambda\), for the distribution.

Exercises

Exercise 15.1 Find the “odds” of Patricia Demauro’s accomplishment.


  1. Fauna of Australia. Vol. 1b. Australian Biological Resources Study (ABRS)↩︎

  2. See https://casino.betmgm.com/en/blog/luckiest-craps-players-in-the-world/ for more information.↩︎