binom {Distributacalcul} | R Documentation |
Binomial Distribution
Description
Binomial distribution with size n
and probability of
success p
.
Usage
expValBinom(size, prob)
varBinom(size, prob)
expValTruncBinom(d, size, prob, less.than.d = TRUE)
VatRBinom(kap, size, prob)
TVatRBinom(kap, size, prob)
pgfBinom(t, size, prob)
mgfBinom(t, size, prob)
Arguments
size |
Number of trials (0 or more). |
prob |
Probability of success in each trial. |
d |
cut-off value. |
less.than.d |
logical; if |
kap |
probability. |
t |
t. |
Details
The binomial distribution with probability of success p
for n
trials
has probability mass function :
Pr(X = k) = \left(\frac{n}{k}\right) p^n (1 - p)^{n - k}
for k = 0, 1, 2, \dots, n
, p \in [0, 1]
, and n > 0
Value
Function :
-
mgfBinom
gives the moment generating function (MGF). -
pgfBinom
gives the probability generating function (PGF). -
expValBinom
gives the expected value. -
varBinom
gives the variance. -
expValTruncBinom
gives the truncated mean. -
TVatRBinom
gives the Tail Value-at-Risk. -
VatRBinom
gives the Value-at-Risk.
Invalid parameter values will return an error detailing which parameter is problematic.
Note
Function VatRBinom is a wrapper of the qbinom
function from the stats package.
Examples
expValBinom(size = 3, prob = 0.5)
varBinom(size = 3, prob = 0.5)
expValTruncBinom(d = 2, size = 3, prob = 0.5)
expValTruncBinom(d = 0, size = 3, prob = 0.5, less.than.d = FALSE)
VatRBinom(kap = 0.8, size = 5, prob = 0.2)
TVatRBinom(kap = 0.8, size = 5, prob = 0.2)
pgfBinom(t = 1, size = 3, prob = 0.5)
mgfBinom(t = 1, size = 3, prob = 0.5)