Amoud

The Secant-Weibull Distribution

The Secant-Weibull distribution is a generalization of the Weibull distribution which is obtained by adding a secant function to the distribution function of the Weibull distribution. Intriguingly, this simple modification significantly increases the tractability of the hazard rate function. It is appealing for survival models because the hazard rate function of the Secant-Weibull distribution may represent the basic forms: constant, monotonic (increasing or decreasing), and non-monotonic (unimodal or bathtub) shapes.

Secant-G Family of Distributions

The secant-G family of distribution is proposed by Souza L. et al. (2022). They used the secant function to generate a new flexible probability distributions. In their study, they used the Kumaraswamy-Weibull distribution as the baseline distribution to propose a new distribution.

If \(G(x)\) is the cdf of the baseline distribution then the cdf of the Secant-G is given by; \[ F(x)=\sec \left(\frac{\pi}{3} G(x)\right)-1 \] And if \(\mathrm{G}(\mathrm{x})\) has a pdf \(\mathrm{g}(\mathrm{x})\), the pdf of \(\mathrm{Sec}-\mathrm{G}\) is given by; \[ h(x)=\frac{\pi}{3} g(x) \sec \left(\frac{\pi}{3} G(x)\right) \tan \sec \left(\frac{\pi}{3} G(x)\right) \] The survival function, which is another key function of the Secant-G family, is given by; \[ S(x)=1-F(x) \] That is, \[ S(x)=2-\sec \left(\frac{\pi}{3} G(x)\right) \] The instantaneous failure rate (also known as the hazard rate function (hrf) is calculated as follows; \[ \begin{gathered} h r f(x)=\frac{f(x)}{S(x)} \\ =\frac{\frac{\pi}{3} \tan \left(\frac{\pi}{3} G(x)\right) \sec \left(\frac{\pi}{3} G(x)\right)}{2-\sec \left(\frac{\pi}{3} G(x)\right)} \end{gathered} \] The reverse hazard rate function is calculated as follows; \[ r(x)=\frac{f(x)}{F(x)}=\frac{\frac{\pi}{3} \tan \left(\frac{\pi}{3} G(x)\right) \sec \left(\frac{\pi}{3} G(x)\right)}{\sec \left(\frac{\pi}{3} G(x)\right)-1} \] The cumulative hazard rate function is given by; \[ H(x)=e^{-S(x)}=e^{-\left[2-\sec \left(\frac{\pi}{3} C(x)\right)\right]} \] The quantile function is given by; \[ Q(u)=F^{-1}(u)=G^{-1}\left[\frac{3}{\pi} \operatorname{arcsec}(u+1)\right] \]

Secant-Weibull Distribution

As a result of the impending limitations of the original Weibull distribution proposed by Waloddi Weibull, 1933, we intend to modify by applying the secant function to it. Therefore, the proposed cdf of the Secant-Weibull is given by; \[ F(x ; \alpha, \beta)=\sec \left(\frac{\pi}{3}\left(1-e^{-\alpha x^{\beta}}\right)\right)-1 \] where \(1-e^{-c x^{\beta}}\) is the cdf of our baseline distribution Upon differentiation of \(F(x)\) with respect to \(\mathrm{x}\), the corresponding pdf is given by; \[ f(x ; \alpha, \beta)=\frac{\pi}{3}\left[\alpha \beta x^{\beta-1} e^{-\alpha x^{\beta}}\right] \tan \left(\frac{\pi}{3}\left(1-e^{-\alpha x^{\beta}}\right)\right) \sec \left(\frac{\pi}{3}\left(1-e^{-\alpha x^{\beta}}\right)\right) \] The survivor function also known as the reliability function, duration function, or failure time function can be obtained by; \[ S(x ; \theta)=1-F(x) \] Hence, the survival function of the secant-Weibull distribution is computed as follows: \[ S(x ; \alpha, \beta)=1-\left(\frac{\pi}{3} \sec \left(1-e^{-\alpha x^{\beta}}\right)-1\right) \]

The integrated failure rate function also known as integrated hazard or cumulative hazard rate can be expressed as; \[ H(x ; \theta)=-\log [S(x)] \] Hence, the integrated hazard rate function of the Secant-Weibull distribution is \[ H(x ; \alpha, \beta)=e^{-S(x)}=e^{-\left[2-\frac{\pi}{3} \sec \left(1-e^{-\alpha x^{\beta}}\right)\right]} \]

The hazard rate function is obtained upon differentiation of \(H(x)\): \[ h(x ; \theta)=\frac{f(x ; \theta)}{1-F(x ; \theta)} \] Therefore, the failure rate function for the secant-Weibull distribution is expressed as follows: \[ h(x ; \alpha, \beta)=\frac{\frac{\pi}{3}\left[\alpha \beta x^{\beta-1} e^{-\alpha x^{\beta}}\right] \tan \left(\frac{\pi}{3}\left(1-e^{-\alpha x^{\beta}}\right)\right) \sec \left(\frac{\pi}{3}\left(1-e^{-\alpha x^{\beta}}\right)\right)}{2-\frac{\pi}{3} \sec \left(1-e^{-\alpha x^{\beta}}\right)} \]

Hazard rate, pdf, cdf and sf shapes for the Secant-Weibull

rm(list=ls())
#Required packages
library(pracma)
library(AdequacyModel)

#pdf
pdf_secW<-function(x,alpha,beta){
  (pi/3)*((alpha*beta^(alpha)*x^(alpha-1)*exp(-(beta*x)^alpha)))*tan((pi/3)*((1-exp(-(beta*x)^alpha))))*sec((pi/3)*((1-exp(-(beta*x)^alpha))))
}

#windows()


x=seq(0, 5, 0.1)
alpha=1.5;   beta=2.5
alpha1=4.0;  beta1=1.0
alpha2=3.0;  beta2=1.5
alpha3=3.5;  beta3=1.0
alpha4=2.0;  beta4=1.25
alpha5=1.75; beta5=2.25

curve(pdf_secW(x,alpha,beta),
      lwd=2,ylim=c(0,2.5), type="l", cex.lab=0.9,
      cex.main=0.5, cex.axis=0.9, lty=1,
      from=0, to=2, xlab="x",ylab="Density")

G1=pdf_secW(x,alpha1,  beta1)
G2=pdf_secW(x,alpha2,  beta2)
G3=pdf_secW(x,alpha3,  beta3)
G4=pdf_secW(x,alpha4,  beta4)
G5=pdf_secW(x,alpha5,  beta5)


lines(x,G1, lty=2, lwd=2, col="red")
lines(x,G2, lty=3, lwd=2, col="blue")
lines (x,G3, lty=4, lwd=2, col="brown")
lines(x,G4, lty=5, lwd=2, col="green")
lines(x,G5, lty=6, lwd=2, col="magenta")


legend('topright', c(expression(
  list(alpha==1.5,  beta==2.5),
  list(alpha==4.0,  beta==1.0),
  list(alpha==3.0,  beta==1.5),
  list(alpha==3.5,  beta==1.0),
  list(alpha==2.0,  beta==1.25),
  list(alpha==1.75, beta==2.25)
)), ncol=1, bty="n", col=c("black", "red", "blue", "brown", "green", "magenta"), lty=1,
cex=0.7, lwd=2)

#Cumulative distribution function
cdf_secW<-function(x,alpha,beta){
  sec((pi/3)*(1-exp(-(alpha*x)^beta)))-1
}
#windows()
x=seq(0, 5, 0.1)
alpha=1.0;   beta=0.5
alpha1=2.0;  beta1=1.0
alpha2=1.25;  beta2=0.7
alpha3=2.5;  beta3=1.0
alpha4=2.0;  beta4=1.25
alpha5=1.5; beta5=1.0

curve(cdf_secW(x,alpha, beta),
      lwd=2,ylim=c(0,1), type="l", cex.lab=0.9,
      cex.main=0.5, cex.axis=0.9, lty=1,
      from=0, to=5, xlab="x",ylab="Cumulative")

G1=cdf_secW(x,alpha1,  beta1)
G2=cdf_secW(x,alpha2,  beta2)
G3=cdf_secW(x,alpha3,  beta3)
G4=cdf_secW(x,alpha4,  beta4)
G5=cdf_secW(x,alpha5,  beta5)


lines(x,G1, lty=2, lwd=2, col="red")
lines(x,G2, lty=3, lwd=2, col="blue")
lines (x,G3, lty=4, lwd=2, col="brown")
lines(x,G4, lty=5, lwd=2, col="green")
lines(x,G5, lty=6, lwd=2, col="magenta")


legend('bottomright', c(expression(
  list(alpha==1.5,  beta==0.5),
  list(alpha==2.0,  beta==1.0),
  list(alpha==1.25,  beta==0.75),
  list(alpha==2.5,  beta==1.0),
  list(alpha==2.0,  beta==1.25),
  list(alpha==1.5,  beta==1.0)
)), ncol=1, bty="n", col=c("black", "red", "blue", "brown", "green", "magenta"), lty=c(1,2,3,4,5),
cex=0.7, lwd=2)

#Survival Function
sf_secW<-function(x,alpha,beta){
  1-(sec((pi/3)*(1-exp(-(alpha*x)^beta)))-1)
}
#windows()
x=seq(0, 5, 0.1)
alpha=1.5;   beta=0.5
alpha1=2.0;  beta1=1.0
alpha2=1.25;  beta2=0.75
alpha3=2.5;  beta3=1.5
alpha4=2.0;  beta4=1.25
alpha5=1.5;  beta5=1.0

curve(sf_secW(x,alpha, beta),
      lwd=2,ylim=c(0,1), type="l", cex.lab=0.9,
      cex.main=0.5, cex.axis=0.9, lty=1,
      from=0, to=5, xlab="x",ylab="Survival")

G1=sf_secW(x,alpha1,  beta1)
G2=sf_secW(x,alpha2,  beta2)
G3=sf_secW(x,alpha3,  beta3)
G4=sf_secW(x,alpha4,  beta4)
G5=sf_secW(x,alpha5,  beta5)


lines(x,G1, lty=2, lwd=2, col="red")
lines(x,G2, lty=3, lwd=2, col="blue")
lines (x,G3, lty=4, lwd=2, col="brown")
lines(x,G4, lty=5, lwd=2, col="green")
lines(x,G5, lty=6, lwd=2, col="magenta")

legend('topright', c(expression(
  list(alpha==1.5,  lambda==0.5),
  list(alpha==2.0,  lambda==1.0),
  list(alpha==1.25,  lambda==0.75),
  list(alpha==2.5,  lambda==1.0),
  list(alpha==2.0,  lambda==1.25),
  list(alpha==1.5,  lambda==1.0)
)), ncol=1, bty="n", col=c("black", "red", "blue", "brown", "green", "magenta"), lty=c(1,2,3,4,5),
cex=0.7, lwd=2)

#Hazard Rate Function
hr_secW<-function(x,alpha,beta){
  pdf<-(pi/3)*((alpha*beta^(alpha)*x^(alpha-1)*exp(-(beta*x)^alpha)))*tan((pi/3)*((1-exp(-(beta*x)^alpha))))*sec((pi/3)*((1-exp(-(beta*x)^alpha))))
  sf<-(1-(sec((pi/3)*(1-exp(-(alpha*x)^beta)))-1))
  result<-pdf/sf
  return(result)
}
#windows()
x=seq(0, 5, 0.1)
alpha=2.0;   beta=2.0
alpha1=0.4;  beta1=1.25
alpha2=1.5;  beta2=3.65
alpha3=2.0;  beta3=0.5
alpha4=2.0;  beta4=1.25
alpha5=1.0;  beta5=4.0

curve(hr_secW(x,alpha,beta),
      lwd=2,ylim=c(0,2.5), type="l", cex.lab=0.9,
      cex.main=0.5, cex.axis=0.9, lty=1,
      from=0, to=3, xlab="x",ylab="Hazard")

G1=hr_secW(x,alpha1,  beta1)
G2=hr_secW(x,alpha2,  beta2)
G3=hr_secW(x,alpha3,  beta3)
G4=hr_secW(x,alpha4,  beta4)
G5=hr_secW(x,alpha5,  beta5)


lines(x,G1, lty=2, lwd=2, col="red")
lines(x,G2, lty=3, lwd=2, col="blue")
lines (x,G3, lty=4, lwd=2, col="brown")
lines(x,G4, lty=5, lwd=2, col="green")
lines(x,G5, lty=6, lwd=2, col="magenta")


legend('topright', c(expression(
  list(alpha==1.5,  beta==2.5),
  list(alpha==4.0,  beta==1.0),
  list(alpha==3.0,  beta==1.5),
  list(alpha==3.5,  beta==1.0),
  list(alpha==2.0,  beta==1.25),
  list(alpha==1.75, beta==2.25)
)), ncol=1, bty="n", col=c("black", "red", "blue", "brown", "green", "magenta"), lty=1,
cex=0.7, lwd=2)

# Examples of the shape of the hazard function for different values of the parameters
#windows()
h1 <- Vectorize(function(x) hr_secW(x,1,0))   
h2 <- Vectorize(function(x) hr_secW(x,0.20,1.0))  
h3 <- Vectorize(function(x) hr_secW(x,0.4,1.85)) 
h4 <- Vectorize(function(x) hr_secW(x,1.5,0.65)) 
h5 <- Vectorize(function(x) hr_secW(x,0.4 ,25.50)) 
h6 <- Vectorize(function(x) hr_secW(x,1.0, 1.0)) 


x=seq(-1, 5, 0.1)
par(mfrow = c(2,3))
curve(h1,0,5,ylim=c(-1,1),col="black",lwd=2,xlab="t",ylab="Hazard rate function",cex.axis=0.9,cex.lab=0.9, cex=0.7, cex.main=0.5)
curve(h2,0,5,ylim=c(0,0.5),col="blue",lwd=2,xlab="t",ylab="Hazard rate function",cex.axis=0.9,cex.lab=0.9, cex=0.7, cex.main=0.5)
curve(h3,0,5,ylim=c(0,1),col="red",lwd=2,xlab="t",ylab="Hazard rate function",cex.axis=0.9,cex.lab=0.9, cex=0.7, cex.main=0.5)
curve(h4,0,5,ylim=c(0,2),col="green",lwd=2,xlab="t",ylab="Hazard rate function",cex.axis=0.9,cex.lab=0.9, cex=0.7, cex.main=0.5)
curve(h5,0,5,ylim=c(0,2.5),col="purple",lwd=2,xlab="t",ylab="Hazard rate function",cex.axis=0.9,cex.lab=0.9, cex=0.7, cex.main=0.5)
curve(h6,0,5,ylim=c(0,1.5),col="magenta",lwd=2,xlab="t",ylab="Hazard rate function",cex.axis=0.9,cex.lab=0.9, cex=0.7, cex.main=0.5)

In the visual display above, we can observe that the Secant-Weibull distribution can capture six patterns of the hazard rate shapes including:

  1. constant hazard rate(black line),
  2. decreasing hazard rate (blue line),
  3. bathtub hazard rate (red),
  4. uni-modal hazard rate shape (green line),
  5. modified bathtub hazard rate(magenta),
  6. increasing hazard rate(purple line).

References

  1. Souza, L., de Oliveira, W. R., de Brito, C. C. R., Chesneau, C., Fernandes, R., & Ferreira, T. A. (2022). Sec-G class of distributions: Properties and applications. Symmetry, 14(2), 299.