objFunFactory: Factory method for objective function, either according to...

View source: R/delay_estimation.R

objFunFactoryR Documentation

Factory method for objective function, either according to maximum product of spacings estimation ('MPSE') or according to some flavour of maximum likelihood estimation (e.g., naive ('MLEn') or corrected ('MLEc') or weighted ('MLEw') MLE).

Description

Given the observed data this factory method produces an objective function which is either the negative of the MPSE-criterion H or the negative log-likelihood for MLE.

Usage

objFunFactory(
  x,
  y = NULL,
  distribution = c("exponential", "weibull"),
  twoPhase = FALSE,
  bind = NULL,
  method = c("MPSE", "MLEn", "MLEc", "MLEw"),
  profiled = FALSE,
  ties = c("density", "equidist", "random", "error"),
  verbose = 0
)

Arguments

x

numeric. observations

y

numeric. observations in second group.

distribution

character(1). delayed distribution family

twoPhase

logical flag. Do we allow for two delay phases where event rate may change? Default is FALSE, i.e., a single delay phase.

bind

character. parameter names that are bind together (i.e. equated) between both groups

method

character(1). Specifies the method for which to build the objective function. Default value is MPSE. MLEn is the naive MLE-method, calculating the likelihood function as the product of density values. MLEc is the modified MLE.

profiled

logical. Should scale parameter be profiled out prior to optimization?

ties

character. How to handle ties within data of a group.

verbose

integer flag. How much verbosity in output? The higher the more output. Default value is 0 which is no output.

Details

The objective function takes a vector of model parameters as argument.

From the observations, negative or infinite values are discarded during pre-processing. In any case, the objective function is to be minimized.

Value

the objective function (e.g., the negative MPSE criterion) for given choice of model parameters or NULL upon errors


incubate documentation built on Sept. 11, 2024, 6:50 p.m.