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: cdfbin qfbin randbin

Quantlet: pdfbin
Description: computes the probability function of a binomial distribution B(n,p) at a grid x

Usage: ret = pdfbin (n, p, x)
Input:
n scalar
p scalar
x m x 1 vector of integer numbers (0<=x<=n)
Output:
ret m x 1 vector of probabilities

Example:

library ("stats")

pdfbin(3, 0.5, 0:3)  

Result:

Contents of ret

[1,]    0.125 

[2,]    0.375 

[3,]    0.375 

[4,]    0.125        

Example:

library ("stats")

(0:4)~pdfbin(4, 0.1, 0:4)  

Result:

Contents of _tmp

[1,]        0   0.6561 

[2,]        1   0.2916 

[3,]        2   0.0486 

[4,]        3   0.0036 

[5,]        4   0.0001 


Library: stats
See also: cdfbin qfbin randbin

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: SK, WH, 981231
(C) MD*TECH Method and Data Technologies, 21.9.2000