Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: stats
See also: pdfbin cdfbin qfbin

Quantlet: randbin
Description: computes random numbers based on the binomial distribution

Usage: z = randbin (n, p, len)
Input:
n scalar parameter of the binomial distribution
p scalar parameter of the binomial distribution
len scalar number of random numbers
Output:
z len x 1 vector of random numbers

Example:

; loads the library "stats"

library ("stats")

; reset random generator

randomize(0) 

randbin(1, 0.5, 10)

Result:

Contents of z

[ 1,]        0 

[ 2,]        0 

[ 3,]        0 

[ 4,]        0 

[ 5,]        0 

[ 6,]        0 

[ 7,]        0 

[ 8,]        1 

[ 9,]        1 

[10,]        0  


Library: stats
See also: pdfbin cdfbin qfbin

Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Author: Sigbert Klinke, 980827
(C) MD*TECH Method and Data Technologies, 21.9.2000