--- title: "Stress–Strength Reliability Analysis with SSReliabilityClaytonMWD" # author: "Fatih Kızılaslan" # date: "`r format(Sys.time(), '%B %d, %Y')`" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Stress–Strength Reliability Analysis with SSReliabilityClaytonMWD} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r setup, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width = 6, fig.height = 4 ) ``` ## Introduction The `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: $$ R = P(X>Y) $$ where $X$ denotes the strength variable and $Y$ denotes the stress variable. The vignette focuses on: - Modeling stress and strength using the Modified Weibull Distribution (MWD) - Incorporating dependence via the Clayton copula - Estimating model parameters using likelihood-based and alternative methods - Implementing the proposed methods in practice ## Installation Install the latest released version from [CRAN](https://CRAN.R-project.org/package=SSReliabilityClaytonMWD): ```{r} # after released in CRAN # install.packages("SSReliabilityClaytonMWD") ``` Install the latest development version from [GitHub](https://github.com/fatihki/SSReliabilityClaytonMWD): ```{r} # install.packages("remotes") # remotes::install_github("fatihki/SSReliabilityClaytonMWD") ``` ## Estimation Methods Let the strength $X$ and stress $Y$ variables follow the Modified Weibull Distribution (MWD): $X \sim MWD(a_1,b_1,\lambda_1)$ and $Y \sim MWD(a_2,b_2,\lambda_2)$. Their dependence is modeled using the two-dimensional Clayton copula, see [`Clayton.Copula`](https://fatihki.github.io/SSReliabilityClaytonMWD/reference/Clayton_Copula.html), $$C_{\theta}(u,v) = (u^{-\theta} + v^{-\theta} - 1)^{-1/\theta}.$$ Under this model, the stress–strength reliability $R$ is given by: $$ R = P(X>Y) = \int_{0}^{1} t^{-(\theta +1)} \big( t^{-\theta} + G_Y(F_{X}^{-1}(t))^{-\theta} -1 \big)^ {-\left(\frac{1}{\theta}+1 \right) } \tag{1}, $$ where $F_X(x) \equiv F_X(x;a_1,b_1,\lambda_1) = 1- \exp(-a_1 x^{b_1} e^{\lambda_1 x})$ and $G_Y(y) \equiv G_Y(y;a_2,b_2,\lambda_2) = 1- \exp(-a_2 y^{b_2} e^{\lambda_2 y})$. It is calculated as in [`Reliability_Clayton_MWD`](https://fatihki.github.io/SSReliabilityClaytonMWD/reference/Reliability_Clayton_MWD.html) by numerical integral `stats::integrate`. Further details can be found in the companion vignette [Dependent Stress–Strength Reliability Model](ssr-theory.html) and in [Kızılaslan (2026)](https://arxiv.org/abs/2604.12130). ### Maximum Likelihood Estimation (MLE) of $R$ Based on these assumptions, suppose $n$ systems are observed, yielding dependent samples $(x_i,y_i)\; i=1,\dots, n$. The joint log-likelihood function can be decomposed as: $$ \ell(\boldsymbol{\Omega_1},\boldsymbol{\Omega_2},\theta; \mathbf{x},\mathbf{y}) = \ell_1(\boldsymbol{\Omega_1}; \mathbf{x}) + \ell_2(\boldsymbol{\Omega_2}; \mathbf{y}) + \ell_3(\boldsymbol{\Omega_1},\boldsymbol{\Omega_2},\theta; \mathbf{x},\mathbf{y}), $$ where $$ \ell_1(\boldsymbol{\Omega_1}; \mathbf{x}) = n \log(a_1) + \sum_{i=1}^{n} \log(b_1+\lambda_1 x_i) + (b_1-1) \sum_{i=1}^{n} \log x_i + \lambda_1 \sum_{i=1}^{n} x_i - a_1 \sum_{i=1}^{n}x_i^{b_1} e^{\lambda_1 x_i}, $$ $$ \ell_2(\boldsymbol{\Omega_2}; \mathbf{y}) = n \log(a_2) + \sum_{i=1}^{n} \log(b_2+\lambda_2 y_i) + (b_2-1) \sum_{i=1}^{n} \log y_i + \lambda_2 \sum_{i=1}^{n} y_i - a_2 \sum_{i=1}^{n} y_i^{b_2} e^{\lambda_2 y_i}, $$ $$ \ell_3(\boldsymbol{\Omega_1},\boldsymbol{\Omega_2},\theta; \mathbf{x},\mathbf{y}) = \sum_{i=1}^{n} \log \big( c_{\theta} \big( F_{X}(x_i; \boldsymbol \Omega_1), G_Y(y_i; \boldsymbol \Omega_2) \big) \big), $$ and $c_{\theta}$ 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 $\theta$ is estimated by maximizing $\ell_3$ 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 $R$, $\hat{R}$, is obtained by substituting the parameter estimates into Equation (1). ### Least Squares Estimation (LSE) of $R$ 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 $x_{(1)}Y)$ 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)](https://arxiv.org/abs/2604.12130). ```{r} # 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. ```{r} 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 $R$ are presented below. ```{r} print(fit_ssr) ``` ## Companion vignettes - **Dependent Stress–Strength Reliability Model** [`vignette("ssr-theory", package = "SSReliabilityClaytonMWD")`](ssr-theory.html) - **Modified Weibull Distribution (MWD)** [`vignette("mwd-distribution", package = "SSReliabilityClaytonMWD")`](mwd-distribution.html) - **Fitting the Modified Weibull Distribution (MWD)** [`vignette("fitting-mwd", package = "SSReliabilityClaytonMWD")`](fitting-mwd.html) ## References Kızılaslan, Fatih. (2026). *Reliability estimation in dependent stress–strength model with Clayton copula and modified Weibull margins.*[arXiv:2604.12130](https://arxiv.org/abs/2604.12130)