Library: | distribs |
See also: | cdfn2 pdfn2 cdfb2 pdfb2 cdfbin2 pdfbin2 cdfchi2 pdfchi2 cdff2 pdff2 cdft2 pdft2 |
Quantlet: | pdfbin2 | |
Description: | returns the values of the density function of a binomial distribution with parameters n and p for the elements of an array x. |
Usage: | y = pdfbin2(x, n, p) | |
Input: | ||
x | k x 1 array, k>=1, input elements | |
n | scalar or k x 1 array, contains the parameter n of the binomial distribution | |
p | scalar or k x 1 array, contains the parameter p of the binomial distribution | |
Output: | ||
y | k x 1 array, contains the values of the density function of the specified binomial distribution for the elements of x |
library("distribs") a=0:20 pdfbin2(a, 20, 0.3)
Contents of y [ 1,] 0.00079792 [ 2,] 0.0068393 [ 3,] 0.027846 [ 4,] 0.071604 [ 5,] 0.13042 [ 6,] 0.17886 [ 7,] 0.19164 [ 8,] 0.16426 [ 9,] 0.1144 [10,] 0.06537 [11,] 0.030817 [12,] 0.012007 [13,] 0.0038593 [14,] 0.0010178 [15,] 0.00021811 [16,] 3.739e-05 [17,] 5.0076e-06 [18,] 5.0496e-07 [19,] 3.6069e-08 [20,] 1.6272e-09 [21,] 3.4868e-11