[SciPy-User] [SciPy-user] Help with (Cumulative density function) CDF

josef.pktd@gmai... josef.pktd@gmai...
Fri Oct 12 13:29:30 CDT 2012


On Thu, Oct 11, 2012 at 4:47 PM, Overtim3 <darrelaubrey@hotmail.com> wrote:
>
> So I'm having a hard time using this function
>
> cdf(x, a, b, loc=0, scale=1)    Cumulative density function.
>
> I don't fully understand where the a, b come into play
>
> I'm trying to plot this and make mine look similar to this
> http://en.wikipedia.org/w/index.php?title=File:Binomial_distribution_cdf.svg&page=1
>
> but cant seem to quite get it. Any help would be appreciated.

see
print stats.binom.__doc__

x = np.linspace(0, 40, 51)
stats.binom.cdf(x, 40, 0.5)

should be similar to the graph

or 3 in 1:
>>> cdf = stats.binom.cdf(x[:,None], [20, 20, 40], [0.5, 0.7, 0.5])
>>> cdf.shape
(51, 3)

Josef


>
>
> --
> View this message in context: http://old.nabble.com/Help-with-%28Cumulative-density-function%29-CDF-tp34544205p34544205.html
> Sent from the Scipy-User mailing list archive at Nabble.com.
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user


More information about the SciPy-User mailing list