Re: Trying to understand Distributions

Robert Kern <[email protected]> Wed, 14 Jul 2021 13:42:47 -0400
Newsgroups gmane.comp.python.scientific.user
Message-ID <CAF6FJisbbw7RBdNGrN0-c=PXDDRrJZ1++3HKR2_PfWnayUPBKA@mail.gmail.com>
On Wed, Jul 14, 2021 at 1:25 PM Keith Sloan <[email protected]> wrote:

> Still confused by expon.fit only returning two ( same for norm) where as
> gamma returns a value for the shape as well as loc and scale
>
The exponential and normal distributions just don't have shape parameters.

> i.e. get error with
>
> ax2 = fig.add_subplot(4, 1, 2)
> ax2.set_ylabel('Count In Cyl')
> ax2.set_xlabel(xfield)
> #ae, be, ce = stats.expon.fit(RErange1[xfield].data)
> ae, be = stats.expon.fit(RErange1[xfield].data)
>
> xe0, xe1 = stats.expon.ppf([0.01, 0.99], loc=ae, scale=be)
> xe = np.linspace(xe0,xe1,100)
> ax2.plot(xg, stats.expon.pdf(xe, loc=ae, scale=be),'r-', lw=2, alpha=0.6,
> label='gamma pdf')
> ax2.hist(RErange1[xfield].data, bins=binCount, density=True)
>
> Does not like the ax2.plot
>
Because you used ax2.plot(xg, ...) instead of ax2.plot(xe, ...)?

-- 
Robert Kern

_______________________________________________
SciPy-User mailing list
[email protected]
https://mail.python.org/mailman/listinfo/scipy-user