Description Usage Arguments Value Source References See Also Examples
Define the posterior distribution function for π ( θ | k ), with a beta prior distribution π ( θ; α, β ) and a negative binomial sampling distribution p ( k | θ ).
1 | nbinombeta(alpha = 1, beta = 1, k, r, theta = seq(0, 1, 0.001))
|
alpha |
the parameter for the beta distribution ( ≥ 0 ). |
beta |
the parameter for the beta distribution ( ≥ 0 ). |
k |
the number of failures in rth successes |
r |
the rth successes. |
theta |
the range of the probability of success. |
An object of class "g12post
" is returned.
prior |
the prior distribution, i.e. the beta(α,β) distribution. |
likelihood |
the likelihood function of k given θ, i.e. the nbinomial(r,θ) distribution. |
posterior |
the posterior distribution of θ given k, i.e. the beta(α+r, β+k) distribution. |
theta |
the range of the probability of success. |
pri.alpha |
the alpha parameter for the beta distribution of prior. |
pri.beta |
the beta parameter for the beta distribution of prior. |
pos.alpha |
the alpha parameter for the beta distribution of posterior. |
pos.beta |
the beta parameter for the beta distribution of posterior. |
model |
the prior and likelihood type to produce the posterior. |
For the theory, based on
1 | The STATG012 slides2 Example3.6 on Moodle at UCL.
|
Cook, JD. 2009. Notes on the Negative Binomial Distribution. Available from: reference link.
summary.g12post
for summararies of prior
and posterior distribution.
plot.g12post
for plots of prior and posterior
distribution.
1 2 3 4 5 | ## example : 3 failures before the 2th successes and a beta(4,6) prior.
ex <- nbinombeta(4, 6, 3, 2)
## summary and plot the above example
summary(ex)
plot(ex,lty = 2:3, col = c(5,2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.