annotate scripts/specfun/betai.m @ 3134:8bf70ba446d0

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