Exponential distribution has following probability density function which explains the curvature of a line (For simplicity I am just going to work with x>=0):
f(x) = lambda e^{-lambda*x}
to find out probability we simply take the integral w.r.t. x on range of interest, ex: x=[1,3], x is a random variable.
And taking integral along whole x-axis give us Cumulative Distribution Function, but it seems like taking integral of CDF give us PDF.
when lambda = 1
cdf = -e^{-x}
integral(-e^{-x}df) = e^{-x} = pdf
and if we keep on integrating it will just go in a loop. So my understanding right now is that area under CDF represents gradients??
can someone clarify this for me please?
Here is my code:
import math
lbda = 1
def exp_pdf(x):
return 1*math.exp(-x)
def exp_cdf(x):
return 1-math.exp(-x)
x = np.arange(0, 10, 0.1)
y = np.vectorize(exp_pdf)(x)
fig = go.Figure()
fig.add_trace(
go.Scatter(
x=x,
y=y
)
)
xx = np.arange(1,3, 0.1)
fig.add_trace(
go.Scatter(
x = xx,
y = np.vectorize(exp_pdf)(xx),
fill = 'tozeroy'
)
)
fig.update_layout(
title="PDF of Exponential distribution"
)
fig.show()