3134
|
1 ## Copyright (C) 1998 John W. Eaton |
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
|
6 ## under the terms of the GNU General Public License as published by |
|
7 ## the Free Software Foundation; either version 2, or (at your option) |
|
8 ## any later version. |
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but |
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 ## General Public License for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
|
16 ## along with Octave; see the file COPYING. If not, write to the Free |
|
17 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA |
|
18 ## 02111-1307, USA. |
|
19 |
|
20 ## usage: beta (a, b, x) |
|
21 ## |
|
22 ## Compute the incomplete beta function |
|
23 ## |
|
24 ## betai (a, b, x) = beta(a,b)^(-1) \int_0^x t^(a-1) (1-t)^(b-1) dt |
|
25 ## |
|
26 ## The sizes of x, a, and b must agree. |
|
27 |
|
28 ## Author: jwe |
|
29 ## Created: 30 Jan 1998 |
|
30 |
|
31 function retval = betai (a, b, x) |
|
32 |
|
33 if (nargin == 3) |
|
34 retval = betainc (x, a, b); |
|
35 else |
|
36 usage ("betai (a, b, x)"); |
|
37 endif |
|
38 |
|
39 endfunction |