Last data update: 2014.03.03

R: Compute the log likelihood of input data given a parameter...
mix.loglikR Documentation

Compute the log likelihood of input data given a parameter vector and a list of 2 distribution functions.

Description

This is the main function to compute the negative 2 x log likelihood function of parameters given data.

This function is not intended to be called directly by users, but can be useful to test user-specified mixture distributions passed to mix.mle.

Usage

mix.loglik(.pars, .input, .distlist, do.sum = TRUE)

Arguments

.pars

A list of the following 5 parameters:

  • mix.prob Probability of second distribution

  • dist1.par1 Lower distribution: mean for normal, shape for gamma

  • dist1.par2 Lower distribution: SD for normal, scale for gamma

  • dist2.par1 Upper distribution: mean for normal, shape for gamma

  • dist2.par2 Upper distribution: SD for normal, scale for gamma

.input

Vector of (numeric) trait observations.

.distlist

List of 2 distribution density functions. The first is the lower or leftmost distribution; the second is the upper or rightmost.

do.sum

By default, return sum of likelihoods. Set to FALSE for testing.

Details

Computes maximum likelihood function for either the normal mixture distribution or the facing gamma distribution model for a dimorphic trait.

Value

Numeric: the negative 2 x log likelihood of trait measurement.

References

Rowland JM, Qualls CR. 2005. Likelihood models for discriminating alternative phenotypes in morphologically dimorphic species.
Evolutionary Ecology Research 7: 421-434.

See Also

mix.mle

Results