| Title: | Random Number Generation and Inferences for Two-Stage Life-Testing Data |
|---|---|
| Description: | Provides random number generation, estimation, and hypothesis testing for two-stage life-testing experiments in which units begin on a baseline stress and, at a fixed or random change point, some or all surviving units move to an elevated stress ("stage life testing"), following the cumulative-exposure model of Laumen and Cramer (2019), "Stage life testing", <doi:10.1002/nav.21874>. Twelve baseline lifetime distributions are supplied (Weibull, Power Lindley, Exponentiated Lindley, Exponentiated Exponential, Marshall-Olkin Exponential, Lomax, Exponentiated Teissier, Log-Logistic, Chen, Log-normal, Gamma, and Power Muth/Power Teissier) together with three parameter-sharing cases (common, shape1, shape11). The package implements data simulation under both the fixed-proportion (typeP) and fixed-count (typeM) rules and the simple-step-stress special case, maximum likelihood estimation using a hybrid Nelder-Mead and BFGS optimisation routine, asymptotic (Wald) and non-parametric/parametric bootstrap confidence intervals (including log-scale variants that guarantee a positive interval), a stage-1-observation planning probability, Kolmogorov-Smirnov goodness-of-fit testing with a parametric-bootstrap correction for estimated parameters, likelihood-ratio and information criteria for nested/non-nested model comparison, and diagnostic plots comparing fitted and empirical distributions, including the cumulative distribution function (CDF), survival function, probability-probability (P-P), and quantile-quantile (Q-Q) plots. |
| Authors: | Vikas Kumar Sharma [aut, cre] |
| Maintainer: | Vikas Kumar Sharma <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-11-03 18:39:23 UTC |
| Source: | https://github.com/cran/stagelife |
Extract coefficients from a fitted two-stage life testing model
## S3 method for class 'slt_fit' coef(object, ...)## S3 method for class 'slt_fit' coef(object, ...)
object |
An |
... |
Currently unused. |
The named numeric vector object$par (natural, positive
scale; names and length depend on object$case, see
slt_cases()).
Two Wald-type intervals are available: "normal" and "lognormal".
## S3 method for class 'slt_fit' confint(object, parm, level = 0.95, type = c("lognormal", "normal"), ...)## S3 method for class 'slt_fit' confint(object, parm, level = 0.95, type = c("lognormal", "normal"), ...)
object |
An |
parm |
Optional character vector of parameter names to include (default: all). |
level |
Confidence level. |
type |
|
... |
Currently unused. |
"lognormal" (the default) builds the interval on the log(theta)
scale (where the MLE is asymptotically normal by construction) and
exponentiates, which guarantees a positive interval and is generally
preferred for these positive shape/scale parameters. "normal"
applies the delta-method standard error directly on the natural
scale and can (rarely) produce a negative lower limit for small
samples.
A numeric matrix with one row per parameter and two columns (lower, upper).
set.seed(1) d <- rslt(200, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, "weibull", "shape1", tau1 = 5) confint(fit)set.seed(1) d <- rslt(200, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, "weibull", "shape1", tau1 = 5) confint(fit)
Fit the stage life testing model for given data using the cumulative-exposure method for one of 12 baseline distributions and one of three parameter cases.
fit_slt( data, family = "weibull", case = c("common", "shape1", "shape11"), tau1, init = NULL, n_starts = 4L, bootstrap = FALSE, control = list() )fit_slt( data, family = "weibull", case = c("common", "shape1", "shape11"), tau1, init = NULL, n_starts = 4L, bootstrap = FALSE, control = list() )
data |
A list with numeric vectors |
family |
One of |
case |
One of |
tau1 |
The stage-change time, used to shift |
init |
Optional numeric vector of starting values on the
natural scale, in the order given by |
n_starts |
Number of (perturbed) starting values to try; the converged fit with the highest log-likelihood is returned. |
bootstrap |
If |
control |
Optional list overriding |
Estimation uses a Nelder-Mead warm start followed by BFGS (with a numerical Hessian for inference), repeated from several perturbed starting values to guard against local optima; the converged fit with the highest log-likelihood is returned.
An object of class "slt_fit", a list with elements including
converged, family, case, tau1, par (natural-scale
estimates), se, theta0, theta1, vcov_log, loglik, aic,
bic. If no starting value converges, converged is FALSE and
most other elements are absent.
set.seed(1) d <- rslt(150, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, family = "weibull", case = "shape1", tau1 = 5) summary(fit)set.seed(1) d <- rslt(150, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, family = "weibull", case = "shape1", tau1 = 5) summary(fit)
Two-stage cumulative-exposure log-likelihood
loglik_slt(data, family, theta0, theta1, tau1)loglik_slt(data, family, theta0, theta1, tau1)
data |
A list with numeric vectors |
family |
A family key (see |
theta0 |
Numeric |
theta1 |
Numeric |
tau1 |
The stage-change time used to shift |
The log-likelihood (a scalar), or -Inf for parameter values
outside the support of the model.
set.seed(1) d <- rslt(80, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) loglik_slt(d, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5)set.seed(1) d <- rslt(80, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) loglik_slt(d, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5)
Extract the log-likelihood of a fitted two-stage life testing model
## S3 method for class 'slt_fit' logLik(object, ...)## S3 method for class 'slt_fit' logLik(object, ...)
object |
An |
... |
Currently unused. |
An object of class "logLik" (the fitted log-likelihood,
NA_real_ if object did not converge, with "df"/"nobs"
attributes set for use by stats::AIC()/stats::BIC()).
Plots the fitted population CDF (pslt()) against the empirical CDF
of the observed data.
plot_cdf(fit)plot_cdf(fit)
fit |
A converged |
Assumes every survivor was transferred at tau1 (the classical
simple-step-stress design, prop_transfer = 1 in rslt()) – see the
note in slt_gof_ks() for why: the pooled Y/Z sample only has
pslt() as its correct marginal CDF in that case. This applies to all
four diagnostic plots in this file.
A ggplot object.
set.seed(1) d <- rslt(150, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, "weibull", "shape1", tau1 = 5) plot_cdf(fit)set.seed(1) d <- rslt(150, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, "weibull", "shape1", tau1 = 5) plot_cdf(fit)
P-P (probability-probability) plot
plot_pp(fit)plot_pp(fit)
fit |
A converged |
A ggplot object.
set.seed(1) d <- rslt(150, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, "weibull", "shape1", tau1 = 5) plot_pp(fit)set.seed(1) d <- rslt(150, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, "weibull", "shape1", tau1 = 5) plot_pp(fit)
Q-Q (quantile-quantile) plot
plot_qq(fit)plot_qq(fit)
fit |
A converged |
A ggplot object.
set.seed(1) d <- rslt(150, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, "weibull", "shape1", tau1 = 5) plot_qq(fit)set.seed(1) d <- rslt(150, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, "weibull", "shape1", tau1 = 5) plot_qq(fit)
Fitted vs empirical survival curve
plot_survival(fit)plot_survival(fit)
fit |
A converged |
A ggplot object.
set.seed(1) d <- rslt(150, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, "weibull", "shape1", tau1 = 5) plot_survival(fit)set.seed(1) d <- rslt(150, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, "weibull", "shape1", tau1 = 5) plot_survival(fit)
See plot_cdf() for an important caveat: these assume the classical
simple-step-stress design (prop_transfer = 1 in rslt()).
## S3 method for class 'slt_fit' plot(x, which = c("cdf", "survival", "pp", "qq", "all"), ...)## S3 method for class 'slt_fit' plot(x, which = c("cdf", "survival", "pp", "qq", "all"), ...)
x |
A converged |
which |
One of |
... |
Currently unused. |
A ggplot object, or (if which = "all") a named list of four
ggplot objects.
set.seed(1) d <- rslt(150, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, "weibull", "shape1", tau1 = 5) plot(fit, which = "cdf")set.seed(1) d <- rslt(150, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, "weibull", "shape1", tau1 = 5) plot(fit, which = "cdf")
Print a fitted two-stage life testing model
## S3 method for class 'slt_fit' print(x, digits = 4, ...)## S3 method for class 'slt_fit' print(x, digits = 4, ...)
x |
An |
digits |
Number of digits to round to. |
... |
Currently unused. |
x, invisibly.
summary.slt_fit() for a more detailed summary with
confidence limits.
Print a summary of a fitted two-stage life testing model
## S3 method for class 'summary.slt_fit' print(x, digits = 4, ...)## S3 method for class 'summary.slt_fit' print(x, digits = 4, ...)
x |
A |
digits |
Number of digits to round to. |
... |
Currently unused. |
x, invisibly.
pslt(), dslt() and qslt() implement the full stage life testing
design, in which every unit switches from the baseline to the
elevated stress at a common change-point tau1. Combined with the
cumulative-exposure equivalent age slt_equiv_age(), the two
branches (pre-/post-tau1) are pieced together into a single,
continuous population CDF.
pslt(t, family, theta0, theta1, tau1) dslt(x, family, theta0, theta1, tau1) qslt(p, family, theta0, theta1, tau1)pslt(t, family, theta0, theta1, tau1) dslt(x, family, theta0, theta1, tau1) qslt(p, family, theta0, theta1, tau1)
t, x
|
Numeric vector of times at which to evaluate the CDF/PDF. |
family |
A family key (see |
theta0 |
Numeric |
theta1 |
Numeric |
tau1 |
Scalar change-point time (same argument as |
p |
Numeric vector of probabilities at which to evaluate the quantile function. |
For a single unit switching from stage 0 to stage 1 at the fixed
time tau1 (every unit switches – the classical simple-step-stress
design, matching prop_transfer = 1 in rslt()), the CEM
construction (see slt_equiv_age()) gives a population cdf
where is the stage-1
equivalent age (slt_equiv_age()) at the moment of the switch.
Differentiating – a constant shift of the argument by
, not a general change of variables, so no extra
Jacobian factor arises – gives the matching population pdf
is continuous at by construction of
(, verified as an automatic consequence of the
equal-reliability definition of , not a separate
assumption) – but is generally not differentiable at
(the hazard rate jumps there), an intrinsic, well-known
feature of the cumulative exposure model, not an artefact of this
implementation. qslt() inverts directly (analytically, not
numerically): for it returns
; otherwise it returns , using each stage's own quantile function
(itself closed-form for every family in slt_families()).
A numeric vector the same length as t/x/p.
slt_equiv_age() for nu1; loglik_slt() for the
estimation log-likelihood; rslt() for simulating data under the
actual random-withdrawal design; fit_slt() for maximum
likelihood estimation.
pslt(c(1, 6, 10), "weibull", c(0.1, 1.5), c(0.3, 1.5), tau1 = 5)pslt(c(1, 6, 10), "weibull", c(0.1, 1.5), c(0.3, 1.5), tau1 = 5)
Simulates data from the two-stage life-testing model of Laumen & Cramer (2019, Procedure 2.3).
rslt( n, family, theta0, theta1, tau1, design = c("typeP", "typeM"), prop_transfer = 0.5, R0_1 = NULL )rslt( n, family, theta0, theta1, tau1, design = c("typeP", "typeM"), prop_transfer = 0.5, R0_1 = NULL )
n |
Number of units placed on test. |
family |
A family key (see |
theta0 |
Numeric |
theta1 |
Numeric |
tau1 |
Time at which the transfer decision is made. |
design |
|
prop_transfer |
Proportion (in |
R0_1 |
Target number of survivors transferred (capped by the
number actually available), for |
At the stage-change time tau1, R*_1 of the units that have not
yet failed are randomly selected and moved to the elevated stage
(cumulative-exposure shifted); the remaining survivors continue
failing under the original stage-0 conditions and are never observed
under stage 1.
Two rules for generating R*_1 are supported, following the paper:
"typeP"A fixed target proportion pi1 of the survivors
is transferred: R*_1 = floor(pi1 * (n - D1)), where D1 is the
(random) number of stage-0 failures observed before tau1.
pi1 = 1 transfers every survivor, which is exactly the
classical "simple step-stress" design (Remark 2.2(4) of the
paper) – no separate function is needed for that special case.
"typeM"A fixed target count R0_1 is transferred, capped
by the number of available survivors: R*_1 = min(n - D1, R0_1).
A list with Y (all stage-0 failure times: early failures
before tau1 plus the non-transferred survivors, who keep failing
under stage-0), Z (stage-1 observed failure times for the
transferred units), n_early (D1, number failing before tau1)
and n_transferred (R*_1).
set.seed(1) d <- rslt(100, "weibull", theta0 = c(0.05, 1.5), theta1 = c(0.2, 1.5), tau1 = 5, design = "typeP", prop_transfer = 0.5) str(d) d_m <- rslt(100, "weibull", theta0 = c(0.05, 1.5), theta1 = c(0.2, 1.5), tau1 = 5, design = "typeM", R0_1 = 30) str(d_m) # The classical simple-step-stress design (every survivor transferred): d_full <- rslt(100, "weibull", theta0 = c(0.05, 1.5), theta1 = c(0.2, 1.5), tau1 = 5, design = "typeP", prop_transfer = 1) str(d_full)set.seed(1) d <- rslt(100, "weibull", theta0 = c(0.05, 1.5), theta1 = c(0.2, 1.5), tau1 = 5, design = "typeP", prop_transfer = 0.5) str(d) d_m <- rslt(100, "weibull", theta0 = c(0.05, 1.5), theta1 = c(0.2, 1.5), tau1 = 5, design = "typeM", R0_1 = 30) str(d_m) # The classical simple-step-stress design (every survivor transferred): d_full <- rslt(100, "weibull", theta0 = c(0.05, 1.5), theta1 = c(0.2, 1.5), tau1 = 5, design = "typeP", prop_transfer = 1) str(d_full)
A simple step-stress life-testing data set on the charge detrapping
and dielectric breakdown of nanocrystalline embedded high-k devices,
with 15 units observed under the baseline stress and 23 under the
elevated stress after a common change-point at tau1 = 600 (seconds).
slt_bobotas_kateri_2015slt_bobotas_kateri_2015
A list with elements y0, y1, tau1, description, source
(see slt_han_kundu_2014 for the structure).
Bobotas, P. and Kateri, M. (2015). The step-stress tampered failure rate model under interval monitoring. Statistical Methodology, 27, 100-122.
slt_han_kundu_2014, slt_wang_fei_2003, slt_zhu_2010.
data(slt_bobotas_kateri_2015) str(slt_bobotas_kateri_2015)data(slt_bobotas_kateri_2015) str(slt_bobotas_kateri_2015)
Computes percentile, bootstrap-t, and log-scale bootstrap-t confidence intervals via either non-parametric or a parametric bootstrap.
slt_bootstrap_ci( fit, B = 1000, level = 0.95, method = c("nonparametric", "parametric"), design = c("typeP", "typeM"), prop_transfer = 1, R0_1 = NULL, n_cores = 1L )slt_bootstrap_ci( fit, B = 1000, level = 0.95, method = c("nonparametric", "parametric"), design = c("typeP", "typeM"), prop_transfer = 1, R0_1 = NULL, n_cores = 1L )
fit |
A converged |
B |
Number of bootstrap replicates. |
level |
Confidence level. |
method |
|
design |
For |
prop_transfer |
Proportion transferred, for |
R0_1 |
Target number transferred, for |
n_cores |
Number of cores for |
Non-parametric bootstrap resamples (case resampling) the observed
Y/Z failure times; parametric bootstrap simulates fresh data
from the fitted model at the MLE. The parametric bootstrap is
generally more efficient when the fitted model is (approximately)
correctly specified – see slt_gof_ks() – but is more sensitive to
misspecification; the non-parametric bootstrap is robust to
misspecification but, for small samples, can only reproduce
combinations of already-observed values.
The plain (natural-scale) bootstrap-t interval, like the asymptotic
Wald interval from confint(..., type = "normal"), is an ordinary
linear pivot (estimate -/+ quantile * se) and can occasionally
produce a negative lower bound for a positive parameter, especially
at small n or for a skewed bootstrap distribution. The log-scale
bootstrap-t interval applies the same pivot construction on
log(theta) and exponentiates the result, which guarantees a
positive interval by construction – directly analogous to why
confint(..., type = "lognormal") (the default) is generally
preferred over type = "normal" for the asymptotic interval. The
percentile interval is always positive already (it is built from
quantiles of the always-positive bootstrap estimates themselves), so
only bootstrap-t needed a log-scale counterpart.
An object of class "slt_boot_ci": a list with percentile,
boot_t, and log_boot_t data.frames (columns lower, upper,
one row per parameter), B, B_converged, method, design,
level, and the raw boot_estimates matrix.
set.seed(1) d <- rslt(150, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, "weibull", "shape1", tau1 = 5) slt_bootstrap_ci(fit, B = 100)set.seed(1) d <- rslt(150, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, "weibull", "shape1", tau1 = 5) slt_bootstrap_ci(fit, B = 100)
Describes the three parameter-sharing structures between the
baseline-stage parameters theta0 = (lambda0, alpha0) and the
elevated-stage parameters theta1 = (lambda1, alpha1) supported for
estimation. A fourth, fully unrestricted structure (alpha0 and
alpha1 both free) is deliberately not supported; see Details.
slt_cases()slt_cases()
Four parameter-sharing structures are logically possible for the pair
, :
This package supports the last three; full is deliberately
not offered (see "Why full is excluded" below).
shape1/shape11 fix the elevated-stage shape to the numeric
value 1 – this is a structural constraint, not a claim that the
elevated stage becomes Exponential. The two only coincide for the
four families whose alpha = 1 boundary happens to be Exponential
(weibull, expexponential, moexponential, gamma; see
?slt_dist); for the other eight families, alpha1 = 1 is simply
that family's own (otherwise unnamed) member at shape 1 – e.g. Chen
with its shape fixed at 1, not an Exponential elevated stage.
Fixing the shape is still meaningful regardless: it
reduces the free parameter count the same way for every family (see
"Why full is excluded" below), and "is the elevated-stage shape
exactly 1?" is a concrete, testable nested hypothesis via
slt_lrt() whether or not that constraint has a textbook name.
Each case defines a bijection between its free-parameter vector par
(on the natural, positive scale, in the order given by
case_info(case)$par_names) and (theta0, theta1), implemented by
slt_expand_params() and inverted by slt_reduce_params():
fit_slt() optimises the log-likelihood (loglik_slt(), via
neg_loglik_slt()) over log(par) in this order, then reports the
fitted par under exactly these names – so, for instance, case = "shape1"'s second free parameter is always labelled alpha0 and is
always the baseline-stage shape, never accidentally the elevated-stage
rate or any other quantity. This parameter-index bookkeeping ( case_info()$par_names, slt_expand_params(), slt_reduce_params(),
and fit_slt()'s internal default-initial-value heuristic all sharing
one consistent order) is exactly the kind of place a silent
mislabelling bug could hide, so it has been checked directly: the
round trip slt_expand_params(slt_reduce_params(theta0, theta1, case), case) reproduces (theta0, theta1) exactly for all three
cases, and a full simulate-then-refit check (large n, known
theta0/theta1) recovers the true values under the correct
parameter names for all three cases (see the package's test suite,
test-fit.R).
full (both shapes free) is excluded because, with a single
change-point and no replicated stress levels, its extra free
parameter is empirically non-identifiable (a flat likelihood ridge,
frequent non-convergence); shape1/shape11 remove this by fixing
one or both shapes to 1, common by tying them together instead.
shape11 is nested in both common and shape1 (the natural null
model for slt_lrt()); shape1 and common are not nested in each
other, so compare those two with slt_model_comparison() instead.
A data.frame with columns case, n_par, parameters,
description.
slt_expand_params() and slt_reduce_params() for the
parameter mapping implementing each case; fit_slt() for
estimation; slt_lrt() for the nested likelihood-ratio test;
slt_model_comparison() for comparing non-nested cases.
slt_cases()slt_cases()
Returns the single-stage d/p/q functions, each of (x_or_p, lambda, alpha), for a baseline lifetime distribution. Useful for exploring a
distribution in isolation from the two-stage step-stress structure. In every
distribution, lambda > 0 is a rate/scale-type parameter and alpha > 0 is
a shape/power parameter; see Details for the pdf/cdf of each and its
literature source.
slt_dist(family)slt_dist(family)
family |
A family key from |
Below, and denote the cdf and pdf for (both are
0 for ). / are the standard normal
cdf/pdf, and is the upper incomplete gamma function.
Weibull (Weibull, 1951):
Reduces to Exponential(rate = ) at .
Power Lindley (Ghitany, Al-Mutairi, Balakrishnan & Al-Enezi, 2013):
Reduces to (ordinary) Lindley() at (not
Exponential). The quantile function inverts a Lindley-type equation
via the branch of the Lambert function
(lamW::lambertWm1()): the survival function's numerator-times-
exponential (product) structure reduces to the form
solves.
Exponentiated Lindley (Nadarajah, Bakouch & Tahmasbi, 2011):
with baseline Lindley cdf/pdf and
(Power Lindley's case above),
Reduces to (ordinary) Lindley() at (not
Exponential) – the same limit as Power Lindley above, of
which this is the "exponentiate the cdf" sibling (exactly as
Exponentiated Teissier and Power Muth are the two siblings of the
Teissier baseline). Its quantile function reuses the same
Lambert- baseline-Lindley inverter as Power Lindley, just
inverting a different target probability.
Exponentiated Exponential (Gupta & Kundu, 1999):
Reduces to Exponential() at .
Marshall-Olkin Exponential (Marshall & Olkin, 1997):
Reduces to Exponential() at . Constructed
by a different mechanism than the exponentiated/power-transform
families here – Marshall & Olkin's "tilt parameter" construction,
applicable to any baseline survival function – with as
the tilt parameter (an odds-ratio-type parameter, interpretable via
the family's proportional-odds property).
Lomax (Lomax, 1954):
At this is simply the boundary member of the Lomax
family itself (not a different named distribution).
Exponentiated Teissier (Sharma, Singh & Shekhawat, 2022):
with baseline Teissier (1934) cdf/pdf
and
,
with quantile function (Sharma, Singh & Shekhawat, 2022, Proposition 4.2)
where is the lower () branch of the Lambert
function (lamW::lambertWm1()). Reduces to baseline
Teissier() at (the same limit as
Power Muth below, of which this is the "exponentiate the
cdf" sibling). The Teissier distribution is also known as the Muth
distribution; see Power Muth below, both verified against the cited
paper's own closed-form quantile.
Log-Logistic / Fisk (Fisk, 1961):
The only family here with a non-monotonic (rise-then-fall) hazard
rate for ; at it is simply
Log-Logistic with shape 1 (not a different named distribution).
Chen (Chen, 2000):
Hazard rate is increasing for and bathtub-shaped
for .
Log-normal: parameterised here as
i.e. : is
the median (not the mean) and is the log-scale
standard deviation, keeping " a rate/scale parameter,
a shape parameter" consistent with every other family
here. Built directly on stats::plnorm()-equivalent expressions
(stats::pnorm()/stats::dnorm()/stats::qnorm()) rather than a
hand-derived formula.
Gamma: standard shape-rate parameterisation,
Reduces to Exponential() at . Built
directly on stats::pgamma()/stats::dgamma()/stats::qgamma()
rather than a hand-derived formula.
Power Muth (also known as Power Teissier; Jodra,
Gomez, Jimenez-Gamero & Alba-Fernandez, 2017, generalising the
baseline Muth/Teissier distribution of Muth, 1977, and Teissier, 1934,
and itself studied via the Lambert function by Jodra,
Jimenez-Gamero & Alba-Fernandez, 2015):
with quantile function
using the same Lambert- identity as Exponentiated Teissier
above ( in place of there, since the power
transform is applied to here rather than to the cdf). Reduces
to baseline Teissier/Muth() at – the
same limit as Exponentiated Teissier above, of which this is
the "power the argument" sibling: both generalise the same baseline
distribution, via here versus there (exactly as Power Lindley and Exponentiated
Exponential are, respectively, the "power the argument" and
"exponentiate the cdf" generalisations of their own baselines).
A list with functions d, p, q.
Chen, Z. (2000). A new two-parameter lifetime distribution with bathtub shape or increasing failure rate function. Statistics & Probability Letters, 49(2), 155-161.
Fisk, P. R. (1961). The graduation of income distributions. Econometrica, 29(2), 171-185.
Ghitany, M. E., Al-Mutairi, D. K., Balakrishnan, N., and Al-Enezi, L. J. (2013). Power Lindley distribution and associated inference. Computational Statistics & Data Analysis, 64, 20-33.
Gupta, R. D. and Kundu, D. (1999). Generalized exponential distributions. Australian & New Zealand Journal of Statistics, 41(2), 173-188.
Jodra, P., Gomez, H. W., Jimenez-Gamero, M. D., and Alba-Fernandez, M. V. (2017). The power Muth distribution. Mathematical Modelling and Analysis, 22(2), 186-201.
Jodra, P., Jimenez-Gamero, M. D., and Alba-Fernandez, M. V. (2015). On the Muth distribution. Mathematical Modelling and Analysis, 20(3), 291-310.
Lomax, K. S. (1954). Business failures: Another example of the analysis of failure data. Journal of the American Statistical Association, 49(268), 847-852.
Marshall, A. W. and Olkin, I. (1997). A new method for adding a parameter to a family of distributions with application to the exponential and Weibull families. Biometrika, 84(3), 641-652.
Nadarajah, S., Bakouch, H. S., and Tahmasbi, R. (2011). A generalized Lindley distribution. Sankhya B, 73(2), 331-359.
Muth, E. J. (1977). Reliability models with positive memory derived from the mean residual life function. In The Theory and Applications of Reliability, Vol. 2 (C. P. Tsokos and I. N. Shimi, eds.), 401-435. Academic Press, New York.
Sharma, V. K., Singh, S. V., and Shekhawat, K. (2022). Exponentiated Teissier distribution with increasing, decreasing and bathtub hazard functions. Journal of Applied Statistics, 49(2), 371-393. doi:10.1080/02664763.2020.1813694
Teissier, G. (1934). Recherches sur le vieillissement et sur les lois de la mortalite. Annales de Physiologie et de Physicochimie Biologique, 10, 237-284.
Weibull, W. (1951). A statistical distribution function of wide applicability. Journal of Applied Mechanics, 18(3), 293-297.
slt_families() for the list of family keys; dslt(),
pslt(), qslt(), rslt() for the two-stage (not baseline)
population functions built from these; slt_equiv_age() for how a
baseline distribution's cdf/quantile combine across the stage change.
fam <- slt_dist("weibull") fam$p(1, lambda = 1, alpha = 2) fam$q(0.5, lambda = 1, alpha = 2)fam <- slt_dist("weibull") fam$p(1, lambda = 1, alpha = 2) fam$q(0.5, lambda = 1, alpha = 2)
Under the cumulative exposure model (CEM), a unit that has accumulated
damage equivalent to surviving to time tau under stage-0 conditions
has, under stage-1 conditions, already "used up" an equivalent age
nu. This function computes nu.
slt_equiv_age(family, tau, theta0, theta1)slt_equiv_age(family, tau, theta0, theta1)
family |
A family key (see |
tau |
Non-negative scalar change-point time. |
theta0 |
Numeric |
theta1 |
Numeric |
The CEM's defining assumption is that only the total accumulated
damage determines a unit's remaining life, not the stress history
that produced it. Formalising "equal accumulated damage" as "equal
reliability", a unit surviving to under the stage-0
distribution is equivalent to a unit that has survived to
some age under the stage-1 distribution , where
solves
i.e.
where is the stage-1 quantile function. This is
exactly fam$quantile(fam$cdf(tau, theta0), theta1) below: plug the
stage-0 cdf at tau into the stage-1 quantile function.
is the building block for the population functions pslt()/dslt()/
qslt() and for the log-likelihood loglik_slt() – see their
documentation for how it is used.
The equivalent age (a non-negative scalar).
pslt() for how nu combines with tau1 into the
population cdf; loglik_slt() for the resulting log-likelihood;
slt_tau() for choosing tau as a stage-0 quantile.
slt_equiv_age("weibull", tau = 5, theta0 = c(0.1, 1.5), theta1 = c(0.3, 1.5))slt_equiv_age("weibull", tau = 5, theta0 = c(0.1, 1.5), theta1 = c(0.3, 1.5))
Lists the two-parameter baseline lifetime distributions, theta = (lambda,
alpha), that can be used as the family argument throughout the
package. See slt_dist() for the pdf/cdf and literature source of
each.
slt_families()slt_families()
A character vector of family keys.
slt_dist() for the mathematical definition and reference
of each distribution; slt_cases() for the parameter-sharing cases
these distributions are combined under.
slt_families()slt_families()
Performs the Kolmogorov-Smirnov goodness-of-fit test and reports both the naive p-value (for reference) and the standard parametric-bootstrap-corrected p-value.
slt_gof_ks(fit, B = 1000, n_cores = 1L)slt_gof_ks(fit, B = 1000, n_cores = 1L)
fit |
A converged |
B |
Number of parametric bootstrap replicates. |
n_cores |
Number of cores for |
The classical KS null distribution assumes a fully specified (not
estimated) reference distribution; using it when the parameters were
estimated from the same data makes the naive p-value anti-conservative
(too small), a problem first noted by Lilliefors. The parametric
bootstrap correction simulates B fresh data sets of the same size
from the fitted model via rslt() (at the MLE), refits each with the
same family/case, and takes the corrected p-value to be the
proportion of bootstrap KS statistics at least as extreme as the one
observed on the real data.
This test assumes every survivor was transferred at tau1 (the
classical simple-step-stress design, prop_transfer = 1 in rslt()),
because the single pooled reference distribution it uses (pslt()) is
only the correct marginal CDF of the combined Y/Z sample in that
case. Under genuine partial withdrawal, units that survive tau1 but
are not transferred keep failing on stage 0 unmodified, which
pslt() does not represent – pooling them into one KS statistic
against pslt() would be a biased test. If fit$data came from a
partial-withdrawal rslt() call (prop_transfer < 1 or
design = "typeM"), this function is not appropriate; a Y-only and a
Z-only KS test against their own (design-invariant) marginals would be
the correct generalisation, but is not currently implemented.
An object of class "slt_gof" with elements D
(KS statistic), p_naive, p_bootstrap, B, B_converged.
set.seed(1) d <- rslt(150, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, "weibull", "shape1", tau1 = 5) slt_gof_ks(fit, B = 100)set.seed(1) d <- rslt(150, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fit <- fit_slt(d, "weibull", "shape1", tau1 = 5) slt_gof_ks(fit, B = 100)
A simple step-stress life-testing data set on the reliability of a
solar lighting device, with 16 units observed under the baseline
stress (normal operating temperature, 293K) and 15 under the elevated
stress (353K) after a common change-point at tau1 = 500 (hours).
slt_han_kundu_2014slt_han_kundu_2014
A list with elements:
Numeric vector of 16 stage-0 (baseline stress) failure times.
Numeric vector of 15 stage-1 (elevated stress) failure times.
The change-point time.
Character strings.
The original experiment placed n = 35 units on test, but only
these 31 failure times are reported in the source paper – the
remaining 4 units did not fail before the experiment ended. This
package's model has no right-censoring mechanism (see
?stagelife-package), so those 4 units are not, and cannot be,
represented here.
Han, D. and Kundu, D. (2014). Inference for a step-stress model with competing risks for failure from the generalized exponential distribution under Type-I censoring. IEEE Transactions on Reliability, 64(1), 31-43.
slt_bobotas_kateri_2015, slt_wang_fei_2003,
slt_zhu_2010 for the other three bundled data sets; fit_slt()
for fitting a model to data in this format.
data(slt_han_kundu_2014) fit <- fit_slt(list(Y = slt_han_kundu_2014$y0, Z = slt_han_kundu_2014$y1), "weibull", "shape1", tau1 = slt_han_kundu_2014$tau1) summary(fit)data(slt_han_kundu_2014) fit <- fit_slt(list(Y = slt_han_kundu_2014$y0, Z = slt_han_kundu_2014$y1), "weibull", "shape1", tau1 = slt_han_kundu_2014$tau1) summary(fit)
Tests whether a reduced (nested) parameter-sharing case is adequate against a less-restricted alternative, via the likelihood-ratio statistic.
slt_lrt(fit_full, fit_reduced)slt_lrt(fit_full, fit_reduced)
fit_full, fit_reduced
|
Converged |
The only nested pairs among the three supported cases are
("shape1", "shape11") and ("common", "shape11") (both fix the
remaining free shape parameter(s) to 1); see slt_cases(). This
function tests H0: the reduced ("shape11") model is adequate,
against the corresponding less-restricted alternative.
An object of class "slt_lrt" with statistic, df,
p.value.
set.seed(1) d <- rslt(200, "weibull", c(0.05, 1), c(0.2, 1), tau1 = 5, prop_transfer = 1) f1 <- fit_slt(d, "weibull", "shape1", tau1 = 5) f0 <- fit_slt(d, "weibull", "shape11", tau1 = 5) slt_lrt(f1, f0)set.seed(1) d <- rslt(200, "weibull", c(0.05, 1), c(0.2, 1), tau1 = 5, prop_transfer = 1) f1 <- fit_slt(d, "weibull", "shape1", tau1 = 5) f0 <- fit_slt(d, "weibull", "shape11", tau1 = 5) slt_lrt(f1, f0)
Builds a ranked comparison table across any number of fitted models, by information criteria.
slt_model_comparison(fits, sort_by = c("aic", "bic", "loglik"))slt_model_comparison(fits, sort_by = c("aic", "bic", "loglik"))
fits |
A (preferably named) list of |
sort_by |
One of |
By default sorted by AIC, across any number of "slt_fit" objects –
typically different family/case combinations fit to the same
data set – for exploratory model selection on real data. This is a
lightweight diagnostic table for a single data set, not a Monte
Carlo simulation study.
A data.frame with columns model, family, case, n_par,
logLik, AIC, BIC, converged.
set.seed(1) d <- rslt(200, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fits <- list( "Weibull / shape1" = fit_slt(d, "weibull", "shape1", tau1 = 5), "Weibull / shape11" = fit_slt(d, "weibull", "shape11", tau1 = 5), "Weibull / common" = fit_slt(d, "weibull", "common", tau1 = 5) ) slt_model_comparison(fits)set.seed(1) d <- rslt(200, "weibull", c(0.05, 1.5), c(0.2, 1.5), tau1 = 5, prop_transfer = 1) fits <- list( "Weibull / shape1" = fit_slt(d, "weibull", "shape1", tau1 = 5), "Weibull / shape11" = fit_slt(d, "weibull", "shape11", tau1 = 5), "Weibull / common" = fit_slt(d, "weibull", "common", tau1 = 5) ) slt_model_comparison(fits)
Computes the probability of observing at least one stage-1 failure,
P(R*_1 > 0), implementing Lemma 4.1 of Laumen & Cramer (2019).
slt_prob_stage1( n, tau1, theta0, family = "weibull", design = c("typeP", "typeM"), pi1 = NULL, R0_1 = NULL )slt_prob_stage1( n, tau1, theta0, family = "weibull", design = c("typeP", "typeM"), pi1 = NULL, R0_1 = NULL )
n |
Number of units placed on test. |
tau1 |
Stage-change time. |
theta0 |
Numeric |
family |
A family key (see |
design |
|
pi1 |
Target proportion transferred, for |
R0_1 |
Target number transferred, for |
Because the maximum likelihood estimate of the elevated-stage parameter
only exists when at least one unit is actually transferred to stage 1
and fails there (R*_1 > 0), this is a useful quantity for planning a
stage life test: choosing n, tau1, and pi1/R0_1 so that
slt_prob_stage1() is comfortably close to 1.
R*_1 = rho(D1) > 0 iff D1 <= n*, where n* = floor(n - 1/pi1) for
the "typeP" design and n* = n - 1 for the "typeM" design (with
R0_1 >= 1), and D1 ~ Binomial(n, F0(tau1)).
A list with n_star (the threshold on D1) and prob
(P(R*_1 > 0)).
# Reproduces Table 5 of Laumen & Cramer (2019) exactly (n = 12, # theta0 = 1 i.e. lambda0 = 1, tau1 = 0.5): slt_prob_stage1(12, 0.5, c(1, 1), design = "typeP", pi1 = 0.25) # n*=8, prob=0.9864756680 slt_prob_stage1(12, 0.5, c(1, 1), design = "typeM", R0_1 = 6) # n*=11, prob=0.9999862301# Reproduces Table 5 of Laumen & Cramer (2019) exactly (n = 12, # theta0 = 1 i.e. lambda0 = 1, tau1 = 0.5): slt_prob_stage1(12, 0.5, c(1, 1), design = "typeP", pi1 = 0.25) # n*=8, prob=0.9864756680 slt_prob_stage1(12, 0.5, c(1, 1), design = "typeM", R0_1 = 6) # n*=11, prob=0.9999862301
(theta0, theta1) parameters to a case's free parametersThe inverse of slt_expand_params(); mostly useful for extracting the
"true" parameter vector matching a given case in simulation studies.
For "common", theta0[2] (rather than an average) is used as the
shared shape and a warning is issued if theta0[2] != theta1[2].
slt_reduce_params(theta0, theta1, case = c("common", "shape1", "shape11"))slt_reduce_params(theta0, theta1, case = c("common", "shape1", "shape11"))
theta0, theta1
|
Numeric |
case |
One of |
A named numeric vector matching case_info(case)$par_names.
slt_reduce_params(c(0.2, 1.5), c(0.4, 1.5), case = "common")slt_reduce_params(c(0.2, 1.5), c(0.4, 1.5), case = "common")
Convenience wrapper typically used to set the change-point at a chosen
quantile of the stage-0 lifetime distribution, e.g.
tau <- slt_tau(family, theta0, p = 0.5) places the change-point at the
stage-0 median.
slt_tau(family, theta0, p = 0.5)slt_tau(family, theta0, p = 0.5)
family |
A family key (see |
theta0 |
Numeric |
p |
Probability in |
The p-th quantile of the stage-0 distribution.
slt_tau("weibull", theta0 = c(0.1, 1.5), p = 0.5)slt_tau("weibull", theta0 = c(0.1, 1.5), p = 0.5)
A simple step-stress life-testing data set on the reliability of
electronic components under temperature stress, with 30 units
observed under the baseline stress and 20 under the elevated stress
after a common change-point at tau1 = 910 (hours).
slt_wang_fei_2003slt_wang_fei_2003
A list with elements y0, y1, tau1, description, source
(see slt_han_kundu_2014 for the structure).
Wang, R. and Fei, H. (2003). Uniqueness of the maximum likelihood estimate of the Weibull distribution tampered failure rate model. Communications in Statistics - Theory and Methods, 32(12), 2321-2338.
slt_han_kundu_2014, slt_bobotas_kateri_2015, slt_zhu_2010.
data(slt_wang_fei_2003) str(slt_wang_fei_2003)data(slt_wang_fei_2003) str(slt_wang_fei_2003)
A simple step-stress life-testing data set on light-bulb-filament
fatigue (two sets of 32 bulbs pooled), with 33 units observed under
the baseline stress and 20 under the elevated stress after a common
change-point at tau1 = 94.
slt_zhu_2010slt_zhu_2010
A list with elements y0, y1, tau1, description, source
(see slt_han_kundu_2014 for the structure).
The original experiment used two sets of 32 bulbs (n = 64 total),
but only these 53 failure times are bundled here – the remaining 11
units did not fail before their set's test ended. This package's
model has no right-censoring mechanism (see ?stagelife-package),
so those 11 units are not, and cannot be, represented here.
The source describes the nominal change-point as 96 hours, but this
is inconsistent with the recorded data itself: the smallest stage-1
(post-change) observation is 94.38 (Set-II), which would be
impossible if the change-point were 96 (a unit cannot fail on stage 1
before the stage change happens). tau1 = 94 – the only value
consistent with both stages of the recorded data (every stage-0
observation is <= 91.56; every stage-1 observation is >= 94.38)
– is used here instead.
Zhu, Y. (2010). Optimal Design and Equivalency of Accelerated Life Testing Plans. PhD dissertation, Rutgers, The State University of New Jersey, School of Graduate Studies.
slt_han_kundu_2014, slt_bobotas_kateri_2015, slt_wang_fei_2003.
data(slt_zhu_2010) str(slt_zhu_2010)data(slt_zhu_2010) str(slt_zhu_2010)
Summarise a fitted two-stage life testing model
## S3 method for class 'slt_fit' summary(object, level = 0.95, ...)## S3 method for class 'slt_fit' summary(object, level = 0.95, ...)
object |
An |
level |
Confidence level for the Wald (log-normal) confidence limits reported in the coefficient table. |
... |
Currently unused. |
An object of class "summary.slt_fit".
Computes the natural-scale variance-covariance matrix by the delta method, from the log-scale one fitted internally.
## S3 method for class 'slt_fit' vcov(object, ...)## S3 method for class 'slt_fit' vcov(object, ...)
object |
An |
... |
Currently unused. |
object$vcov_log (the inverse of the numerical Hessian of the
negative log-likelihood in log(par)) is transformed to the natural
scale by the delta method: with ,
, so
.
The natural-scale variance-covariance matrix, or NULL if
the Hessian was not invertible at the optimum.
confint.slt_fit(), which uses this (or the log scale
directly) to build a confidence interval.