Description Usage Arguments Details Value Author(s) References See Also Examples
Calculates maximum likelihood estimates of the m
and
s
parameters of a beta binomial distribution. Calls upon
optim()
with the "LBFGSB"
method.
1 
x 
Integer vector of counts to which a beta binomial distribution is to be fitted. Missing values are allowed. (These are discarded before the data are analysed.) 
size 
Integer scalar specifying the upper limit of the “support”
of the beta binomial distribution under consideration. The support
is the set of integers 
par0 
Optional starting values for the iterative estimation procedure.
A vector with entries 
maxit 
Integer scalar. The maximum number of iterations to be undertaken
by 
covmat 
Logical scalar. Should the covariance matrix of the parameter
estimates be calculated? In simulation studies, in which the
covariance matrix is not of interest, calculations might be
speeded up a bit by setting 
useGinv 
Logical scalar. Should the 
This function is provided so as to give a convenient means of comparing the fit of a beta binomial distribution with that of the discretised Beta (db) distribution which is the focus of this package.
An object of class "mleBb"
which is a vector of length two.
Its first entry m
is the estimate of the (socalled) success
probability m
; its second entry s
is the estimate of the
overdispersion parameter s
. It has a number of attributes:
"size"
The value of the size
argument.
"log.like"
The (maximised) value of the log likelihood
of the data.
"covMat"
An estimate of the (2 x 2)
covariance matrix of the parameter estimates. This is formed
as the inverse of the hessian (of the negative log likelihood)
calculated by aHess()
.
ndata
The number of nonmissing values
in the data set for which the likelihood was maximised,
i.e. sum(!is.na(x))
.
Rolf Turner r.turner@auckland.ac.nz
Bruce Swihart and Jim Lindsey (2020). rmutil: Utilities for Nonlinear Regression and Repeated Measurements Models. R package version 1.1.4. https://CRAN.Rproject.org/package=rmutil
Wikipedia, https://en.wikipedia.org/wiki/Betabinomial_distribution
mleDb()
optim()
aHess()
vcov.mleBb()
hrsRcePred
visRecog
1 2 3 4 5 6 7 8 9 10 11 12 13 14  if(require(hmm.discnp)) {
X < hmm.discnp::Downloads
f < mleBb(X,15)
}
set.seed(42)
X < c(rbinom(20,10,0.3),rbinom(20,10,0.7))
f < mleBb(X,10)
g < mleDb(X,10,TRUE)
print(attr(f,"log.like"))
print(attr(g,"log.like")) # Not much difference.
dbfit5 < with(visRecog,mleDb(tot5,20,TRUE))
print(vcov(dbfit5))
# See the help for data sets "hrsRcePred" and "visRecog" for
# other examples.

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.