Berechnung der Ableitung der kumulativen Dichtefunktion in Python

Ist die genaue Ableitung einer kumulativen Dichtefunktion die Wahrscheinlichkeitsdichtefunktion (PDF)? Ich berechne die Ableitung mit demnumpy.diff(), ist das richtig? Siehe untenstehenden Code:

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

wei = s.weibull_min(2, 0, 2) # shape, loc, scale - creates weibull object
sample = wei.rvs(1000)
shape, loc, scale = s.weibull_min.fit(sample, floc=0) 

x = np.linspace(np.min(sample), np.max(sample))

plt.hist(sample, normed=True, fc="none", ec="grey", label="frequency")
plt.plot(x, wei.cdf(x), label="cdf")
plt.plot(x, wei.pdf(x), label="pdf")
plt.plot(x[1:], np.diff(wei.cdf(x)), label="derivative")
plt.legend(loc=1)
plt.show()

Wenn ja, wie skaliere ich die Ableitung so, dass sie der PDF-Datei entspricht?

Antworten auf die Frage(1)

Ihre Antwort auf die Frage