[SciPy-User] Trying to understand Distributions
Keith Sloan
keith at sloan-home.co.uk
Tue Jul 13 00:45:17 EDT 2021
Thanks for all your help, but still not getting it right
ax4 = fig.add_subplot(4, 1, 4)
ag2, bg2, cg2 =stats.gamma.fit(RErange1[xfield].data)
print(ag2, bg2, cg2)
x0, x1 = stats.gamma.ppf([0.1, 0.99], ag2, loc = bg2, scale=cg2)
#x = np.linspace(stats.gamma.ppf(x0,x1), int(ag2))
x = np.linspace(stats.gamma.ppf(x0,x1), 100)
ax4.plot(x, stats.gamma.pdf(x, ag2, loc= bg2, scale = cg2),'r-', lw=5,
alpha=0.6, label='gamma pdf')
plt.show()
blank
On 13/07/2021 05:34, Robert Kern wrote:
> Sorry, please reply, but to the mailing list, not just me personally.
> The mailing list is set up so that most mail software will default to
> replying to the mailing list.
>
> Don't use `int(ag2)` for the number of steps in the linspace(). It's
> probably not a suitable value. Try 100.
>
> On Tue, Jul 13, 2021 at 12:30 AM Keith Sloan <keith at sloan-home.co.uk
> <mailto:keith at sloan-home.co.uk>> wrote:
>
> Still doing something wrong
>
> ax4 = fig.add_subplot(4, 1, 4)
> ag2, bg2, cg2 =stats.gamma.fit(RErange1[xfield].data)
> print(ag2, bg2, cg2)
> x0, x1 = stats.gamma.ppf([0.1, 0.99], ag2, loc = bg2, scale=cg2)
> x = np.linspace(stats.gamma.ppf(x0,x1, int(ag2)))
> ax4.plot(x, stats.gamma.pdf(x, ag2, loc= bg2, scale = cg2),'r-',
> lw=5, alpha=0.6, label='gamma pdf')
>
> plt.show()
>
> blank
> On 13/07/2021 05:23, Robert Kern wrote:
>> Please try to respond to these messages so that the email thread
>> remains intact. You are making a new thread with each email,
>> which makes the discussion difficult to follow. It would help me
>> refer back to what we've gone over previously.
>>
>> On Tue, Jul 13, 2021 at 12:16 AM Keith Sloan
>> <keith at sloan-home.co.uk <mailto:keith at sloan-home.co.uk>> wrote:
>>
>> Again another unsuccessful attempt trying to follow Roberts
>> advice
>>
>> Data is astronomic so loc = 0 is not okay
>>
>> Okay, then don't omit it.
>>
>> ax4 = fig.add_subplot(4, 1, 4)
>>
>> ag2, bg2, cg2 =stats.gamma.fit(RErange1[xfield].data)
>> print(ag2, bg2, cg2)
>> x0, x1 = stats.gamma.ppf([0.1, 0.99], ag2, scale=cg2)
>> x = np.linspace(stats.gamma.ppf(x0,x1, int(ag2)))
>> ax4.plot(x, stats.gamma.pdf(x, ag2, scale = cg2),'r-', lw=5,
>> alpha=0.6, label='gamma pdf')
>>
>> x0, x1 = stats.gamma.ppf([0.1, 0.99], ag2, loc=bg2, scale=cg2)
>> x = np.linspace(stats.gamma.ppf(x0,x1, int(ag2)))
>> ax4.plot(x, stats.gamma.pdf(x, ag2, loc=bg2, scale = cg2),'r-',
>> lw=5, alpha=0.6, label='gamma pdf')
>>
>> --
>> Robert Kern
>>
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User at python.org <mailto:SciPy-User at python.org>
>> https://mail.python.org/mailman/listinfo/scipy-user <https://mail.python.org/mailman/listinfo/scipy-user>
>
> --
> ========== Art & Ceramics ===========
> https://www.instagram.com/ksloan1952/ <https://www.instagram.com/ksloan1952/>
>
>
>
> --
> Robert Kern
--
========== Art & Ceramics ===========
https://www.instagram.com/ksloan1952/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/scipy-user/attachments/20210713/0e0924c9/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CA809761-78AB-4E2A-9CF5-5BEAE0D7110D_4_5005_c.jpeg
Type: image/jpeg
Size: 17518 bytes
Desc: not available
URL: <https://mail.python.org/pipermail/scipy-user/attachments/20210713/0e0924c9/attachment-0002.jpeg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1402523F-503F-45CC-AF8D-FBF4B8C9C5BC_4_5005_c.jpeg
Type: image/jpeg
Size: 18399 bytes
Desc: not available
URL: <https://mail.python.org/pipermail/scipy-user/attachments/20210713/0e0924c9/attachment-0003.jpeg>
More information about the SciPy-User
mailing list