0

I'm pretty new to Python.

Density Function:

How can I determine the cumulative distribution function? And how can I plot the density function and the cumulative distribution function?

Thanks for your help!

Matt
  • 7,255
  • 2
  • 12
  • 34
  • Assuming you are talking about normal distributions, you can find out how to plot pdf here: https://stackoverflow.com/a/10138308/503835 and also here: https://stackoverflow.com/a/9379432/503835 including the cdf. – eNc Jun 10 '20 at 11:52
  • ok cool, thanks. But how can I formulate that x is between 0 - 1 and 1-3. I tried something like this: def cdf(x): if x>=0 and x<1: return(1/2*x) elif x>=1 and x<=3: return(1/4*x) else: return(0) – Mister Data Jun 10 '20 at 12:04
  • @MisterData Not sure what you're getting at with the 0-1 and 1-3 'formulation'. If you want to calculate the probability that x will be less than or equal to some value y then you could probably just use the scipy norm function (https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.norm.htmll) – eNc Jun 10 '20 at 12:55

0 Answers0