gridProf: Profile log-likelihood of Dirichlet-multinomial model
Description
Computes the profile log-likelihood of \(\ell(\pi,\theta;x)\)
for a given sequence of \(\theta\) by calling
estProfLogLik.
Usage
gridProf(data, theta, from, to, len)
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
A theta-value used as offset for the interval: [theta+from; theta+to].
from
Left endpoint in the interval: [theta+from; theta+to].
to
Right endpoint in the interval: [theta+from; theta+to].
len
Number of points in the [from; to] interval. Similar to the
len argument in seq.
Value
Gives a data frame with theta values and associated profile
log-likelihood values.
# NOT RUN {data(us)
fit <- dirmult(us[[1]],epsilon=10^(-12),trace=FALSE)
# }# NOT RUN {grid <- gridProf(us[[1]],fit$theta,from=-0.001,to=0.001,len=10)
plot(loglik ~ theta, data=grid, type="l")
# }