Trying to tabulate the pmf and cdf of a negative binomial distribution. I have a probability of 0.75
, and an success of 2
, where the number of trials starts at 2 (x = 2, 3, ...
).
I am using r (the language) to calculate and I'm aware that the definitions of the negative binomial are different from my x, but is it a case of starting the vector from 2 to make the distributions match or is there something more complicated? Is the code below going to ensure the distributions passed into the dnbinom
and pnbinom
functions match up with x
?
df <- data.frame(X = 2:20,
pmf = dnbinom(x = 2:20, size, prob),
cdf = pnbinom(q = 2:20, size, prob, lower.tail = TRUE))
The PMF that is outputted from this is:
x 2.000 3.000 4.000 5.000 6.000 7
pmf 0.105 0.035 0.011 0.003 0.001 0