Re: Trying to understand Distributions

Keith Sloan <[email protected]> Tue, 13 Jul 2021 05:45:17 +0100
Newsgroups gmane.comp.python.scientific.user
Message-ID <[email protected]>
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 <[email protected] 
> <mailto:[email protected]>> 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
>>     <[email protected] <mailto:[email protected]>> 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
>>     [email protected]  <mailto:[email protected]>
>>     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/

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