R: Find maximum likelihood estimate (MLE) of 5 parameters given...
mix.mle
R Documentation
Find maximum likelihood estimate (MLE) of 5 parameters given input vector of observations, initial parameter values, and a method specifying distributions.
Description
Algorithm computes maximum likelihood estimates of the parameters of either the normal mixtuture distribution or the facing gamma distribution model for a dimorphic trait.
Vector of (numeric) trait observations. Observations should be strictly positive.
method
Either "normal" or "facing.gamma".
Initial parameter estimation is implemented for "normal", but is only appropriate when mix.prob is close to 0.5. User supplies initial parameter estimates for the facing gamma mixture distribution.
mix.prob
The initial probability of mixture distributions, specifying the proportion of the upper distribution.
dist1.par1
First parameter of the lower distribution. This specifies the mean for method="normal", and the shape for method="facing.gamma".
dist1.par2
Second parameter of the lower distribution. This specifies the standard deviation for method="normal", and the scale for method="facing.gamma".
dist2.par1
First parameter of the upper distribution, specifying parameters as in dist1.par1.
dist2.par2
Second parameter of the upper distribution, specifying parameters as in dist1.par2.
distlist
Optionally, the user can specify their own list containing a lower and upper distribution (PDF) function. Each density function must take observations and 2 positional parameters, as per dnorm. Distributions taking >2 parameters may be used, but the remaining parameters must be encapsulated as fixed values within the functions.
If distlist is specified, then method is set to "user".
lower
For method="facing.gamma", the lower bound may be set to minimum trait size minus 0.5%, 1%, or more of the range of trait sizes.
Otherwise ignored.
upper
For method="facing.gamma"; the upper bound may be set to maximum trait size plus 0.5%, 1%, or more of the range of trait sizes.
Otherwise ignored.
optim.lower, optim.upper
Numeric vector. lower and upper bounds used by optim, specifying:
c(mix.prob, dist1.par1, dist1.par2, dist2.par1, dist2.par2).
By default, mix.prob is bounded between 0 and 1, and distribution parameters are bounded from below by 0. optim calls these by position; thus order is significant and names are not needed.
...
Additional arguments are passed to optim. In particular, control=list(trace=5, REPORT=1) displays information about the optimization process.
Details
Computes maximum likelihood estimates of the parameters of either the normal mixture distribution or the facing gamma distribution model for a dimorphic trait.
Value
An object of class discrimARTs, which is a list containing the original input data and parameter values, as well as output from optim.
neglogLik
Numeric. Negative 2 x log likelihood of final optimized parameters.
MLE.est
Named vector containing the final optimized parameter values.
Note
In general, method="normal" is converges well for a range of initial values.
method="facing.gamma" requires more care.
References
Rowland JM, Qualls CR. 2005. Likelihood models for discriminating alternative phenotypes in morphologically dimorphic species. Evolutionary Ecology Research 7: 421-434.