Learn R Programming

dirmult (version 0.1.3-5)

estProfLogLik: Profile log-likelihood of Dirichlet-multinomial model

Description

Computes the profile log-likelihood of \(\ell(\pi,\theta;x)\) for a given value of \(\theta\), i.e. \(\hat{\ell}(\theta)=\max_{\pi}\ell(\pi,\theta;x)\).

Usage

estProfLogLik(data, theta, epsilon=10^(-4), trace=TRUE, initPi, maxit=1000)

Arguments

data

A matrix or table with counts. Rows represent subpopulations and columns the different categories of the data. Zero rows or columns are automaticly removed.

theta

The theta-value of which the profile log-likelihood is to be computed.

epsilon

Tolerance used in the iterations. Succeeding log-likelihood values need to be within epsilon for convergence.

trace

Logical. Whether parameter estimates and log-likelihood values should be printed to the screen while iterating.

initPi

Initial pi vector.

maxit

Maximum number of iterations. Default is 1000 and will often not be envoked, but if theta is to extreme compared to the MLE of theta the log-likelihood may misbehave near theta.

Value

Gives a list of components (similar to output from dirmult where loglik and lambda (the Lagrange multiplier) are the most interesting.

See Also

dirmult

Examples

Run this code
# NOT RUN {
data(us)
fit <- dirmult(us[[1]],epsilon=10^(-12),trace=FALSE)
estProfLogLik(us[[1]],fit$theta*1.2,epsilon=10^(-12),trace=FALSE)
# }

Run the code above in your browser using DataLab