reslife.lmoms: L-moments of Residual Life

reslife.lmomsR Documentation

L-moments of Residual Life

Description

This function computes the L-moments of residual life for a quantile function x(F) for an exceedance threshold in probabiliy of u. The L-moments of residual life are thoroughly described by Nair et al. (2013, p. 202). These L-moments are define as

\lambda(u)_r = \sum_{k=0}^{r-1} (-1)^k {r-1 \choose k}^2 \int_u^1 \left(\frac{p-u}{1-u}\right)^{r-k-1} \left(\frac{1-p}{1-u}\right)^k \frac{x(p)}{1-u}\,\mathrm{d}p \mbox{,}

where \lambda(u)_r is the rth L-moment at residual life probability u. The L-moment ratios \tau(u)_r have the usual definitions. The implementation here exclusively uses the quantile function of the distribution. If u=0, then the usual L-moments of the quantile function are returned because the integration domain is the entire potential lifetime range. If u=1, then \lambda(1)_1 = x(1) is returned, which is the maximum lifetime of the distribution (the value for the upper support of the distribution), and the remaining \lambda(1)_r for r \ge 2 are set to NA. Lastly, the notation (u) is neither super or subscripted to avoid confusion with L-moment order r or the TL-moments that indicate trimming level as a superscript (see TLmoms).

Usage

reslife.lmoms(f, para, nmom=5)

Arguments

f

Nonexceedance probability (0 \le F \le 1).

para

The parameters from lmom2par or vec2par.

nmom

The number of moments to compute. Default is 5.

Value

An R list is returned.

lambdas

Vector of the L-moments. First element is \lambda_1, second element is \lambda_2, and so on.

ratios

Vector of the L-moment ratios. Second element is \tau, third element is \tau_3 and so on.

life.exceeds

The value for x(F) for F= f.

life.percentile

The value 100\timesf.

trim

Level of symmetrical trimming used in the computation, which is NULL because no trimming theory for L-moments of residual life have been developed or researched.

leftrim

Level of left-tail trimming used in the computation, which is NULL because no trimming theory for L-moments of residual life have been developed or researched.

rightrim

Level of right-tail trimming used in the computation, which is NULL because no trimming theory for L-moments of residual life have been developed or researched.

source

An attribute identifying the computational source of the L-moments:
“reslife.lmoms”.

Author(s)

W.H. Asquith

References

Nair, N.U., Sankaran, P.G., and Balakrishnan, N., 2013, Quantile-based reliability analysis: Springer, New York.

See Also

rmlmomco, rreslife.lmoms

Examples

A <- vec2par(c(230, 2649, 3), type="gov") # Set lower bounds = 230 hours
F <- nonexceeds(f01=TRUE)
plot(F, rmlmomco(F,A), type="l", ylim=c(0,3000), # mean residual life [black]
     xlab="NONEXCEEDANCE PROBABILITY",
     ylab="LIFE, RESIDUAL LIFE (RL), RL_L-SCALE, RL_L-skew (rescaled)")
L1 <- L2 <- T3 <- vector(mode="numeric", length=length(F))
for(i in 1:length(F)) {
  lmr <- reslife.lmoms(F[i], A, nmom=3)
  L1[i] <- lmr$lambdas[1]; L2[i] <- lmr$lambdas[2]; T3[i] <- lmr$ratios[3]
}
lines(c(0,1), c(1500,1500),  lty=2) # Origin line (to highlight T3 crossing "zero")
lines(F, L1,          col=2, lwd=3) # Mean life (not residual, that is M(u)) [red]
lines(F, L2,          col=3, lwd=3) # L-scale of residual life [green]
lines(F, 5E3*T3+1500, col=4, lwd=3) # L-skew of residual life (re-scaled) [blue]
## Not run: 
# Nair et al. (2013, p. 203), test shows L2(u=0.37) = 771.2815
A <- vec2par(c(230, 2649, 0.3), type="gpa"); F <- 0.37
"afunc" <- function(p) { return((1-p)*rmlmomco(p,A)) }
L2u1 <- (1-F)^(-2)*integrate(afunc,F,1)$value
L2u2 <- reslife.lmoms(F,A)$lambdas[2]

## End(Not run)

lmomco documentation built on May 29, 2024, 10:06 a.m.