Continuous Probability Distribution

let’s start the series of continuous probability distribution, It’s a big topic so we will earn this in parts.

Lets learn the built-in R functions, distribution and parameters which are used in R for continuous probability distribution.

R has a wide range of built-in probability distributions, for each of which four functions are

  1. the probability density function (which has a d prefix);
  2. the cumulative probability(which has a p prefix);
  3. the quantiles of the distribution (which has a q prefix) and
  4. random numbers generated from the distribution (which has a r prefix).

If we want to calculate cumulative probability we have make p prefixed to the R function[e.g pbeta]; and for probability density, we have to make d prefixed to the R function[e.g dbinom].

Similary each R function can be prefixed which are shown in below  Table

R function  Distribution  Parameters
beta beta shape1, shape2
binom binomial sample size, probability
cauchy Cauchy location, scale
exp  exponential rate (optional)
chisq chi-squared degrees of freedom
f Fisher’s F df1, df2
gamma  gamma shape
geom geometric probability
hyper hypergeometric  m, n, k
lnorm lognormal mean, standard deviation
logis logistic location, scale
nbinom negative binomial size, probability
norm normal mean, standard deviation
pois Poisson mean
signrank Wilcoxon signed rank statistic sample size n
t  Student’s t degrees of freedom
unif uniform minimum, maximum (opt.)
weibull Weibull shape
wilcox Wilcoxon rank sum m, n

The cumulative probability function is a straightforward notion for any value of x, the probability of obtaining a sample value that is less than or equal to x.


Here is the graph, it look like S-shape


The value of x(−1) leads up to the cumulative probability (red arrow) and the probability
associated with obtaining a value of this size (−1) or smaller is on the y axis (green arrow).
The value on the y axis is 0.158 655 3:


The probability density function is the slope of this curve (its ‘derivative’). You can see at once that the slope is never negative. The slope starts out very shallow up to about x=−2, increases up to a peak (at x = 0 in this example) then gets shallower, and becomes very small indeed above about x=2.

Here is what the density function of the normal (dnorm) looks like:


Here the curve, it looks like of probability density


For a discrete random variable, like the Poisson or the binomial, the probability density
function is straightforward, it is simply a histogram with the y axis scaled as probabilities
rather than counts, and the discrete values of x (0, 1, 2, 3,…) on the horizontal axis(x).
But for a continuous random variable, the definition of the probability density function is
more subtle.

It does not have probabilities on the y axis, but rather the slope of the cumulative probability function at a given value of x.


Categories: R

Tagged as: , ,

2 replies »

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s