fGTDL: The GTDL distribution

fGTDLR Documentation

The GTDL distribution

Description

Density function, survival function, failure function and random generation for the GTDL distribution.

Usage

dGTDL(t, param, log = FALSE)

hGTDL(t, param)

sGTDL(t, param)

rGTDL(n, param)

Arguments

t

vector of integer positive quantile.

param

parameters (alpha and gamma are scalars, lambda non-negative).

log

logical; if TRUE, probabilities p are given as log(p).

n

number of observations.

Details

  • Density function

    f(t\mid \boldsymbol{θ})=λ≤ft(\frac{\exp\{α{t}+\boldsymbol{X}^{\top}\boldsymbol{β}\}}{1+\exp\{α{t}+\boldsymbol{X}^{\top}\boldsymbol{β}\}}\right)\times≤ft(\frac{1+\exp\{α{t}+\boldsymbol{X}^{\top}\boldsymbol{β}\}}{1+\exp\{\boldsymbol{X}^{\top}\boldsymbol{β}\}}\right)^{-λ/α}

  • Survival function

    S(t \mid \boldsymbol{θ})=≤ft(\frac{1+\exp\{α{t}+\boldsymbol{X}^{\top}\boldsymbol{β}\}}{1+\exp\{\boldsymbol{X}^{\top}\boldsymbol{β}\}}\right)^{-λ/α}

  • Failure function

    h(t\mid\boldsymbol{θ})=λ≤ft(\frac{\exp\{α{t}+\boldsymbol{X}^{\top}\boldsymbol{β}\}}{1+\exp\{α{t}+\boldsymbol{X}^{\top}\boldsymbol{β}\}}\right)

Value

dGTDL gives the density function, hGTDL gives the failure function, sGTDL gives the survival function and rGTDL generates random samples.

Invalid arguments will return an error message.

Source

[d-p-q-r]GTDL are calculated directly from the definitions.

References

  • Mackenzie, G. (1996). Regression Models for Survival Data: The Generalized Time-Dependent Logistic Family. Journal of the Royal Statistical Society. Series D (The Statistician). 45. 21-34.

Examples


library(GTDL)
t <- seq(0,20,by = 0.1)
lambda <- 1.00
alpha <- -0.05
gamma <- -1.00
param <- c(lambda,alpha,gamma)
y1 <- hGTDL(t,param)
y2 <- sGTDL(t,param)
y3 <- dGTDL(t,param,log = FALSE)
tt <- as.matrix(cbind(t,t,t))
yy <- as.matrix(cbind(y1,y2,y3))
matplot(tt,yy,type="l",xlab="time",ylab="",lty = 1:3,col=1:3,lwd=2)


y1 <- hGTDL(t,c(1,0.5,-1.0))
y2 <- hGTDL(t,c(1,0.25,-1.0))
y3 <- hGTDL(t,c(1,-0.25,1.0))
y4 <- hGTDL(t,c(1,-0.50,1.0))
y5 <- hGTDL(t,c(1,-0.06,-1.6))
tt <- as.matrix(cbind(t,t,t,t,t))
yy <- as.matrix(cbind(y1,y2,y3,y4,y5))
matplot(tt,yy,type="l",xlab="time",ylab="Hazard function",lty = 1:3,col=1:3,lwd=2)




carrascojalmar/GTDL documentation built on May 18, 2022, 1:12 p.m.