powered by
Computes type-II Maximum likelihood estimates \(\hat{\alpha}\) and \(\hat{\beta}\) for Beta prior \(g\sim\)Beta\((\alpha,\beta)\).
gMLE.bb(success, trials, start = NULL, optim.method = "default", lower = 0, upper = Inf)
Vector containing the number of successes.
Vector containing the total number of trials that correspond to the successes.
initial parameters; default is NULL which allows function to determine MoM estimates as initial parameters.
optimization method in optim()stats.
optim()
lower bound for parameters; default is 0.
upper bound for parameters; default is infinity.
MLE estimate for beta parameters.
Convergence code from optim(); 0 means convergence.
Loglikelihood that corresponds with MLE estimated parameters.
Initial parameters, either user-defined or determined from method of moments.
Estimated Hessian matrix at the given solution.
https://github.com/SupplyFrame/EmpiricalBayesR/blob/master/EmpiricalBayesEstimation.R
# 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