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 all close allBasic Examples (4)
The PDF of a univariate continuous distribution:
PDF[NormalDistribution[0, 1], x]Plot[%, {x, -5, 5}, Filling -> Axis]The PDF of a univariate discrete distribution:
PDF[HypergeometricDistribution[20, 50, 100], k]DiscretePlot[%, {k, 0, 20}, ExtentSize -> 0.5]The PDF of a multivariate continuous distribution:
PDF[BinormalDistribution[1 / 3], {x, y}]Plot3D[%, {x, -3, 3}, {y, -3, 3}]The PDF for a multivariate discrete distribution:
PDF[MultivariatePoissonDistribution[1, {2, 3}], {x, y}]DiscretePlot3D[%, {x, 0, 10}, {y, 0, 10}, ExtentSize -> 0.5]Scope (25)
Parametric Distributions (7)
PDF[WeibullDistribution[2, 5], 4]PDF[NegativeBinomialDistribution[20, 1 / 3], 5]Obtain a machine-precision result:
PDF[WeibullDistribution[2, 5], 4.]Obtain a result at any precision for a continuous distribution:
PDF[WeibullDistribution[2, 5], N[4, 25]]Obtain a result at any precision for a discrete distribution with inexact parameters:
PDF[NegativeBinomialDistribution[20, N[1 / 3, 30]], 5]Obtain a symbolic expression for the PDF:
PDF[ChiSquareDistribution[ν], x]PDF[UniformDistribution[{{a, b}, {c, d}}], {x, y}]PDF[GammaDistribution[1, 2]]%[3]PDF threads element-wise over lists:
PDF[NormalDistribution[], {0.0, 0.2, 0.3}]PDF[BinormalDistribution[1 / 2], {{0.0, 0.0}, {0.2, 0.2}, {0.3, 0.3}}]Nonparametric Distributions (4)
PDF for non-parametric distributions:
r = RandomVariate[NormalDistribution[], 10 ^ 4];PDF[HistogramDistribution[r], 0.2]PDF[SmoothKernelDistribution[r], 0.2]Compare with the value for the underlying parametric distribution:
PDF[NormalDistribution[], 0.2]Plot the PDF for a histogram distribution:
Plot[PDF[HistogramDistribution[RandomVariate[NormalDistribution[], 10 ^ 3]], x]//Evaluate, {x, -3, 3}, Filling -> Axis]Closed-form expression for the PDF of a kernel mixture distribution:
PDF[KernelMixtureDistribution[RandomVariate[GammaDistribution[1, 2], 10
]], x]Plot of the PDF of a bivariate smooth kernel distribution:
Plot3D[PDF[SmoothKernelDistribution[RandomVariate[BinormalDistribution[1 / 3], 30]], {x, y}]//Evaluate, {x, -3, 3}, {y, -3, 3}, PlotRange -> {0, 0.4}]Derived Distributions (10)
Product of independent distributions:
pdf = PDF[ProductDistribution[TriangularDistribution[{2, 4}], TriangularDistribution[{1, 7}]], {x, y}]Plot3D[pdf, {x, 1, 5}, {y, 0, 8}, PlotRange -> All]Component mixture distribution:
pdf = PDF[MixtureDistribution[{1, 4}, {NormalDistribution[a, b], NormalDistribution[c, d]}], x]Plot[pdf /. {a -> 0, b -> 1, c -> 6, d -> 3 / 2}, {x, -2, 10}, Filling -> Axis]Quadratic transformation of a discrete distribution:
PDF[TransformedDistribution[x ^ 2, xPoissonDistribution[2]], y]DiscretePlot[%, {y, 0, 50}, PlotRange -> {0, 0.3}]PDF[CensoredDistribution[{-2, 4}, CauchyDistribution[0, 1]], x]Integrate[%, {x, -Infinity, Infinity}]PDF[TruncatedDistribution[{2, 3}, TriangularDistribution[{1, 4}]], x]Plot[{PDF[TriangularDistribution[{1, 4}], x], %}, {x, 1, 5}, Filling -> Axis]Parameter mixture distribution:
PDF[ParameterMixtureDistribution[PoissonDistribution[μ], μUniformDistribution[{2, 3}]], x]PDF[CopulaDistribution[{"Frank", 3}, {ExponentialDistribution[2], ExponentialDistribution[5]}], {x, y}]NIntegrate[%, {x, -Infinity, Infinity}, {y, -Infinity, Infinity}]Formula distribution defined by its PDF:
PDF[ProbabilityDistribution[(Sqrt[2] / Pi)(1 / (1 + x ^ 4)), {x, -Infinity, Infinity}], x]PDF[ProbabilityDistribution[{"CDF", Piecewise[{{-2 + x, 2 ≤ x ≤ 3}, {1, x > 3}}, 0]}, {x, -Infinity, Infinity}], x]Defined by its survival function:
PDF[ProbabilityDistribution[{"SF", Piecewise[{{1 - 2(-2 + x) ^ 2, 2 ≤ x ≤ 5 / 2}, {2(3 - x) ^ 2, 5 / 2 < x ≤ 3}, {1, x < 2}}, 0]}, {x, -Infinity, Infinity}], x]PDF[MarginalDistribution[
ProbabilityDistribution[1 / (E ^ (y ^ 2 / 2)(Pi ^ (3 / 2)(1 + x ^ 4))),
{x, -Infinity, Infinity}, {y, -Infinity, Infinity}], 2], y]The PDF for QuantityDistribution assumes the argument is a Quantity with compatible units:
𝒟 = NormalDistribution[Quantity[4, "Meters"], Quantity[1 / 2, "Meters"]]PDF[𝒟, x]This allows for direct quantity substitution:
% /. x -> Quantity[387., "Centimeters"]Compare with the direct use of the quantity argument:
PDF[𝒟, Quantity[387., "Centimeters"]]Random Processes (4)
Find the PDF for a SliceDistribution of a discrete-state random process:
PDF[PoissonProcess[μ][2], x]DiscretePlot[Evaluate[% /. μ -> 2], {x, 0, 15}, ExtentSize -> 0.5]A continuous-state random process:
PDF[WienerProcess[][2], x]Plot[%, {x, -3, 3}, Filling -> Axis]Find the multiple time-slice PDF for a discrete-state process:
PDF[PoissonProcess[μ][{2, 3}], {x, y}]DiscretePlot3D[Evaluate[% /. μ -> 2], {x, 0, 10}, {y, 0, 10}, ExtentSize -> 0.5]A multi-slice for a continuous-state process:
PDF[WienerProcess[][{2, 3}], {x, y}]Plot3D[%, {x, -3, 3}, {y, -3, 3}]Find the PDF for the StationaryDistribution of a discrete-state random process:
PDF[StationaryDistribution[QueueingProcess[λ, μ, 2]], x]//FullSimplifyDiscretePlot[Evaluate[% /. {μ -> 3, λ -> 2.9}], {x, 0, 10}, ExtentSize -> 0.5]Find the slice distribution for time
:
PDF[WienerProcess[1, 1][t], x]Plot3D[%, {x, -3, 8}, {t, 1, 5}, AxesLabel -> Automatic, PlotRange -> All]Applications (10)
Visualizing PDFs (5)
Plot[PDF[NormalDistribution[0, 1], x], {x, -3, 3}]DiscretePlot[PDF[PoissonDistribution[10], x], {x, 0, 30}]Plot a continuous bivariate PDF:
Plot3D[PDF[DirichletDistribution[{3, 2, 5}], {x, y}], {x, 0, 1}, {y, 0, 1}, AxesLabel -> Automatic, PlotRange -> All, Exclusions -> None]Plot a discrete bivariate PDF:
DiscretePlot3D[PDF[MultivariatePoissonDistribution[1, {2, 3}], {x, y}], {x, 0, 10}, {y, 0, 10}, PlotRange -> All]DiscretePlot3D[PDF[MultivariatePoissonDistribution[1, {2, 3}], {x, y}], {x, 0, 10}, {y, 0, 10}, PlotRange -> All, ExtentSize -> Full, PlotStyle -> Lighter[Blue, 0.5]]Plot a family of univariate continuous PDFs:
Plot3D[PDF[NormalDistribution[0, σ], x], {σ, 1 / 2, 2}, {x, -3, 3}, AxesLabel -> Automatic]Computing the CDF (1)
Confidence Intervals (1)
Plot a confidence interval for a standard normal distribution:
pdf = PDF[NormalDistribution[], x]Compute boundaries of the 70% confidence interval:
{xl, xr} = Function[α, Quantile[NormalDistribution[], {(1 - α/2.0), (1 + α/2.0)}]][Quantity[70, "Percent"]]Show[Plot[pdf, {x, -1.7, 1.7}, Filling -> Axis, AxesOrigin -> {0, 0}, RegionFunction -> (Not[xl < # < xr]&)], Plot[pdf, {x, xl, xr}], PlotRange -> {0, 0.4}, Ticks -> {Automatic, None}]Mode of a Distribution (1)
Affine Transformations (1)
Poisson Approximation to Binomial (1)
Verify the Poisson approximation of the binomial distribution for large
and small
:
n = 10000;p = 0.0002;pdf1 = PDF[PoissonDistribution[n p], x]pdf2 = PDF[BinomialDistribution[n, p], x]Table[pdf1, {x, 0, 5}]Table[pdf2, {x, 0, 5}]Properties & Relations (9)
The integral or sum over the support of the distribution is unity:
Integrate[PDF[GammaDistribution[α, β], x], {x, 0, Infinity}, Assumptions -> α > 0 && β > 0]Sum[PDF[GeometricDistribution[p], k], {k, 0, Infinity}]The CDF
is the integral of the PDF
for continuous distributions;
:
Integrate[PDF[ExponentialDistribution[λ], ξ], {ξ, -∞, x}, Assumptions -> x∈Reals && λ > 0]CDF[ExponentialDistribution[λ], x]FullSimplify[%% - %, λ > 0]The CDF
is the integral of the PDF
;
:
𝒟 = DirichletDistribution[{1, 2, 3}];int = Integrate[PDF[𝒟, {ξ, ψ}], {ξ, -∞, x}, {ψ, -∞, y}, Assumptions -> {x, y}∈Reals];cdf = CDF[𝒟, {x, y}];FullSimplify[int - cdf, {x, y}∈Reals]The CDF
is the sum of the PDF
for discrete distributions
:
Sum[PDF[GeometricDistribution[p], m], {m, -∞, Floor[n]}]//FullSimplifyCDF[GeometricDistribution[p], n]FullSimplify[% - %%, Im[n] == 0]The survival function
is the integral of the PDF
;
:
Integrate[PDF[ExponentialDistribution[λ], ξ], {ξ, x, ∞}, Assumptions -> x∈Reals && λ > 0]SurvivalFunction[ExponentialDistribution[λ], x]FullSimplify[%% - %, λ > 0]Expectation for
for a continuous distribution is the PDF-weighted integral
:
𝒟 = ChiSquareDistribution[ν];Simplify[Subsuperscript[∫, 0, ∞]x^2 PDF[𝒟, x]ⅆx, ν > 0]Expectation[x^2, x𝒟]The expectation for
for a discrete distribution is the PDF-weighted sum
:
𝒟 = PoissonDistribution[μ];Subsuperscript[∑, ξ = 0, ∞]ξ^2PDF[𝒟, ξ]Expectation[ξ ^ 2, ξ𝒟]The probability of
for a discrete univariate distribution is given by the PDF:
Probability[x == 5, xPoissonDistribution[m]]PDF[PoissonDistribution[m], 5]The HazardFunction of a distribution is a ratio of the PDF and the survival function:
HazardFunction[NormalDistribution[], x]PDF[NormalDistribution[], x] / SurvivalFunction[NormalDistribution[], x]Possible Issues (3)
Symbolic closed forms do not exist for some distributions:
PDF[StableDistribution[0, 1.8, -0.5, 1, 2], x]PDF[StableDistribution[0, 1.8, -0.5, 1, 2], 0.3]Substitution of invalid values into symbolic outputs can give results that are not meaningful:
PDF[CauchyDistribution[2, 3], x] /. {x -> I}Passing it as an argument will generate correct results:
PDF[CauchyDistribution[2, 3], I]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:
𝒟 = TransformedDistribution[x y, {xUniformDistribution[{0, 1}], yDiscreteUniformDistribution[{0, 1}]}];The result of the PDF is not normalized:
PDF[𝒟, x]The distribution measure has an atom at the origin, and hence is incompatible with the Lebesgue measure:
Probability[x == 0, x𝒟]The incompatibility manifests itself in a jump discontinuity of the CDF at the atom location:
cdf = CDF[𝒟, x]Plot[cdf, {x, -0.1, 1}, ExclusionsStyle -> {Directive[Thick, Red], Directive[PointSize[Large], Red]}, Filling -> Axis]Mixed distributions are fully supported by Expectation, Probability, RandomVariate, etc.:
Expectation[Log[1 + x], x𝒟]Log[1 + RandomVariate[𝒟, 10 ^ 5]]//MeanNeat Examples (3)
PDF for a truncated binormal distribution:
𝒟 = TruncatedDistribution[{{-∞, 1 / 2}, {-∞, ∞}}, BinormalDistribution[1 / 7]];Plot3D[{PDF[𝒟 , {x, y}], PDF[BinormalDistribution[(1/7)], {x, y}]}//Evaluate, {x, -3, 3}, {y, -3, 3}, PlotRange -> All, PlotPoints -> 35]Isosurfaces for a trivariate normal distribution:
Σ = With[{σ1 = 1, σ2 = 2, σ3 = 1, ρ23 = 0, ρ13 = 0}, {{σ1 ^ 2, σ1 σ2 ρ12, σ1 σ3 ρ13}, {σ1 σ2 ρ12, σ2 ^ 2, σ2 σ3 ρ23}, {σ1 σ3 ρ13, σ2 σ3 ρ23, σ3 ^ 2}}];
μ = {0., 0, 0};Block[{ρ12 = 1 / 2}, ContourPlot3D[PDF[MultinormalDistribution[μ, Σ], {x, y, z}]//Evaluate, {x, -3, 3}, {y, -3, 3}, {z, -3, 3}, Mesh -> None, Contours -> 4, ContourStyle -> {Red, Yellow, Green, Blue}, RegionFunction -> Function[{x, y, z}, x < 0 || y > 0], PlotLabel -> ρ12, PlotRange -> Full]]Isosurfaces for PDF when varying a correlation coefficient:
Σ = With[{σ1 = 1, σ2 = 2, σ3 = 1, ρ23 = 0, ρ13 = 0}, {{σ1 ^ 2, σ1 σ2 ρ12, σ1 σ3 ρ13}, {σ1 σ2 ρ12, σ2 ^ 2, σ2 σ3 ρ23}, {σ1 σ3 ρ13, σ2 σ3 ρ23, σ3 ^ 2}}];
μ = {0., 0, 0};
DistributeDefinitions[μ, Σ];ParallelTable[
ContourPlot3D[PDF[MultinormalDistribution[μ, Σ], {x, y, z}]//Evaluate, {x, -3, 3}, {y, -3, 3}, {z, -3, 3}, Mesh -> None, Contours -> {0.01}, PlotLabel -> ρ12, PlotRange -> Full], {ρ12, {-0.95, -0.75, -0.5, -0.25, 0, 0.25, 0.5, 0.75, 0.95}}]Tech Notes
Related Guides
Text
Wolfram Research (2007), PDF, Wolfram Language function, https://reference.wolfram.com/language/ref/PDF.html (updated 2010).
CMS
Wolfram Language. 2007. "PDF." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2010. https://reference.wolfram.com/language/ref/PDF.html.
APA
Wolfram Language. (2007). PDF. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PDF.html
BibTeX
@misc{reference.wolfram_2026_pdf, author="Wolfram Research", title="{PDF}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/PDF.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_pdf, organization={Wolfram Research}, title={PDF}, year={2010}, url={https://reference.wolfram.com/language/ref/PDF.html}, note=[Accessed: 12-June-2026]}