fGTDL | R Documentation |
Density function, survival function, failure function and random generation for the GTDL distribution.
dGTDL(t, param, log = FALSE) hGTDL(t, param) sGTDL(t, param) rGTDL(n, param)
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. |
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)
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.
[d-p-q-r]GTDL are calculated directly from the definitions.
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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.