betai -> betainc

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

betai -> betainc

Paul Kienzle-2

Paul Kienzle <[hidden email]>

        * statistics/distributions/beta_cdf.m: Replace betai with betainc.
        * statistics/distributions/binomial_cdf.m: Likewise.
        * statistics/distributions/f_cdf.m: Likewise.
        * statistics/distributions/t_cdf.m: Likewise.


Index: statistics/distributions/beta_cdf.m
===================================================================
RCS file: /cvs/octave/scripts/statistics/distributions/beta_cdf.m,v
retrieving revision 1.4
diff -c -r1.4 beta_cdf.m
*** statistics/distributions/beta_cdf.m 2002/05/01 06:48:35 1.4
--- statistics/distributions/beta_cdf.m 2002/08/09 19:31:01
***************
*** 57,63 ****
 
    k = find ((x > 0) & (x < 1) & (a > 0) & (b > 0));
    if (any (k))
!     cdf (k) = betai (a(k), b(k), x(k));
    endif
 
    cdf = reshape (cdf, r, c);
--- 57,63 ----
 
    k = find ((x > 0) & (x < 1) & (a > 0) & (b > 0));
    if (any (k))
!     cdf (k) = betainc (x(k), a(k), b(k));
    endif
 
    cdf = reshape (cdf, r, c);
Index: statistics/distributions/binomial_cdf.m
===================================================================
RCS file: /cvs/octave/scripts/statistics/distributions/binomial_cdf.m,v
retrieving revision 1.4
diff -c -r1.4 binomial_cdf.m
*** statistics/distributions/binomial_cdf.m 2002/05/01 06:48:35 1.4
--- statistics/distributions/binomial_cdf.m 2002/08/09 19:31:01
***************
*** 60,66 ****
     & (p >= 0) & (p <= 1));
    if (any (k))
      tmp = floor (x(k));
!     cdf(k) = 1 - betai (tmp + 1, n(k) - tmp, p(k));
    endif
 
    cdf = reshape (cdf, r, c);
--- 60,66 ----
     & (p >= 0) & (p <= 1));
    if (any (k))
      tmp = floor (x(k));
!     cdf(k) = 1 - betainc (p(k), tmp + 1, n(k) - tmp);
    endif
 
    cdf = reshape (cdf, r, c);
Index: statistics/distributions/f_cdf.m
===================================================================
RCS file: /cvs/octave/scripts/statistics/distributions/f_cdf.m,v
retrieving revision 1.5
diff -c -r1.5 f_cdf.m
*** statistics/distributions/f_cdf.m 2002/05/01 06:48:35 1.5
--- statistics/distributions/f_cdf.m 2002/08/09 19:31:01
***************
*** 57,63 ****
 
    k = find ((x > 0) & (x < Inf) & (m > 0) & (n > 0));
    if (any (k))
!     cdf(k) = 1 - betai (n(k) / 2, m(k) / 2, 1 ./ (1 + m(k) .* x(k) ./ n(k)));
    endif
 
    cdf = reshape (cdf, r, c);
--- 57,63 ----
 
    k = find ((x > 0) & (x < Inf) & (m > 0) & (n > 0));
    if (any (k))
!     cdf(k) = 1 - betainc (1 ./ (1 + m(k) .* x(k) ./ n(k)), n(k) / 2, m(k) / 2);
    endif
 
    cdf = reshape (cdf, r, c);
Index: statistics/distributions/t_cdf.m
===================================================================
RCS file: /cvs/octave/scripts/statistics/distributions/t_cdf.m,v
retrieving revision 1.5
diff -c -r1.5 t_cdf.m
*** statistics/distributions/t_cdf.m 2002/05/01 06:48:36 1.5
--- statistics/distributions/t_cdf.m 2002/08/09 19:31:01
***************
*** 56,62 ****
 
    k = find ((x > -Inf) & (x < Inf) & (n > 0));
    if (any (k))
!     cdf(k) = betai (n(k) / 2, 1 / 2, 1 ./ (1 + x(k) .^ 2 ./ n(k))) / 2;
      ind = find (x(k) > 0);
      if (any (ind))
        cdf(k(ind)) = 1 - cdf(k(ind));
--- 56,62 ----
 
    k = find ((x > -Inf) & (x < Inf) & (n > 0));
    if (any (k))
!     cdf(k) = betainc (1 ./ (1 + x(k) .^ 2 ./ n(k)), n(k) / 2, 1 / 2) / 2;
      ind = find (x(k) > 0);
      if (any (ind))
        cdf(k(ind)) = 1 - cdf(k(ind));


Reply | Threaded
Open this post in threaded view
|

betai -> betainc

John W. Eaton-6
On  9-Aug-2002, Paul Kienzle <[hidden email]> wrote:

| Paul Kienzle <[hidden email]>
|
| * statistics/distributions/beta_cdf.m: Replace betai with betainc.
| * statistics/distributions/binomial_cdf.m: Likewise.
| * statistics/distributions/f_cdf.m: Likewise.
| * statistics/distributions/t_cdf.m: Likewise.

I applied this patch.

Thanks,

jwe