0
stats.norm(0, 0.1).pdf(0) -> 3.9894

enter image description here

import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
import math

mu = 0
variance = 1
sigma = math.sqrt(variance)
x = np.linspace(mu - 3*sigma, mu + 3*sigma, 100)
plt.plot(x, stats.norm.pdf(x, mu, sigma))

mu = 0
variance = (0.5*0.5) / np.sqrt(100)
sigma = math.sqrt(variance)
x = np.linspace(mu - 3*sigma, mu + 3*sigma, 100)
plt.plot(x, stats.norm.pdf(x, mu, sigma))

plt.show()
Oleg Dats
  • 3,933
  • 9
  • 38
  • 61
  • solution to find probability: scipy.stats.norm(mu, sigma).cdf(Point1) - scipy.stats.norm(mu, sigma).cdf(Point2) – Oleg Dats Sep 28 '20 at 10:25
  • Future readers of your proposed "solution" should know that this computes the *cumulative* probability up to the given point, i.e. the probability that the underlying random variable takes any value *less than* the given point. That's not "the probability". – gspr Sep 28 '20 at 10:27
  • I was expecting that my 'solution' gives the probability between 2 points (integral). For example, it can answer the question: what is prob to get a point between 0 and 1. Am I right? – Oleg Dats Sep 28 '20 at 10:36
  • 1
    Ah, my bad, I did not see your minus sign. Yes, you are correct. – gspr Sep 28 '20 at 10:46

1 Answers1

1

A probability density function's pointwise value is not a probability, so there is no reason to expect its value to be less than 1.

Probabilities are expressed by appropriate integrals of PDFs. For example, a function that takes the value 10 between 0 and 1/10, and the value 0 everywhere else, is a valid PDF. Its value at 1/20 is 10>1, but its integral over any interval [a,b] is ≤1. It is this integral that expresses a probability, namely that the probability of the underlying random variable taking a value between a and b.

gspr
  • 11,144
  • 3
  • 41
  • 74