Tk Library Source Code

View Ticket
Login
Ticket UUID: 1861700
Title: Submission: Beta dist and Incomplete Beta Function
Type: RFE Version: None
Submitter: erickb Created on: 2008-01-01 15:20:33
Subsystem: math Assigned To: arjenmarkus
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2013-07-04 17:25:25
Resolution: Not Applicable Here Closed By:
    Closed on:
Description:
Hi,

I've implemented the Beta distribution and also provided an implementation of the incomplete Beta function (which is the CDF for the Beta distribution).

I've tested the incomplete Beta function quite a bit (as shown), and think that it is now robust. However, I probably didn't make the most efficient implementation. An alternative would be the collection of algorithms in DCDFLIB (http://people.scs.fsu.edu/~burkardt/f_src/dcdflib/dcdflib.html), but it is quite involved -- if this implementation is sufficient, so much the better.

Eric
User Comments: arjenmarkus added on 2008-01-18 16:39:13:
Logged In: YES 
user_id=400048
Originator: NO

Incorporated this. One thing to think about:

pdf-beta a b 0.0 or 1.0 are edge cases that should give either 0 or infinity (depending on a and b).

Right now, they give 0 only.

erickb added on 2008-01-12 07:15:58:

File Deleted - 260418: 

Logged In: YES 
user_id=816411
Originator: YES

This is a better implementation for the beta distribution. First, I extended the useful range for the pdf. Second, I implemented a much faster algorithm for the incomplete beta function, using a continued fraction from Abramowitz & Stegun. (I used the GNU Scientific Library for inspiration, but ended up using a different continued fraction expansion than they used, so there's no GPL concern here. The speeds are comparable.)
File Added: beta.zip

erickb added on 2008-01-12 07:15:57:

File Added - 261872: beta.zip

erickb added on 2008-01-02 09:36:39:

File Deleted - 260416: 



File Added - 260418: beta.zip

Logged In: YES 
user_id=816411
Originator: YES

File Added: beta.zip

erickb added on 2008-01-02 08:50:02:

File Deleted - 260397: 



File Added - 260416: beta.zip

Logged In: YES 
user_id=816411
Originator: YES

File Added: beta.zip

erickb added on 2008-01-02 05:27:40:

File Deleted - 260396: 



File Added - 260397: beta.zip

Logged In: YES 
user_id=816411
Originator: YES

File Added: beta.zip

erickb added on 2008-01-02 05:15:05:

File Deleted - 260371:

erickb added on 2008-01-02 05:15:02:

File Added - 260396: beta.zip

Logged In: YES 
user_id=816411
Originator: YES

Attaching a new version. Fixes an edge case that can make the routine hang. Also introduces a short-cut in case of integer value for b.
File Added: beta.zip

erickb added on 2008-01-02 01:22:12:

File Deleted - 260370:

erickb added on 2008-01-02 01:22:11:

File Added - 260371: beta.zip

Logged In: YES 
user_id=816411
Originator: YES

File Added: beta.zip

erickb added on 2008-01-02 01:13:43:

File Deleted - 260368: 



File Added - 260370: beta.zip

Logged In: YES 
user_id=816411
Originator: YES

File Added: beta.zip

erickb added on 2008-01-02 01:01:18:

File Deleted - 260358: 



File Added - 260368: beta.zip

Logged In: YES 
user_id=816411
Originator: YES

I'm attaching a version of the incomplete beta function that is significantly faster (about 10 faster for some values) than the original version I posted.
File Added: beta.zip

erickb added on 2008-01-01 22:27:53:

File Deleted - 260356: 



File Added - 260358: beta.zip

Logged In: YES 
user_id=816411
Originator: YES

File Added: beta.zip

erickb added on 2008-01-01 22:20:33:

File Added - 260356: beta.zip

Attachments: