PDF Function

Returns a value from a probability density (mass) distribution.

Categories:Probability
CAS
Alias:PMF

Syntax

Required Arguments

distribution

is a character constant, variable, or expression that identifies the distribution. Here are valid distributions:

Distribution
Argument
Bernoulli
Bernoulli
Beta
BETA
Binomial
BINOMIAL
Cauchy
CAUCHY
Chi-Square
CHISQUARE
Conway-Maxwell-Poisson
CONMAXPOI
Exponential
EXPONENTIAL
F
F
Gamma
GAMMA
Generalized Poisson
GENPOISSON
Geometric
GEOMETRIC
Hypergeometric
HYPERGEOMETRIC
Laplace
LAPLACE
Logistic
LOGISTIC
Lognormal
LOGNORMAL
Negative binomial
NEGBINOMIAL
Normal
NORMAL|GAUSS
Normal mixture
NORMALMIX
Pareto
PARETO
Poisson
POISSON
T
T
Tweedie
TWEEDIE
Uniform
UNIFORM
Wald (inverse Gaussian)
WALD|IGAUSS
Weibull
WEIBULL
NoteExcept for T, F, and NORMALMIX, you can identify any distribution by its first four characters.

quantile

is a numeric constant, variable, or expression that specifies the value of the random variable.

Optional Argument

parameter-1, ..., parameter-k

are optional numeric constants, variables, or expressions that specify the values of shape, location, or scale parameters that are appropriate for the specific distribution.

See Details for complete information about these parameters.

Details

Bernoulli Distribution

PDF ('BERNOULLI', x, p)
Arguments

x

is a numeric constant, variable, or expression that specifies a random variable.

p

is a numeric constant, variable, or expression that specifies the probability of success.

Range0≤p≤1
Details
The PDF function for the Bernoulli distribution returns the probability density function with the probability of success equal to p. The PDF function is evaluated at the value x.
Note: There are no location or scale parameters for this distribution.

Beta Distribution

PDF ('BETA', x, a, b <, l, r>)
Arguments

x

is a numeric constant, variable, or expression that specifies a random variable.

a

is a numeric constant, variable, or expression that specifies a shape parameter.

Rangea > 0

b

is a numeric constant, variable, or expression that specifies a shape parameter.

Rangeb > 0

l

is a numeric constant, variable, or expression that specifies the left location parameter.

Default0

r

is a numeric constant, variable, or expression that specifies the right location parameter.

Default1
Ranger > l
Details
The PDF function for the beta distribution returns the probability density function with the shape parameters a and b. The PDF function is evaluated at the value x.
Note: The quantity StartFraction x minus l Over r minus l EndFraction is forced to be epsilon less-than-or-equal-to StartFraction x minus l Over r minus l EndFraction less-than-or-equal-to 1 minus 2 epsilon.

Binomial Distribution

PDF ('BINOMIAL', m, p, n)
Arguments

m

is an integer random variable that counts the number of successes.

Rangem=0, 1, ...

p

is a numeric constant, variable, or expression that specifies the probability of success.

Range0 ≤ p ≤ 1

n

is an integer parameter that counts the number of independent Bernoulli trials.

Rangen=0, 1, ...
Details
The PDF function for the binomial distribution returns the probability density function with the parameters p and n. The PDF function is evaluated at the value m.
Note: There are no location or scale parameters for the binomial distribution.

Cauchy Distribution

PDF ('CAUCHY', x <, θ, λ>)
Arguments

x

is a numeric constant, variable, or expression that specifies a random variable.

θ

is a numeric constant, variable, or expression that specifies a location parameter.

Default0

λ

is a numeric constant, variable, or expression that specifies a scale parameter.

Default1
Rangeλ > 0
Details
The PDF function for the Cauchy distribution returns the probability density function with the location parameter θ and the scale parameter λ. The PDF function is evaluated at the value x.

Chi-Square Distribution

PDF ('CHISQUARE', x, df <, nc>)
Arguments

x

is a numeric constant, variable, or expression that specifies a random variable.

df

is a numeric constant, variable, or expression that specifies the degrees of freedom.

Rangedf > 0

nc

is a numeric constant, variable, or expression that specifies an optional noncentrality parameter.

Rangenc ≥ 0
Details
The PDF function for the chi-square distribution returns the probability density function of a chi-square distribution, with df degrees of freedom and the noncentrality parameter nc. The PDF function is evaluated at the value x. This function accepts noninteger degrees of freedom. If nc is omitted or equal to zero, the value returned is from the central chi-square distribution.
In this equation, pc(.,.) denotes the density from the central chi-square distribution:
In this equation, pg(y,b) is the density from the gamma distribution:

Conway-Maxwell-Poisson Distribution

PDF('CONMAXPOI',y,λ,ν)
Arguments

y

is a numeric constant, variable, or expression that specifies a nonnegative integer representing a count.

λ

is a numeric constant, variable, or expression that specifies a location parameter, similar to the Poisson mean parameter.

ν

is a numeric constant, variable, or expression that specifies a dispersion parameter.

Details
The Conway-Maxwell-Poisson (CMP) distribution is a generalization of the Poisson distribution that enables you to model underdispersed and overdispersed data. The CMP distribution is defined according to this equation:
The normalization factor is expressed by this equation:
λ and ν are nonnegative and not simultaneously zero.
The additional parameter, ν, allows for flexibility in modeling the tail behavior of the distribution. If ν=1, the ratio is equal to the rate of decay of the Poisson distribution. If ν<1, the rate of decay decreases, which enables you to model processes that have longer tails than the Poisson distribution (overdispersed data). If ν>1, the rate of decay increases in a nonlinear manner, thus shortening the tail of the distribution (underdispersed data).
There are several special cases of the Conway-Maxwell-Poisson distribution. If λ<1 and ν→∞, the Conway-Maxwell-Poisson distribution results in the Bernoulli distribution. In this case, the data can take only the values 0 and 1, which represent an extreme underdispersion. If ν=1, the Poisson distribution is recovered with its equidispersion property. When ν=0 and λ<1, the normalization factor is convergent and forms this geometric series:
The probability density function is represented by this equation:
The geometric distribution represents a case of severe overdispersion.
Mean, Variance, and Dispersion for the Conway-Maxwell-Poisson Model
The mean and variance of the Conway-Maxwell-Poisson distribution are defined by these equations:
The Conway-Maxwell-Poisson distribution does not have closed-form expressions for its moments in terms of parameters λ and ν. However, the moments can be approximated. (For more information about the Conway-Maxwell-Poisson distribution and discrete data, see the References section that is located at the end of this function.) Use asymptotic expressions for Z to derive E(Y) and V(Y) as these equations show:
In the Conway-Maxwell-Poisson model, the summation of infinite series is evaluated using a logarithmic expansion. (For more information about the Conway-Maxwell-Poisson distribution and discrete data, see the References section that is located at the end of this function.) The mean and variance are calculated as follows for the Conway-Maxwell-Poisson model:
The dispersion is defined as follows:

Exponential Distribution

PDF ('EXPONENTIAL', x <, λ>)
Arguments

x

is a numeric constant, variable, or expression that specifies a random variable.

λ

is a numeric constant, variable, or expression that specifies a scale parameter.

Default1
Rangeλ > 0
Details
The PDF function for the exponential distribution returns the probability density function of an exponential distribution, with the scale parameter λ. The PDF function is evaluated at the value x.

F Distribution

PDF ('F', x, ndf, ddf <, nc>)
Arguments

x

is a numeric constant, variable, or expression that specifies a random variable.

ndf

is a numeric constant, variable, or expression that specifies the numerator degrees of freedom.

Rangendf> 0

ddf

is a numeric constant, variable, or expression that specifies the denominator degrees of freedom.

Rangeddf > 0

nc

is a numeric constant, variable, or expression that specifies an optional noncentrality parameter.

Rangenc ≥ 0
Details
The PDF function for the F distribution returns the probability density function of an F distribution, with ndf numerator degrees of freedom, ddf denominator degrees of freedom, and the noncentrality parameter nc. The PDF function is evaluated at the value x. This PDF function accepts noninteger degrees of freedom for ndf and ddf. If nc is omitted or equal to zero, the value returned is from a central F distribution. In the following equation, let nu 1 equals n d f, let nu 2 equals d d f, and let lamda equals n c. This equation describes the PDF function for the F distribution:
In the equation, pf(f,u1,u2) is the density from the central F distribution:
In the equation, pB(x,a,b) is the density from the standard beta distribution.
Note: There are no location or scale parameters for the F distribution.

Gamma Distribution

PDF ('GAMMA', x, a <, λ>)
Arguments

x

is a numeric constant, variable, or expression that specifies a random variable.

a

is a numeric constant, variable, or expression that specifies a shape parameter.

Rangea > 0

λ

is a numeric constant, variable, or expression that specifies a scale parameter.

Default1
Rangeλ > 0
Details
The PDF function for the gamma distribution returns the probability density function of a gamma distribution, with the shape parameter a and the scale parameter λ. The PDF function is evaluated at the value x.

Generalized Poisson Distribution

PDF ('GENPOISSON', x, θ, η)
Arguments

x

is a numeric constant, variable, or expression that specifies an integer random variable.

θ

is a numeric constant, variable, or expression that specifies a shape parameter.

Range<105 and >0

η

is a numeric constant, variable, or expression that specifies a shape parameter.

Range≥0 and <0.95
TipWhen η =0, the distribution is the Poisson distribution with a mean and variance of θ. When η>0, the mean is theta division-sign left-parenthesis 1 minus eta right-parenthesis and the variance is theta division-sign left-parenthesis 1 minus eta right-parenthesis cubed.
Details
Here is the probability mass function for the generalized Poisson distribution:

Geometric Distribution

PDF ('GEOMETRIC', m, p)
Arguments

m

is a numeric constant, variable, or expression that specifies the number of failures before the first success.

Rangem ≥ 0

p

is a numeric constant, variable, or expression that specifies a probability of success.

Range0 ≤ p ≤ 1
Details
The PDF function for the geometric distribution returns the probability density function of a geometric distribution, with the parameter p. The PDF function is evaluated at the value m.
Note: There are no location or scale parameters for this distribution.

Hypergeometric Distribution

PDF ('HYPER', x, N, R, n <, o>)
Arguments

x

is a numeric constant, variable, or expression that specifies an integer random variable.

N

is a numeric constant, variable, or expression that specifies an integer population size parameter.

RangeN=1, 2, ...

R

is a numeric constant, variable, or expression that specifies an integer number of items in the category of interest.

RangeR=0, 1, ..., N

n

is a numeric constant, variable, or expression that specifies an integer sample size parameter.

Rangen=1, 2, ..., N

o

is a numeric constant, variable, or expression that specifies an optional odds ratio parameter.

Rangeo > 0
Details
The PDF function for the hypergeometric distribution returns the probability density function of an extended hypergeometric distribution, with population size N, number of items R, sample size n, and odds ratio o. The PDF function is evaluated at the value x. If o is omitted or equal to 1, the value returned is from the usual hypergeometric distribution.

Laplace Distribution

PDF ('LAPLACE', x <, θ, λ>)
Arguments

x

is a numeric constant, variable, or expression that specifies a random variable.

θ

is a numeric constant, variable, or expression that specifies a location parameter.

Default0

λ

is a numeric constant, variable, or expression that specifies a scale parameter.

Default1
Rangeλ > 0
Details
The PDF function for the Laplace distribution returns the probability density function of the Laplace distribution, with the location parameter θ and the scale parameter λ. The PDF function is evaluated at the value x.

Logistic Distribution

PDF ('LOGISTIC', x <, θ, λ>)
Arguments

x

is a numeric constant, variable, or expression that specifies a random variable.

θ

is a numeric constant, variable, or expression that specifies a location parameter.

Default0

λ

is a numeric constant, variable, or expression that specifies a scale parameter.

Default1
Rangeλ > 0
Details
The PDF function for the logistic distribution returns the probability density function of a logistic distribution, with the location parameter θ and the scale parameter λ. The PDF function is evaluated at the value x.

Lognormal Distribution

PDF ('LOGNORMAL', x <, θ, λ>)
Arguments

x

is a numeric constant, variable, or expression that specifies a random variable.

θ

is a numeric constant, variable, or expression that specifies a log scale parameter. exp(θ) is a scale parameter.

Default0

λ

is a numeric constant, variable, or expression that specifies a shape parameter.

Default1
Rangeλ > 0
Details
The PDF function for the lognormal distribution returns the probability density function of a lognormal distribution, with the log scale parameter θ and the shape parameter λ. The PDF function is evaluated at the value x.

Negative Binomial Distribution

PDF ('NEGBINOMIAL', m, p, n)
Arguments

m

is a numeric constant, variable, or expression that specifies a positive integer random variable that counts the number of failures.

Rangem=0, 1, ...

p

is a numeric constant, variable, or expression that specifies a probability of success.

Range0 ≤ p ≤ 1

n

is a numeric constant, variable, or expression that specifies a value that counts the number of successes.

Rangen>0
Details
The PDF function for the negative binomial distribution returns the probability density function of a negative binomial distribution, with probability of success p and number of successes n. The PDF function is evaluated at the value m.
Note: There are no location or scale parameters for the negative binomial distribution.

Normal Distribution

PDF ('NORMAL', x <, θ, λ>)
Arguments

x

is a numeric constant, variable, or expression that specifies a random variable.

θ

is a numeric constant, variable, or expression that specifies a location parameter.

Default0

λ

is a numeric constant, variable, or expression that specifies a scale parameter.

Default1
Rangeλ > 0
Details
The PDF function for the normal distribution returns the probability density function of a normal distribution, with the location parameter θ and the scale parameter λ. The PDF function is evaluated at the value x.

Normal Mixture Distribution

Arguments

x

is a numeric constant, variable, or expression that specifies a random variable.

n

is a numeric constant, variable, or expression that specifies the integer number of mixtures.

Rangen=1, 2, ...

pi

is a list of numeric constants, variables, or expressions that specifies the n proportions, p 1 comma p 2 comma ellipsis comma p Subscript n Baseline, where normal upper Sigma Underscript i equals 1 Overscript i equals n Endscripts p Subscript i Baseline equals 1.

Rangep=0, 1, ...

mi

is a list of numeric constants, variables, or expressions that specifies the n means m 1 comma m 2 comma ellipsis comma m Subscript n Baseline.

si

is a list of numeric constants, variables, or expressions that specifies the n standard deviations s 1 comma s 2 comma ellipsis comma s Subscript n Baseline.

Ranges > 0
Details
The PDF function for the Normal Mixture distribution returns the probability that an observation from a mixture of normal distribution is less than or equal to x.
Weights for the Normal Mixture distribution must be nonnegative. If the sum of the weights does not equal 1, then the weights are treated as relative weights and adjusted so that the sum equals 1.
Note: There are no location or scale parameters for the Normal Mixture distribution.

Pareto Distribution

PDF ('PARETO', x, a <, k>)
Arguments

x

is a numeric constant, variable, or expression that specifies a numeric random variable.

a

is a numeric constant, variable, or expression that specifies a shape parameter.

Rangea > 0

k

is a numeric constant, variable, or expression that specifies a scale parameter.

Default1
Rangek > 0
Details
The PDF function for the Pareto distribution returns the probability density function of a Pareto distribution, with the shape parameter a and the scale parameter k. The PDF function is evaluated at the value x.

Poisson Distribution

PDF ('POISSON', n, m)
Arguments

n

is a numeric constant, variable, or expression that specifies an integer random variable.

Rangen=0, 1, ...

m

is a numeric constant, variable, or expression that specifies a mean parameter.

Rangem > 0
Details
The PDF function for the Poisson distribution returns the probability density function of a Poisson distribution, with mean m. The PDF function is evaluated at the value n.
Note: There are no location or scale parameters for the Poisson distribution.

T Distribution

PDF ('T', t, df <, nc>)
Arguments

t

is a numeric constant, variable, or expression that specifies a random variable.

df

is a numeric constant, variable, or expression that specifies the degrees of freedom.

Rangedf > 0

nc

is a numeric constant, variable, or expression that specifies an optional noncentrality parameter.

Details
The PDF function for the T distribution returns the probability density function of a T distribution, with degrees of freedom df and the noncentrality parameter nc. The PDF function is evaluated at the value x. This PDF function accepts noninteger degrees of freedom. If nc is omitted or equal to zero, the value returned is from the central T distribution. In this equation, let nu equals d f and let delta equals n c.
Note: There are no location or scale parameters for the T distribution.

Tweedie Distribution

PDF ('TWEEDIE', y, p <, µ, φ>)
Arguments

y

is a numeric constant, variable, or expression that specifies a random variable.

Rangey ≥0
NotesThis argument is required.
When y>1, y is numeric. When p=1, y is an integer.

p

is a numeric constant, variable, or expression that specifies the power parameter.

Rangep ≥1
NoteThis argument is required.

µ

is a numeric constant, variable, or expression that specifies the mean parameter.

Default1
Rangeµ >0

φ

is a numeric constant, variable, or expression that specifies the dispersion parameter.

Default1
Rangeφ>0
Details
The PDF function for the Tweedie distribution returns an exponential dispersion model with variance and mean related by the equation varianceequals phi asterisk mu Superscript p.
The following relationship applies to the preceding equation:
Note: The accuracy of computed Tweedie probabilities is highly dependent on the location in parameter space. Ten digits of accuracy are usually available except when p is near 2 or phi is near 0. In either of these cases, the accuracy might be as low as six digits.
Note: To avoid issues with numerical data, µ and Φ cannot be less than the constant SQRTMACEPS.

Uniform Distribution

PDF ('UNIFORM', x <, l, r>)
Arguments

x

is a numeric constant, variable, or expression that specifies a random variable.

l

is a numeric constant, variable, or expression that specifies the left location parameter.

Default0

r

is a numeric constant, variable, or expression that specifies the right location parameter.

Default1
Ranger > l
Details
The PDF function for the uniform distribution returns the probability density function of a uniform distribution, with the left location parameter l and the right location parameter r. The PDF function is evaluated at the value x.

Wald (Inverse Gaussian) Distribution

PDF ('WALD', x, λ <, µ>)
PDF ('IGAUSS', x, λ <, µ>)
Arguments

x

is a numeric constant, variable, or expression that specifies a random variable.

λ

is a numeric constant, variable, or expression that specifies a shape parameter.

Rangeλ > 0

µ

is a numeric constant, variable, or expression that specifies the mean parameter.

Default1
Rangeμ > 0
Details
The PDF function for the Wald distribution returns the probability density function of a Wald distribution, with the shape parameter λ, which is evaluated at the value x.

Weibull Distribution

PDF('WEIBULL', x, a <, λ>)
Arguments

x

is a numeric constant, variable, or expression that specifies a random variable.

a

is a numeric constant, variable, or expression that specifies a shape parameter.

Rangea > 0

λ

is a numeric constant, variable, or expression that specifies a scale parameter.

Default1
Rangeλ > 0
Details
The PDF function for the Weibull distribution returns the probability density function of a Weibull distribution, with the shape parameter a and the scale parameter λ. The PDF function is evaluated at the value x.

Example

The following SAS statements produce these results:
SAS Statement
Result
y=pdf('BERN', 0, .25);
0.75
y=pdf('BERN', 1, .25);
0.25
y=pdf('BETA', 0.2, 3, 4);
1.2288
y=pdf('BINOM', 4, .5, 10);
0.20508
y=pdf('CAUCHY', 2);
0.063662
y=pdf('CHISQ', 11.264, 11);
0.081686
y=pdf('CONMAXPOI', .2, 2.3, .4);
0.0097732635
y=pdf('EXPO', 1);
0.36788
y=pdf('F', 3.32, 2, 3);
0.054027
y=pdf('GAMMA', 1, 3);
0.18394
y=pdf('GENPOISSON', 9, 1, .7);
0.0150130915
y=pdf('GEOMETRIC', 5, .3);
y=0.050421
y=pdf('HYPER', 2, 200, 50, 10);
0.28685
y=pdf('LAPLACE', 1);
0.18394
y=pdf('LOGISTIC', 1);
0.19661
y=pdf('LOGNORMAL', 1);
0.39894
y=pdf('NEGB', 1, .5, 2);
0.25
y=pdf('NORMAL', 1.96);
0.058441
y=pdf('NORMALMIX',2.3, 3, .33, .33, .34, 
       .5, 1.5, 2.5, .79, 1.6, 4.3);
 
0.1166
y=pdf('PARETO', 1, 1);
1
y=pdf('POISSON', 2, 1);
0.18394
y=pdf('T', .9, 5);
0.24194
y=pdf('TWEEDIE', .8, 5);
0.7422908236
y=pdf('UNIFORM', 0.25);
1
y=pdf('WALD', 1, 2);
0.56419
y=pdf('WEIBULL', 1, 2);
0.73576

References

Shmueli, G., T. Minka,, S. Borle, and P. Boatwright. “A Useful Distribution for Fitting Discrete Data: Revival of the Conway-Maxwell-Poisson Distribution.” 2005. Applied Statistics : 54:127–142.
Last updated: March 16, 2017