Learn R Programming

NeuDist (version 1.0.1)

InvSGZ: Inverted Shifted Gompertz (ISG) Distribution

Description

Provides density, distribution, quantile, random generation, and hazard functions for the Inverted Shifted Gompertz distribution.

Usage

dinv.sgz(x, alpha, theta, log = FALSE)
pinv.sgz(q, alpha, theta, lower.tail = TRUE, log.p = FALSE)
qinv.sgz(p, alpha, theta, lower.tail = TRUE, log.p = FALSE)
rinv.sgz(n, alpha, theta)
hinv.sgz(x, alpha, theta)

Value

  • dinv.sgz: numeric vector of (log-)densities

  • pinv.sgz: numeric vector of probabilities

  • qinv.sgz: numeric vector of quantiles

  • rinv.sgz: numeric vector of random variates

  • hinv.sgz: numeric vector of hazard values

Arguments

x, q

numeric vector of quantiles (x, q)

alpha

positive numeric parameter

theta

positive numeric parameter

log

logical; if TRUE, returns log-density

lower.tail

logical; if TRUE (default), probabilities are \(P[X \le x]\) otherwise, \(P[X > x]\).

log.p

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

p

numeric vector of probabilities (0 < p < 1)

n

number of observations (integer > 0)

Details

The Inverted Shifted Gompertz distribution is parameterized by the parameters \(\alpha > 0\), and \(\theta > 0\).

The Inverted Shifted Gompertz distribution has CDF:

$$ F(x; \alpha, \theta) = 1-\left(1-e^{-\theta / x}\right) \exp \left(-\alpha e^{-\theta / x}\right) \quad ;\;x > 0. $$

where\(\alpha\) and \(\theta\) are the parameters.

The following functions are included:

  • dinv.sgz() — Density function

  • pinv.sgz() — Distribution function

  • qinv.sgz() — Quantile function

  • rinv.sgz() — Random generation

  • hinv.sgz() — Hazard function

References

Chaudhary, A.K., Sapkota, L.P., & Kumar, V. (2020). Inverted Shifted Gompertz Distribution with Theory and Applications. Pravaha, 26(1), 1--10. tools:::Rd_expr_doi("10.3126/pravaha.v26i1.41645")

Jimenez T.F. (2014). Estimation of the Parameters of the Shifted Gompertz Distribution, Using Least Squares, Maximum Likelihood and Moments Methods. Journal of Computational and Applied Mathematics, 255(1) 867--877.

Examples

Run this code
x <- seq(1.0, 5, 0.25)
dinv.sgz(x, 25, 10)
pinv.sgz(x, 25, 10)
qinv.sgz(0.5, 25, 10)
rinv.sgz(10, 25, 10)
hinv.sgz(x, 25, 10)

# Data
x <- fibers65
# ML estimates
params = list(alpha=215.8181, theta=12.7678)
#P–P (probability–probability) plot
pp.plot(x, params = params, pfun = pinv.sgz, fit.line=TRUE)

#Q-Q (quantile–quantile) plot 
qq.plot(x, params = params, qfun = qinv.sgz, fit.line=TRUE)

# Goodness-of-Fit(GoF) and Model Diagnostics 
out <- gofic(x, params = params,
             dfun = dinv.sgz, pfun=pinv.sgz, plot=FALSE)
print.gofic(out)

Run the code above in your browser using DataLab