Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

negLL

Likelihood without zero counts


Description

negLL computes the negative log-likelihood based on the conditional marginal distribution of the counts, N, given that N >= N*, where N* is the smallest count used for estimating the hyperparameters (DuMouchel et al. 2001). This function is minimized to estimate the hyperparameters of the prior distribution. Use this function when neither zero counts nor data squashing are being used. Generally this function is not recommended unless using a small data set since data squashing (see squashData and negLLsquash) can increase efficiency (DuMouchel et al. 2001).

Usage

negLL(theta, N, E, N_star = 1)

Arguments

theta

A numeric vector of hyperparameters ordered as: α_1, β_1, α_2, β_2, P.

N

A whole number vector of actual counts from processRaw.

E

A numeric vector of expected counts from processRaw.

N_star

A scalar whole number for the minimum count size used.

Details

The conditional marginal distribution for the counts, N, given that N >= N*, is based on a mixture of two negative binomial distributions. The hyperparameters for the prior distribution (mixture of gammas) are estimated by optimizing the likelihood equation from this conditional marginal distribution. It is recommended to use N_star = 1 when practical.

The hyperparameters are:

  • α_1, β_1: Parameters of the first component of the marginal distribution of the counts (also the prior distribution)

  • α_2, β_2: Parameters of the second component

  • P: Mixture fraction

This function will not need to be called directly if using exploreHypers or autoHyper.

Value

A scalar negative log-likelihood value

Warnings

Make sure N_star matches the smallest actual count in N before using this function. Filter N and E if needed.

Make sure the data were not squashed before using this function.

References

DuMouchel W, Pregibon D (2001). "Empirical Bayes Screening for Multi-item Associations." In Proceedings of the Seventh ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD '01, pp. 67-76. ACM, New York, NY, USA. ISBN 1-58113-391-X.

See Also

nlm, nlminb, and optim for optimization

Other negative log-likelihood functions: negLLsquash(), negLLzeroSquash(), negLLzero()


openEBGM

EBGM Disproportionality Scores for Adverse Event Data Mining

v0.8.3
GPL-2 | GPL-3
Authors
John Ihrie [cre, aut], Travis Canida [aut], Ismaïl Ahmed [ctb] (author of 'PhViD' package (derived code)), Antoine Poncet [ctb] (author of 'PhViD'), Sergio Venturini [ctb] (author of 'mederrRank' package (derived code)), Jessica Myers [ctb] (author of 'mederrRank')
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.