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 |
library("distribs") pdfbin(3, 0.5, 0:3)
Contents of ret [1,] 0.125 [2,] 0.375 [3,] 0.375 [4,] 0.125
library("distribs") (0:4)~pdfbin(4, 0.1, 0:4)
Contents of _tmp [1,] 0 0.6561 [2,] 1 0.2916 [3,] 2 0.0486 [4,] 3 0.0036 [5,] 4 0.0001