vignettes/ssr-workflow.Rmd
ssr-workflow.RmdThe SSReliabilityClaytonMWD package provides tools for
modeling and estimating stress–strength reliability under dependent
structures using the Modified Weibull Distribution (MWD) and a
copula-based dependence model.
This vignette presents an end-to-end workflow for estimating
reliability in dependent stress–strength models using the
SSReliabilityClaytonMWD package.
Stress–strength reliability (SSR) is a fundamental concept in reliability engineering and survival analysis, defined as: where denotes the strength variable and denotes the stress variable.
The vignette focuses on:
Install the latest released version from CRAN:
# after released in CRAN
# install.packages("SSReliabilityClaytonMWD")Install the latest development version from GitHub:
# install.packages("remotes")
# remotes::install_github("fatihki/SSReliabilityClaytonMWD")Let the strength
and stress
variables follow the Modified Weibull Distribution (MWD):
and
.
Their dependence is modeled using the two-dimensional Clayton copula,
see Clayton.Copula,
Under this model, the stress–strength reliability
is given by:
where
and
.
It is calculated as in Reliability_Clayton_MWD
by numerical integral stats::integrate.
Further details can be found in the companion vignette Dependent Stress–Strength Reliability Model and in Kızılaslan (2026).
Based on these assumptions, suppose systems are observed, yielding dependent samples .
The joint log-likelihood function can be decomposed as: where
and is the joint PDF of Clayton copula.
We employ the two-step maximum likelihood approach, also known as the
inference functions for margins (IFM) method. In the first step, the
marginal parameters are estimated separately by maximizing their
respective log-likelihood functions. In the second step, the dependence
parameter
is estimated by maximizing
given the estimated marginals. This separation simplifies the estimation
procedure and improves numerical stability. In both steps, optimization
is carried out using stats::optim.
Finally, the the MLE of , , is obtained by substituting the parameter estimates into Equation (1).
The least squares (LS) estimator is obtained by minimizing the sum of squared differences between the theoretical cumulative distribution function (CDF) and the empirical CDF evaluated at the ordered sample points.
We apply the same two-step procedure as in the MLE case for both the LSE and WLSE methods.
Let and denote the ordered samples. The LS estimates of the marginal parameters and are obtained by minimizing:
and In the second step, the LSE of the Clayton copula parameter is obtained by minimizing: where , and .
Finally, the LSE of , , is obtained by substituting the parameter estimates into Equation (1).
In the weighted least squares approach, weights are introduced to improve estimation accuracy. The weights are defined as: These weights are incorporated into Equations (2)–(4) as follows:
In the first step, the weighted objective functions and are minimized to obtain the marginal parameter estimates. In the second step, the dependence parameter is estimated by minimizing .
The WLSE of , , is obtained by substituting the corresponding estimates into Equation (1).
The maximum product of spacings (MPS) method is based on maximizing the geometric mean of spacings between consecutive values of the fitted distribution functions.
Let and denote the ordered samples for strength and stress, respectively.
The spacings for the marginal distributions are defined as: and where , and .
In the first step, the MPS estimates of the marginal parameters and are obtained by maximizing: and In the second step, the MPS estimate of the Clayton copula parameter is obtained by maximizing: where .
Finally, the MPS estimate of , , is obtained by substituting the parameter estimates into Equation (1).
The parametric bootstrap percentile method is employed to be able to construct bootstrap confidence intervals (BCIs) for unknown parameters and as well based on all used methods here. The following Algorithm is employed for obtaining BCIs of the interested parameters based on MLE, LSE, WLSE and MPS methods.
We construct bootstrap confidence intervals for using the following algorithm:
Step 1. Compute the estimates and using one of the estimation methods: ML, LS, WLS, or MPS, based on the observed dependent sample.
Step 2. Generate a dependent bootstrap sample using the estimated parameters.
Step 3. Compute bootstrap estimates , and based on the bootstrap sample.
Step 4. Compute the bootstrap estimate of reliability , denoted by .
Step 5. Repeat Steps 2–4 independently times to obtain .
Step 6. The two-sided bootstrap confidence interval for is: , where denotes the -th empirical quantile of the bootstrap replications. BCIs for the parameters and are obtained in the same manner.
To illustrate the performance and applicability of the proposed methods, we consider both simulated and real data examples.
A simulation study is conducted to evaluate the performance of the proposed estimators under the assumed model structure.
# Load the package
library(SSReliabilityClaytonMWD)
# set seed
set.seed(123)
n <- 50
a1 <- 0.75; b1 <- 1.5; lambda1 <- 0.6
a2 <- 1.2; b2 <- 0.5; lambda2 <- 0.9
theta <- 3
# simulate data
dat <- rMweibull_Clayton(n, a1, b1, lambda1, a2, b2, lambda2, theta)
# true stress-strength reliability value
R_true <- Reliability_Clayton_MWD(a1, b1, lambda1, a2, b2, lambda2, theta)
R_true$value
#> [1] 0.9428307We fit a dependent stress–strength reliability model assuming that both strength and stress follow the MWD, and their dependence is modeled using a Clayton copula.
fit <- fit.SSR.ClaytonMWD(
data = dat,
ACI = TRUE,
bootstrap = TRUE,
B = 10,
seed = 2026,
one.step = TRUE,
alpha = 0.05
)
#> Warning: executing %dopar% sequentially: no parallel backend registeredThe function returns point estimates of all model parameters together with asymptotic confidence intervals and bootstrap confidence intervals for both the parameters and the reliability .
print(fit)
#>
#> Fitting Results of Stress-Strength Reliability Model with MWD Marginals via Clayton Copula
#>
#>
#> Table: Parameter Estimates
#>
#> | | a1| b1| lambda1| a2| b2| lambda2| theta| R|
#> |:----|-------:|-------:|-------:|-------:|-------:|-------:|-------:|-------:|
#> |mle | 0.91531| 1.77111| 0.33610| 1.15016| 0.51926| 1.07039| 2.98107| 0.96239|
#> |lse | 1.26967| 1.91057| 0.00001| 0.94711| 0.44689| 1.32354| 9.72676| 0.99555|
#> |wlse | 1.10497| 1.83511| 0.14438| 0.96263| 0.45805| 1.32415| 3.01138| 0.96637|
#> |mps | 0.94898| 1.68266| 0.27554| 1.14662| 0.48797| 0.97071| 3.28740| 0.95748|
#>
#>
#> Table: 95% Asymptotic Confidence Intervals (MLE)
#>
#> | | a1| b1| lambda1| a2| b2| lambda2| theta| R|
#> |:------|-------:|-------:|-------:|-------:|-------:|-------:|-------:|-------:|
#> |lower | 0.00000| 0.67220| 0.00000| 0.39511| 0.28553| 0.32254| 1.56639| 0.91894|
#> |upper | 2.19113| 2.87001| 1.59347| 1.90520| 0.75298| 1.81823| 4.39576| 1.00000|
#> |length | 2.19113| 2.19781| 1.59347| 1.51009| 0.46745| 1.49569| 2.82937| 0.08106|
#>
#>
#> Table: 95% Bootstrap CIs (MLE)
#>
#> | | a1| b1| lambda1| a2| b2| lambda2| theta| R|
#> |:------|-------:|-------:|-------:|-------:|-------:|-------:|-------:|-------:|
#> |lower | 0.26216| 0.77866| 0.00001| 0.68765| 0.33817| 0.78146| 1.90427| 0.95857|
#> |upper | 1.50917| 2.24596| 1.55287| 2.05227| 0.67876| 1.85251| 4.56875| 0.98110|
#> |length | 1.24701| 1.46731| 1.55286| 1.36462| 0.34059| 1.07104| 2.66448| 0.02253|
#>
#>
#> Table: 95% Bootstrap CIs (LSE)
#>
#> | | a1| b1| lambda1| a2| b2| lambda2| theta| R|
#> |:------|-------:|-------:|-------:|-------:|-------:|-------:|--------:|-------:|
#> |lower | 0.25455| 0.62619| 0.00001| 0.40943| 0.19347| 0.18018| 5.72943| 0.98075|
#> |upper | 1.63375| 2.22374| 1.59905| 2.96950| 0.89047| 2.54395| 21.17203| 0.99974|
#> |length | 1.37920| 1.59755| 1.59904| 2.56007| 0.69699| 2.36377| 15.44261| 0.01898|
#>
#>
#> Table: 95% Bootstrap CIs (WLSE)
#>
#> | | a1| b1| lambda1| a2| b2| lambda2| theta| R|
#> |:------|-------:|-------:|-------:|-------:|-------:|-------:|--------:|-------:|
#> |lower | 0.26556| 0.69049| 0.00001| 0.49786| 0.26531| 0.63087| 1.61708| 0.94712|
#> |upper | 1.59581| 2.30977| 1.50784| 2.09689| 0.72586| 2.22361| 11.47759| 0.99625|
#> |length | 1.33025| 1.61928| 1.50783| 1.59904| 0.46055| 1.59274| 9.86052| 0.04913|
#>
#>
#> Table: 95% Bootstrap CIs (MPS)
#>
#> | | a1| b1| lambda1| a2| b2| lambda2| theta| R|
#> |:------|-------:|-------:|-------:|-------:|-------:|-------:|-------:|-------:|
#> |lower | 0.30178| 0.67258| 0.00001| 0.69724| 0.29324| 0.64941| 1.58618| 0.92730|
#> |upper | 1.41056| 2.02045| 1.36527| 1.93937| 0.61315| 1.61662| 5.94632| 0.97949|
#> |length | 1.10878| 1.34787| 1.36526| 1.24213| 0.31991| 0.96721| 4.36014| 0.05219|
#>
#> Kendall's tau estimate for theta: 3.30303The proposed methodology is applied to real-world data to demonstrate its practical relevance. Specifically, monthly occupancy data from two of Istanbul’s largest dams are used. The data are obtained from the open data platform of the Istanbul Metropolitan Municipality: https://data.ibb.gov.tr/en/.
Within the stress–strength framework, the Terkos dam is treated as the strength variable , while the Omerli dam is considered as the stress variable . Under this formulation, the stress–strength reliability represents the probability that the occupancy level of the Terkos dam (European side) exceeds that of the Omerli dam (Anatolian side). This probability provides a measure of the relative water availability between the two regions. Further details can be found in Kızılaslan (2026).
# Load example data from the package
data(TerkosDam)
data(OmerliDam)
real_data <- list(X = TerkosDam, Y = OmerliDam)We fit the dependent stress–strength reliability model assuming that both variables follow the MWD, with dependence modeled via a Clayton copula.
fit_ssr <- fit.SSR.ClaytonMWD(
data = real_data,
ACI = TRUE,
bootstrap = TRUE,
B = 10,
seed = 2026,
one.step = TRUE,
alpha = 0.05
)The fitted results for the model parameters and the reliability are presented below.
print(fit_ssr)
#>
#> Fitting Results of Stress-Strength Reliability Model with MWD Marginals via Clayton Copula
#>
#>
#> Table: Parameter Estimates
#>
#> | | a1| b1| lambda1| a2| b2| lambda2| theta| R|
#> |:----|-------:|-------:|-------:|-------:|-------:|-------:|-------:|-------:|
#> |mle | 0.98542| 2.66095| 2.11322| 0.02428| 0.45908| 6.33059| 0.50551| 0.50428|
#> |lse | 0.07196| 1.72091| 5.71667| 0.01166| 0.00001| 7.06623| 1.09884| 0.49349|
#> |wlse | 0.04261| 1.29079| 6.20629| 0.01154| 0.00001| 7.10656| 1.23631| 0.49824|
#> |mps | 0.68997| 2.31111| 2.39000| 0.02043| 0.26258| 6.43699| 0.92547| 0.51110|
#>
#>
#> Table: 95% Asymptotic Confidence Intervals (MLE)
#>
#> | | a1| b1| lambda1| a2| b2| lambda2| theta| R|
#> |:------|-------:|-------:|-------:|-------:|-------:|-------:|-------:|-------:|
#> |lower | 0.00000| 0.43992| 0.00000| 0.00000| 0.00000| 4.21722| 0.14734| 0.40310|
#> |upper | 4.33682| 4.88197| 5.79639| 0.06723| 1.39756| 8.44395| 0.86369| 0.60545|
#> |length | 4.33682| 4.44205| 5.79639| 0.06723| 1.39756| 4.22673| 0.71636| 0.20235|
#>
#>
#> Table: 95% Bootstrap CIs (MLE)
#>
#> | | a1| b1| lambda1| a2| b2| lambda2| theta| R|
#> |:------|-------:|-------:|-------:|------:|-------:|-------:|-------:|-------:|
#> |lower | 0.08013| 1.15190| 0.00001| 0.0127| 0.14660| 2.96074| 0.24032| 0.44208|
#> |upper | 7.84406| 4.17488| 4.99832| 0.6515| 2.74715| 7.36907| 0.76629| 0.57280|
#> |length | 7.76393| 3.02298| 4.99831| 0.6388| 2.60056| 4.40833| 0.52597| 0.13072|
#>
#>
#> Table: 95% Bootstrap CIs (LSE)
#>
#> | | a1| b1| lambda1| a2| b2| lambda2| theta| R|
#> |:------|--------:|-------:|-------:|-------:|-------:|-------:|-------:|-------:|
#> |lower | 0.00432| 0.00001| 0.08203| 0.00479| 0.00001| 3.38092| 0.77300| 0.40633|
#> |upper | 14.07044| 5.07941| 8.83643| 0.46871| 2.90343| 8.70306| 1.22167| 0.54812|
#> |length | 14.06612| 5.07940| 8.75439| 0.46392| 2.90342| 5.32214| 0.44867| 0.14178|
#>
#>
#> Table: 95% Bootstrap CIs (WLSE)
#>
#> | | a1| b1| lambda1| a2| b2| lambda2| theta| R|
#> |:------|-------:|-------:|-------:|-------:|-------:|-------:|-------:|-------:|
#> |lower | 0.00600| 0.08335| 2.07582| 0.00735| 0.00001| 4.57432| 1.02051| 0.40990|
#> |upper | 1.93694| 3.81682| 8.40554| 0.14362| 2.18957| 7.75921| 2.79450| 0.55191|
#> |length | 1.93094| 3.73347| 6.32972| 0.13627| 2.18956| 3.18489| 1.77400| 0.14201|
#>
#>
#> Table: 95% Bootstrap CIs (MPS)
#>
#> | | a1| b1| lambda1| a2| b2| lambda2| theta| R|
#> |:------|-------:|-------:|-------:|-------:|-------:|-------:|-------:|-------:|
#> |lower | 0.03681| 0.81306| 0.20976| 0.00853| 0.00001| 3.89184| 0.39588| 0.43467|
#> |upper | 4.90435| 3.55720| 5.68968| 0.23335| 1.80479| 7.53494| 5.25280| 0.62724|
#> |length | 4.86754| 2.74414| 5.47992| 0.22482| 1.80478| 3.64310| 4.85692| 0.19257|
#>
#> Kendall's tau estimate for theta: 1.25912Dependent Stress–Strength Reliability
Modelvignette("ssr-theory", package = "SSReliabilityClaytonMWD")
Modified Weibull Distribution (MWD)vignette("mwd-distribution", package = "SSReliabilityClaytonMWD")
Fitting the Modified Weibull Distribution (MWD)
vignette("fitting-mwd", package = "SSReliabilityClaytonMWD")
Kızılaslan, Fatih. (2026). Reliability estimation in dependent stress–strength model with Clayton copula and modified Weibull margins.arXiv:2604.12130