# PDF

PDF[dist,x]

gives the probability density function for the distribution dist evaluated at x.

PDF[dist,{x1,x2,}]

gives the multivariate probability density function for a distribution dist evaluated at {x1,x2,}.

PDF[dist]

gives the PDF as a pure function.

# Details • For discrete distributions, PDF is also known as a probability mass function.
• For continuous distributions, PDF[dist,x] dx gives the probability that an observed value will lie between x and x+dx for infinitesimal dx.
• For discrete distributions, PDF[dist,x] gives the probability that an observed value will be x.
• For continuous multivariate distributions, PDF[dist,{x1,x2,}]dx1 dx2 gives the probability that an observed value will lie in the box given by the limits xi and xi+dxi for infinitesimal dxi.
• For discrete multivariate distributions, PDF[dist,{x1,x2,}] gives the probability that an observed value will be {x1,x2,}.

# Examples

open allclose all

## Basic Examples(4)

The PDF of a univariate continuous distribution:

The PDF of a univariate discrete distribution:

The PDF of a multivariate continuous distribution:

The PDF for a multivariate discrete distribution:

## Scope(23)

### Parametric Distributions(5)

Obtain exact numeric results:

Obtain a machine-precision result:

Obtain a result at any precision for a continuous distribution:

Obtain a result at any precision for a discrete distribution with inexact parameters:

Multivariate distributions:

### Nonparametric Distributions(4)

PDF for non-parametric distributions:

Compare with the value for the underlying parametric distribution:

Plot the PDF for a histogram distribution:

Closed-form expression for the PDF of a kernel mixture distribution:

Plot of the PDF of a bivariate smooth kernel distribution:

### Derived Distributions(10)

Product of independent distributions:

Component mixture distribution:

Quadratic transformation of a discrete distribution:

Censored distribution:

Truncated distribution:

Parameter mixture distribution:

Copula distribution:

Formula distribution defined by its PDF:

Defined by its CDF:

Defined by its survival function:

Marginal distribution:

The PDF for QuantityDistribution assumes the argument is a Quantity with compatible units:

This allows for direct quantity substitution:

Compare with the direct use of the quantity argument:

### Random Processes(4)

Find the PDF for a SliceDistribution of a discrete-state random process:

A continuous-state random process:

Find the multiple time-slice PDF for a discrete-state process:

A multi-slice for a continuous-state process:

Find the PDF for the StationaryDistribution of a discrete-state random process:

Find the slice distribution for time :

## Applications(10)

### Visualizing PDFs(5)

Plot a continuous PDF:

Plot a discrete PDF:

Plot a continuous bivariate PDF:

Plot a discrete bivariate PDF:

Plot a family of univariate continuous PDFs:

### Computing the CDF(1)

Compute the CDF from the PDF by solving a differential equation:

### Confidence Intervals(1)

Plot a confidence interval for a standard normal distribution:

Compute boundaries of the 70% confidence interval:

### Mode of a Distribution(1)

Compute the mode of a distribution from its PDF:

### Affine Transformations(1)

Compute the PDF after an affine transformation:

### Poisson Approximation to Binomial(1)

Verify the Poisson approximation of the binomial distribution for large and small :

## Properties & Relations(9)

The integral or sum over the support of the distribution is unity:

The CDF is the integral of the PDF for continuous distributions; :

The CDF is the integral of the PDF ; :

The CDF is the sum of the PDF for discrete distributions :

The survival function is the integral of the PDF ; :

Expectation for for a continuous distribution is the PDF-weighted integral :

The expectation for for a discrete distribution is the PDF-weighted sum :

The probability of for a discrete univariate distribution is given by the PDF:

The HazardFunction of a distribution is a ratio of the PDF and the survival function:

## Possible Issues(3)

Symbolic closed forms do not exist for some distributions:

Numerical evaluation works:

Substitution of invalid values into symbolic outputs can give results that are not meaningful:

Passing it as an argument will generate correct results:

The PDF of a distribution whose measure is incompatible with the Lebesgue measure or counting measure on the integer lattice may not evaluate or may give an incorrect result:

The result of the PDF is not normalized:

The distribution measure has an atom at the origin, and hence is incompatible with the Lebesgue measure:

The incompatibility manifests itself in a jump discontinuity of the CDF at the atom location:

Mixed distributions are fully supported by Expectation, Probability, RandomVariate, etc.:

## Neat Examples(3)

PDF for a truncated binormal distribution:

Isosurfaces for a trivariate normal distribution:

Isosurfaces for PDF when varying a correlation coefficient: