gridProf: Profile log-likelihood of Dirichlet-multinomial model

View source: R/dirmult.R

gridProfR Documentation

Profile log-likelihood of Dirichlet-multinomial model

Description

Computes the profile log-likelihood of l(π,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.

See Also

estProfLogLik

Examples

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")
## End(Not run)

dirmult documentation built on March 21, 2022, 5:05 p.m.

Related to gridProf in dirmult...