Learn R Programming

discrimARTs (version 0.1)

mix.mle: Find maximum likelihood estimate (MLE) of 5 parameters given input vector of observations, initial parameter values, and a method specifying distributions.

Description

Description goes here??

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". Describe??

Initial parameter estimation is implemented for "normal", but is only appropriate when mix.prob is close to 0.5.

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
lower
For method="facing.gamma", the lower bound?? Otherwise ignored.
upper
For method="facing.gamma", the upper bound?? 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
...
Additional arguments are passed to optim. In particular, control=list(trace=5, REPORT=1) displays information about the optimization process.

Value

  • An object of class discrimARTs, which is a list containing the original input data and parameter values, as well as output from optim.
  • neglogLikNumeric. Negative log likelihood of final optimized parameters.
  • MLE.estNamed vector containing the final optimized parameter values.

Details

Details??

References

??

See Also

mix.loglik, optim, x_gideon, o_taurus, mix.synthetic

Examples

Run this code
data(x_gideon)

## Assuming normal, estimate initial conditions from data
fit.default.gideon <- mix.mle(x_gideon$horn)

## Estimation of mixture of normals, explicitly specifying method and parameters
fit.gideon <- mix.mle(x_gideon$horn, method='normal', 
    mix.prob=0.5, dist1.par1=100, dist1.par2=10, dist2.par1=300, dist2.par2=10)

## Default printing and plotting methods
print(fit.gideon)

## Compare results
layout(1:2)
plot(fit.gideon)
plot(fit.default.gideon)

Run the code above in your browser using DataLab