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: distribs
See also: cdfbin qfbin randbin pdfbin2

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, parameter of the binomial distribution
p scalar, parameter of the binomial distribution
x m x 1 vector, integer numbers (0<=x_i<=n)
Output:
ret m x 1 vector, probabilities

Example:
library("distribs")
pdfbin(3, 0.5, 0:3)

Result:
Contents of ret
[1,]    0.125
[2,]    0.375
[3,]    0.375
[4,]    0.125
Example:
library("distribs")
(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



Author: P. Cizek, W. Haerdle, 20030708 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006