So, I have a set of probabilities (z_scaled) and I'm trying to plot the PDF of the distribution as well as the CDF. Now my code is as follows:
cdf = np.cumsum(z_scaled)
pdf = np.gradient(cdf)
Now, the cdf looks like so:
And the PDF, as calculated from the CDF using the gradient function looks like so:
My question is, why is the area under the PDF as calculated from this, not equal to 1?