Post Reply 
[WP34s] Regularized incomplete Beta function
05-11-2014, 01:50 PM (This post was last modified: 05-11-2014 02:15 PM by Dieter.)
Post: #45
RE: [WP34s] Regularized incomplete Beta function
(05-05-2014 08:26 AM)Paul Dale Wrote:  After a bit of debugging, the new Student-T quantile function code appears to be working on both the 34S and the 31S. The next builds will get this Smile

I see it is now in t.wp34s. Just two remarks:

1. Catching the case p=1/2 at the beginning is not neccessary. The estimate will be exactly zero, and this is what will be returned directly after the first iteration, i.e. almost immediately.

2. This is part of the iteration loop:

Code:

qf_q_Ix::   DROP
            x[^2]        // x^2 x x x
            ENTER[^]
            RCL+ J        // n+x^2 x^2 x x
            /
            Num 1/2
            RCL[times] J    // n/2 x^2/(n+x^2) x x
            Num 1/2
            [<->] ZXYX    // x^2/(n+x^2) 1/2 n/2 1/2
            I[sub-x]    // Ix 1/2 x x
            [times]
            +/-
            Num 1/2
            RCL- .00
            +        // cdf(t) - p = (0,5-p) - 1/2 IBeta(x=t^2/(n+t^2), a=1/2, b=n/2)

The stack shuffling command obviously was added because the incomplete Beta function now accepts the three parameters in a different order than before. After this, right before the call to the Beta function, the T-register holds 1/2. After that call, the comment says that both Z and T hold the current estimate x – which was completely lost before the call (was neither in X nor Y nor Z nor T). ?!?

I would say this should work better:

Code:

qf_q_Ix::   DROP
            Num 1/2        // 1/2   x    x    x
            ENTER[^]
            RCL[times] J   // n/2  1/2   x    x
            RCL T
            x[^2]          // x²   n/2  1/2   x
            RCL+ J         // x²+n n/2  1/2   x    (and x² in L)
            STO/ L
            X[<->] L       // x²/(x²+n)  n/2  1/2   x
            I[sub-x]       // Ix  x  x  x
            Num 1/2
            [times]
            +/-
            Num 1/2
            RCL- .00
            +

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [WP34s] Regularized incomplete Beta function - Dieter - 05-11-2014 01:50 PM



User(s) browsing this thread: 1 Guest(s)