Learn R Programming

GTDL (version 1.0.0)

fGTDL: 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.

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.

Details

  • Density function $$f(t\mid \boldsymbol{\theta})=\lambda\left(\frac{\exp\{\alpha{t}+\boldsymbol{X}^{\top}\boldsymbol{\beta}\}}{1+\exp\{\alpha{t}+\boldsymbol{X}^{\top}\boldsymbol{\beta}\}}\right)\times\left(\frac{1+\exp\{\alpha{t}+\boldsymbol{X}^{\top}\boldsymbol{\beta}\}}{1+\exp\{\boldsymbol{X}^{\top}\boldsymbol{\beta}\}}\right)^{-\lambda/\alpha}$$

  • Survival function $$S(t \mid \boldsymbol{\theta})=\left(\frac{1+\exp\{\alpha{t}+\boldsymbol{X}^{\top}\boldsymbol{\beta}\}}{1+\exp\{\boldsymbol{X}^{\top}\boldsymbol{\beta}\}}\right)^{-\lambda/\alpha}$$

  • Failure function $$h(t\mid\boldsymbol{\theta})=\lambda\left(\frac{\exp\{\alpha{t}+\boldsymbol{X}^{\top}\boldsymbol{\beta}\}}{1+\exp\{\alpha{t}+\boldsymbol{X}^{\top}\boldsymbol{\beta}\}}\right)$$

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

Run this code
# NOT RUN {
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)



# }

Run the code above in your browser using DataLab