Usage
mix.mle(input, method = "normal", mix.prob = NULL, dist1.par1 = NULL, dist1.par2 = NULL, dist2.par1 = NULL, dist2.par2 = NULL, lower = NULL, upper = NULL, distlist = NULL, optim.lower = rep(0, 5), optim.upper = c(1, rep(NA, 4)), ...)
Arguments
input
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.