Amoud
The Arctan-Weibull distribution is a modification of the Weibull distribution which is obtained by adding an inverse trigonometric function named the arctangent 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.
The Arctan-X (AT-X) family of distribution is proposed by Alkhairy et al. (2022). They used the arctangent function to generate a new flexible probability distributions. In their study, they used the classical 2-parameter Weibull distribution as the baseline distribution to propose a new distribution.
The AT-X family has a simple pdf expression and a tractable and closed cdf form. A random variable \(\mathrm{X}\) is said to have the Arctan - \(\mathrm{X}\) family, if its distribution function is \(F_{\text {arctan }}(x ; \theta)=\frac{4}{\pi} \arctan (G(x ; \theta)), \quad x \in \mathbb{R}\) Where \(G(x ; \theta)\) is the cdf of the baseline (or parent) random variable may depend on the parameter vector \(\theta \in \mathbb{R}\), and if \(G(x)\) has pdf \(g(x)\) then the pdf of the class is expressed as \(f_{\arctan }(x ; \theta)=\frac{4}{\pi} \frac{g(x ; \theta)}{1+G(x ; \theta)^{2}}, \quad x \in \mathbb{R}\) The complementary cdf (or survival function) is obtained by \[ S_{\text {arcan }}(x ; \theta)=1-\frac{4}{\pi} \arctan (G(x ; \theta)), \quad x \in \mathbb{R} \] The instantaneous failure rate (or hazard rate function (hrf)) is obtained by \[ h_{\text {arctan }}(x ; \theta)=\frac{f_{\arctan }(x ; \theta)}{S_{\text {arctan }}(x ; \theta)}=\frac{4 g(x ; \theta)}{\pi-4 \arctan (G(x ; \theta))\left\{1+G(x ; \theta)^{2}\right\}}, \quad x \in \mathbb{R} \] The retro hazard (or reversed hazard rate function) is given by \(r_{\arctan }(x ; \theta)=\frac{f_{\arctan }(x ; \theta)}{F_{\arctan }(x x ; \theta)}=\frac{4 g(x ; \theta)}{\arctan (G(x ; \theta))\left\{1+G(x ; \theta)^{2}\right\}}, \quad x \in \mathbb{R}\) And the integrated hazard rate (or cumulative hazard rate function) is given by \[ H_{\text {arctan }}(x ; \theta)=-\log S_{\text {arctan }}(x ; \theta)=-\log \left\{1-\frac{4}{\pi} \arctan (G(x ; \theta))\right\}, \quad x \in \mathbb{R}, \] The quantile function of the Arctan- \(\mathrm{X}\) family follows by inverting the Arctan- \(\mathrm{X}\) distribution function. It can be expressed in terms of tangent function as: \(x=Q_{G}(u)=F^{-1}(u)=G^{-1}\left(\tan \left(\frac{\pi}{4} u\right)\right)\), where; \(u \in(0,1)\). The expression provided in the quantile function equation can be used to generate random number from the AT-X distributions.
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.
In this section, we introduce the AT-W distribution and derive the basic probability functions including the pdf, hrf, cdf, survivor function, integrated hazard function and the retro hazard. Considering that \(G(x)\) is the cdf of the two-parameter Weibull distribution. The cdf of the AT-W distribution, for \(x>0\), can be expressed as: \(F_{A T-W}(x ; \boldsymbol{\theta})=\frac{4}{\pi} \arctan \left(1-e^{-\alpha x^{\lambda}}\right), \quad x \in \mathbb{R}\), The corresponding pdf to the above cdf is given by \[ f_{A T-W}(x ; \boldsymbol{\theta})=\frac{4}{\pi} \frac{\lambda \alpha(\alpha x)^{\lambda-1} \exp \left\{-(\alpha x)^{\lambda}\right\}}{1+\left\{\frac{4}{\pi} \arctan \left(1-e^{-\alpha x^{\lambda}}\right)\right\}^{2}}, \quad x \in \mathbb{R} \] The sf is expressed as follows \(S_{A T-W}(x ; \boldsymbol{\theta})=1-\frac{4}{\pi} \arctan \left(1-e^{-\alpha x^{\lambda}}\right)\) The hrf is obtained by \[ h_{A T-W}(x ; \boldsymbol{\theta})=\frac{4\left[\lambda \alpha(\alpha x)^{\lambda-1} \exp \left\{-(\alpha x)^{\lambda}\right\}\right]}{\pi-4 \arctan \left(\frac{4}{\pi} \arctan \left(1-e^{-\alpha x^{\lambda}}\right)\right)\left\{1+\left\{\frac{4}{\pi} \arctan \left(1-e^{-\alpha x^{\lambda}}\right)\right\}^{2}\right\}} \] The reversed hazard rate function is expressed as follows \[ r_{A T-W}(x ; \boldsymbol{\theta})=\frac{4\left[\lambda \alpha(\alpha x)^{\lambda-1} \exp \left\{-(\alpha x)^{\lambda}\right\}\right]}{\arctan \left(\frac{4}{\pi} \arctan \left(1-e^{-\alpha x^{\lambda}}\right)\right)\left\{1+\left\{\frac{4}{\pi} \arctan \left(1-e^{-\alpha x^{\lambda}}\right)\right\}^{2}\right\}^{2}}, \] The cumulative hazard function can be given us: \(H_{A T-W}(x ; \boldsymbol{\theta})=-\log S_{T a n-L L}(x ; \boldsymbol{\theta})=-\log \left[1-\frac{4}{\pi} \arctan \left(1-e^{-\alpha x^{\lambda}}\right)\right]\) With \(x \geq 0, \alpha, \lambda>0\), and \(\boldsymbol{\theta}=(\alpha, \lambda)^{\prime}\) is the vector parameter in all of the above equations respectively.
rm(list=ls())
#Required packages
library(pracma)
library(AdequacyModel)
#pdf
#pdf
pdf_arcW<-function(x,alpha,lambda){
(4/pi)*((alpha*lambda^(alpha)*x^(alpha-1)*exp(-(lambda*x)^alpha))/(1+((1-exp(-(lambda*x)^alpha)))^2))
}
#windows()
x=seq(0, 5, 0.1)
alpha=1.5; lambda=2.5
alpha1=4.0; lambda1=1.0
alpha2=3.0; lambda2=1.5
alpha3=3.5; lambda3=1.0
alpha4=2.0; lambda4=1.25
alpha5=1.75; lambda5=2.25
curve(pdf_arcW(x,alpha,lambda),
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_arcW(x,alpha1, lambda1)
G2=pdf_arcW(x,alpha2, lambda2)
G3=pdf_arcW(x,alpha3, lambda3)
G4=pdf_arcW(x,alpha4, lambda4)
G5=pdf_arcW(x,alpha5, lambda5)
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==2.5),
list(alpha==4.0, lambda==1.0),
list(alpha==3.0, lambda==1.5),
list(alpha==3.5, lambda==1.0),
list(alpha==2.0, lambda==1.25),
list(alpha==1.75, lambda==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_arcW<-function(x,alpha,lambda){
(4/pi)*(atan(1-exp(-(lambda*x)^alpha)))
}
#windows()
x=seq(0.1, 5, 0.1)
alpha=1.5; lambda=0.5
alpha1=2.0; lambda1=1.0
alpha2=1.25; lambda2=0.75
alpha3=2.5; lambda3=1.5
alpha4=2.0; lambda4=1.25
alpha5=1.5; lambda5=1.0
curve(cdf_arcW(x,alpha, lambda),
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=3, xlab="x",ylab="Cumulative")
G1=cdf_arcW(x,alpha1, lambda1)
G2=cdf_arcW(x,alpha2, lambda2)
G3=cdf_arcW(x,alpha3, lambda3)
G4=cdf_arcW(x,alpha4, lambda4)
G5=cdf_arcW(x,alpha5, lambda5)
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, 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)
#Survival Function
sf_arcW<-function(x,alpha,lambda){
1-(4/pi)*(atan(1-exp(-(lambda*x)^alpha)))
}
x=seq(0.1, 5, 0.1)
alpha=1.5; lambda=0.5
alpha1=2.0; lambda1=1.0
alpha2=1.25; lambda2=0.75
alpha3=2.5; lambda3=1.5
alpha4=2.0; lambda4=1.25
alpha5=1.5; lambda5=1.0
curve(sf_arcW(x,alpha, lambda),
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_arcW(x,alpha1, lambda1)
G2=sf_arcW(x,alpha2, lambda2)
G3=sf_arcW(x,alpha3, lambda3)
G4=sf_arcW(x,alpha4, lambda4)
G5=sf_arcW(x,alpha5, lambda5)
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)
#Reversed Hazard Function
rhr_TanLL<-function(x,a,b){
A<- ((pi/4))*((b/a)*(x/a)^(b-1)/((1+(x/a)^(b))^2))*sec((pi/4)
*((x^(b))/(a^(b)+x^(b))))^2
B<-tan((pi/4)*((x^(b))/(a^(b)+x^(b))))
result<-A/B
return(result)
}
x=seq(0, 5, 0.1)
a=1.0; b=1.3
a1=1.8; b1=2.5
a2=1.5; b2=1.9
a3=1.2; b3=1.3
a4=2.0; b4=3.0
a5=1.5; b5=1.5
curve(rhr_TanLL(x,a,b),
lwd=2,ylim=c(0,1.0), type="l", cex.lab=0.9,
cex.main=0.5, cex.axis=0.9, lty=1,
from=0, to=5, xlab="x",ylab="Reversed Hazard")
G1=rhr_TanLL(x,a1, b1)
G2=rhr_TanLL(x,a2, b2)
G3=rhr_TanLL(x,a3, b3)
G4=rhr_TanLL(x,a4, b4)
G5=rhr_TanLL(x,a5, b5)
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(a==1.0, b==1.3),
list(a==1.8, b==2.5),
list(a==1.5, b==1.9),
list(a==1.2, b==1.3),
list(a==2.0, b==3.0),
list(a==1.5, b==1.5)
)), ncol=1, bty="n", col=c("black", "red", "blue", "brown", "green", "magenta"), lty=1,
cex=0.7, lwd=2)
#Hazard rate function
hr_arcW<-function(x,alpha,lambda){
pdf<-(4/pi)*((alpha*lambda^(alpha)*x^(alpha-1)*exp(-(lambda*x)^alpha))/(1+((1-exp(-(lambda*x)^alpha)))^2))
sf<-(1-(4/pi)*(atan(1-exp(-(lambda*x)^alpha))))
result<-pdf/sf
return(result)
}
# Examples of the shape of the hazard function for different values of the parameters
h1 <- Vectorize(function(x) hr_arcW(x,1,0))
h2 <- Vectorize(function(x) hr_arcW(x,1.0,0.70))
h3 <- Vectorize(function(x) hr_arcW(x,0.4,0.25))
h4 <- Vectorize(function(x) hr_arcW(x,1.5,0.65))
h5 <- Vectorize(function(x) hr_arcW(x,0.4 ,2.50))
h6 <- Vectorize(function(x) hr_arcW(x,9.0, 0.5))
#windows()
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 function",cex.axis=0.9,cex.lab=0.9, cex=0.7, cex.main=0.5)
curve(h2,0,2,ylim=c(0.75,1),col="blue",lwd=2,xlab="t",ylab="Hazard function",cex.axis=0.9,cex.lab=0.9, cex=0.7, cex.main=0.5)
curve(h3,0,5,ylim=c(0,2),col="red",lwd=2,xlab="t",ylab="Hazard 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 function",cex.axis=0.9,cex.lab=0.9, cex=0.7, cex.main=0.5)
curve(h5,0,5,ylim=c(0,2),col="magenta",lwd=2,xlab="t",ylab="Hazard function",cex.axis=0.9,cex.lab=0.9, cex=0.7, cex.main=0.5)
curve(h6,0,2,ylim=c(0,2.5),col="purple",lwd=2,xlab="t",ylab="Hazard 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 Arctan-Weibull distribution can accommodate five different patterns of the hazard rate shapes.