R/exp-G.R
exp_G.Rd
Generates the density distribution or the accumulated distribution function Exp-G
exp_G(G, density = FALSE)
G | Cumulative distribution function (baseline) |
---|---|
density | By default, |
The probability density function or the cumulative distribution function will be returned.
This function generates the probability density function or the accumulated distribution function \(Exp-G\), for any specified \(G\). Exp-G will have one more parameter, being it \(s > 0\).
cdf_w <- function(x, beta, lambda) { 1 - exp(-(lambda * x)^beta) } # Exp-Weibull density: pdf_exp_w <- exp_G(G = cdf_w, density = TRUE) # Testing if exp_w is density: integrate( f = pdf_exp_w, lower = 0, upper = Inf, beta = 1.2, lambda = 1.3, s = 2.1 )#> 1 with absolute error < 2.2e-05# Exp-Weibull (accumulated distribution): cdf_exp_w <- exp_G(G = cdf_w, density = FALSE) # Testing whether it is cumulative distribution: cdf_exp_w(x = 0, beta = 1.2, lambda = 1.3, s = 2.1) # in 0#> [1] 0cdf_exp_w(x = Inf, beta = 1.2, lambda = 1.3, s = 2.1) # in Inf#> [1] 1