comparison scripts/deprecated/hypergeometric_rnd.m @ 5691:9be68956e450

[project @ 2006-03-17 15:14:41 by jwe]
author jwe
date Fri, 17 Mar 2006 15:14:41 +0000
parents 16e6025808fe
children 93c65f2a5668
comparison
equal deleted inserted replaced
5690:161ebd1f3410 5691:9be68956e450
16 ## along with Octave; see the file COPYING. If not, write to the Free 16 ## along with Octave; see the file COPYING. If not, write to the Free
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 ## 02110-1301, USA. 18 ## 02110-1301, USA.
19 19
20 ## -*- texinfo -*- 20 ## -*- texinfo -*-
21 ## @deftypefn {Function File} {} hypergeometric_rnd (@var{n_size}, @var{m}, @var{t}, @var{n}) 21 ## @deftypefn {Function File} {} hypergeometric_rnd (@var{m}, @var{t}, @var{n}, @var{r}, @var{c})
22 ## @deftypefnx {Function File} {} hypergeometric_rnd (@var{m}, @var{t}, @var{n}, @var{r}, @var{c}) 22 ## @deftypefnx {Function File} {} hygernd (@var{m}, @var{t}, @var{n}, @var{sz})
23 ## @deftypefnx {Function File} {} hypergeometric_rnd (@var{m}, @var{t}, @var{n}, @var{sz}) 23 ## Return an @var{r} by @var{c} matrix of random samples from the
24 ## Generate a row vector containing a random sample of size @var{n_size} 24 ## hypergeometric distribution with parameters @var{m}, @var{t},
25 ## from the hypergeometric distribution with parameters @var{m}, @var{t},
26 ## and @var{n}. 25 ## and @var{n}.
27 ##
28 ## If @var{r} and @var{c} are given create a matrix with @var{r} rows and
29 ## @var{c} columns. Or if @var{sz} is a vector, create a matrix of size
30 ## @var{sz}.
31 ## 26 ##
32 ## The parameters @var{m}, @var{t}, and @var{n} must positive integers 27 ## The parameters @var{m}, @var{t}, and @var{n} must positive integers
33 ## with @var{m} and @var{n} not greater than @var{t}. 28 ## with @var{m} and @var{n} not greater than @var{t}.
34 ## @end deftypefn 29 ## @end deftypefn
35 30
36 function rnd = hypergeometric_rnd (N, m, t, n) 31 function rnd = hypergeometric_rnd (varargin)
37 32
38 switch (nargin) 33 rnd = hygernd (varargin{:});
39 case 3
40 rnd = hygernd (m, t, N);
41 case 4
42 rnd = hygernd (m, t, N, n);
43 otherwise
44 usage ("rnd = hypergeometric_rnd (N, m, t, n)");
45 endswitch
46 34
47 endfunction 35 endfunction