Learn R Programming

TBSSurvival (version 1.3)

tbs.survreg.mle: MLE of the TBS Model for Failure Data

Description

This function performs the Maximum Likelihhod Estimation of the TBS model. The optimization is done by the function `optim' (or optionally the package Rsolnp when available).

Usage

tbs.survreg.mle(formula,dist=dist.error("all"), method=c("Nelder-Mead", "BFGS", "Rsolnp", "SANN", "CG"), verbose=FALSE,nstart=10,max.time=-1,seed=1234,gradient=FALSE)

Arguments

formula
A formula specification containing a Surv model with right-censored data as in the package survival.
dist
error distribution; dist can be given by name ("norm", "doubexp", "t", "cauchy" or "logistic") or by dist.error.
method
a vector of numerical methods to be used in the optimization. The function try all listed methods and returns all results, together with an indication of the solution with maximal likelihood among them.
verbose
Boolean to indicate the amount of output during the execution of the optimization.
nstart
Number of feasible initial points to guess when performing the optimization.
max.time
Maximum time (in minutes) to run the optimization (
seed
The number that is used to initialize the seed for random number generation.
gradient
if TRUE, MLE tries to use the implemented gradient functions (usually the numerical ones are ok).

Value

Either an element of class tbs.survreg.mle (with print, summary, and plot functions) or a list of them (depending whether the call of tbs.survreg.mle was made for a single distribution or a list of them). In case it is a list, additional fields named best and best.n give the name and the position of the best estimation in the list, respectively. Each element of tbs.survreg.mle has the following components:

Details

This function calls numerical optimization methods to maximize the likelihood of the TBS model, according to the given error distribution, method of optimization, and formula. The formula is supposed to have a Surv object and possibility co-variates, just as the standard specification of R formulas. The optimizers are going to do their best to find high likelihood estimates, but as in most estimation methods that need a numerical optimization procedure, the obtained estimate cannot be guaranteed to be a global optimal solution, but instead is dependent on the initial guessing points, and thus on the seed of the random number generation.

References

Meeker, W. and Escobar, L. (1998) Statistical Methods for Reliability Data. Willey, ISBN 0-471-14328-6.

See Also

dist.error,tbs.survreg.be,dtbs,ptbs,qtbs,rtbs.

Examples

Run this code
# Alloy - T7987: data extracted from Meeker and Escobar (1998), pp. 131.
data(alloyT7987)
alloyT7987$time <- as.double(alloyT7987$time)
alloyT7987$delta <- as.double(alloyT7987$delta)

# MLE estimation with logistic error
formula <- survival::Surv(alloyT7987$time,alloyT7987$delta == 1) ~ 1
tbs.mle <- tbs.survreg.mle(formula,dist=dist.error("logistic"),method="Nelder-Mead",nstart=3)

# Kaplan-Meier estimation
km <- survival::survfit(formula)

# Plot survival function
plot(tbs.mle)
lines(km)

# Plot hazard function
plot(tbs.mle, plot.type="hazard")

Run the code above in your browser using DataLab