MCPcopy Index your code
hub / github.com/python/cpython / pdf

Method pdf

Lib/statistics.py:1258–1264  ·  view source on GitHub ↗

Probability density function. P(x <= X < x+dx) / dx

(self, x)

Source from the content-addressed store, hash-verified

1256 return [inv_cdf(rnd(), mu, sigma) for _ in repeat(None, n)]
1257
1258 def pdf(self, x):
1259 "Probability density function. P(x <= X < x+dx) / dx"
1260 variance = self._sigma * self._sigma
1261 if not variance:
1262 raise StatisticsError('pdf() not defined when sigma is zero')
1263 diff = x - self._mu
1264 return exp(diff * diff / (-2.0 * variance)) / sqrt(tau * variance)
1265
1266 def cdf(self, x):
1267 "Cumulative distribution function. P(X <= x)"

Callers 1

test_pdfMethod · 0.95

Calls 1

StatisticsErrorClass · 0.85

Tested by 1

test_pdfMethod · 0.76