Learn R Programming

incubate (version 1.3.0)

delay_model: Fit a delayed Exponential or Weibull model to one or two given sample(s).

Description

Maximum product of spacings estimation is used by default to fit the parameters. Estimation via naive maximum likelihood (method = 'MLEn) is available, too, but MLEn yields biased estimates. MLEc is a corrected version of MLE due to Cheng.

Usage

delay_model(
  x = stop("Specify observations for at least one group x=!", call. = FALSE),
  y = NULL,
  distribution = c("exponential", "weibull"),
  twoPhase = FALSE,
  bind = NULL,
  ties = c("density", "equidist", "random", "error"),
  method = c("MPSE", "MLEn", "MLEw", "MLEc"),
  profiled = method == "MLEw",
  optim_args = NULL,
  verbose = 0
)

Value

incubate_fit the delay-model fit object. Or NULL if optimization failed (e.g. too few observations).

Arguments

x

numeric. observations of 1st group. Can also be a list of data from two groups.

y

numeric. observations from 2nd group

distribution

character. Which delayed distribution is assumed? Exponential or Weibull.

twoPhase

logical. Allow for two phases?

bind

character. parameter names that are bind together in 2-group situation.

ties

character. How to handle ties.

method

character. Which method to fit the model? 'MPSE' = maximum product of spacings estimation or 'MLEn' = naive maximum likelihood estimation or 'MLEw' = weighted MLE' or MLEc' = corrected MLE

profiled

logical. Profile out scale from log-likelihood if possible.

optim_args

list. optimization arguments to use. Use NULL to use the data-dependent default values.

verbose

integer. level of verboseness. Default 0 is quiet.

Details

Numerical optimization is done by stats::optim.