statistics.NormalDist.pdf

Full name
statistics.NormalDist.pdf
Library
statistics
Syntax

statistics.NormalDist.pdf(x)

Description

The pdf ("Probability Density Function") method of an object of type statistics.NormalDist returns the relative probability that the random variable being considered takes a value close to the value x passed as an argument.

Mathematically, this probability is the limit of P(x ≤ X < x + dx) as dx approaches zero.

The returned result can be greater than 1 because the calculated probability is relative to other points in the distribution.

Parameters
  • x: Value with respect to which you want to calculate the relative probability.
Result

The statistics.NormalDist.pdf method returns a value of type float.

Examples

If we start from the following normal distribution:

dist = statistics.NormalDist(mu = 5, sigma = 2)

...we can obtain the relative probability that the variable takes the value 8 with the following code:

dist.pdf(x = 8)
0.06475879783294587
Submitted by admin on Sat, 04/17/2021 - 10:05