4

I'm searching for the formula of the first derivative of a normal pdf. Is there a function in numpy or scipy to obtain it directly?

user1363251
  • 421
  • 1
  • 11
  • 24
  • possible duplicate of [How do I compute derivative using Numpy?](http://stackoverflow.com/questions/9876290/how-do-i-compute-derivative-using-numpy) – Stiffo Jul 28 '15 at 12:46
  • 3
    Not duplicate. This is a specific application of calculus with a precise answer, whereas the linked answer discusses general methodologies. – Daniel Johnson Jul 28 '15 at 18:00

1 Answers1

3

The PDF of the normal distribution is:

scipy.stats.norm.pdf(x, mu, sigma)

Its derivative with respect to x is:

scipy.stats.norm.pdf(x, mu, sigma)*(mu - x)/sigma**2
Daniel Johnson
  • 238
  • 3
  • 11