Learn R Programming

BayesGOF (version 4.0)

gMLE.bb: Beta-Binomial Parameter Estimation

Description

Computes type-II Maximum likelihood estimates \(\hat{\alpha}\) and \(\hat{\beta}\) for Beta prior \(g\sim\)Beta\((\alpha,\beta)\).

Usage

gMLE.bb(success, trials, start = NULL, optim.method = "default", 
        lower = 0, upper = Inf)

Arguments

success

Vector containing the number of successes.

trials

Vector containing the total number of trials that correspond to the successes.

start

initial parameters; default is NULL which allows function to determine MoM estimates as initial parameters.

optim.method

optimization method in optim()stats.

lower

lower bound for parameters; default is 0.

upper

upper bound for parameters; default is infinity.

Value

estimate

MLE estimate for beta parameters.

convergence

Convergence code from optim(); 0 means convergence.

loglik

Loglikelihood that corresponds with MLE estimated parameters.

initial

Initial parameters, either user-defined or determined from method of moments.

hessian

Estimated Hessian matrix at the given solution.

References

https://github.com/SupplyFrame/EmpiricalBayesR/blob/master/EmpiricalBayesEstimation.R

Examples

Run this code
# NOT RUN {
data(rat)
### MLE estimate of alpha and beta
rat.mle <- gMLE.bb(rat$y, rat$N)$estimate
rat.mle
### MoM estimate of alpha and beta
rat.mom <- gMLE.bb(rat$y, rat$N)$initial
rat.mom
# }

Run the code above in your browser using DataLab