Learn R Programming

NeuDist (version 1.0.1)

HCGompertz: Half-Cauchy Gompertz Distribution

Description

Provides density, distribution, quantile, random generation, and hazard functions for the Half-Cauchy Gompertz distribution.

Usage

dhc.gpz(x, alpha, lambda, theta, log = FALSE)
phc.gpz(q, alpha, lambda, theta, lower.tail = TRUE, log.p = FALSE)
qhc.gpz(p, alpha, lambda, theta, lower.tail = TRUE, log.p = FALSE)
rhc.gpz(n, alpha, lambda, theta)
hhc.gpz(x, alpha, lambda, theta)

Value

  • dhc.gpz: numeric vector of (log-)densities

  • phc.gpz: numeric vector of probabilities

  • qhc.gpz: numeric vector of quantiles

  • rhc.gpz: numeric vector of random variates

  • hhc.gpz: numeric vector of hazard values

Arguments

x, q

numeric vector of quantiles (x, q)

alpha

positive numeric parameter

lambda

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 Half-Cauchy Gompertz distribution is parameterized by the parameters \(\alpha > 0\), \(\lambda > 0\), and \(\theta > 0\).

The Half-Cauchy Gompertz distribution has CDF:

$$ F(x; \alpha, \lambda, \theta) = \quad \frac{2}{\pi }\arctan \left\{ { - \frac{\lambda }{{\alpha \theta }} \left( {1 - {e^{\alpha x}}} \right)} \right\} \quad ;\;x > 0. $$

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

The implementation includes the following functions:

  • dhc.gpz() — Density function

  • phc.gpz() — Distribution function

  • qhc.gpz() — Quantile function

  • rhc.gpz() — Random generation

  • hhc.gpz() — Hazard function

References

Sah, L.B., & Kumar, V. (2019). Half-Cauchy Gompertz Distribution : Different Methods of Estimation, Journal of National Academy of Mathematics, 33, 51--65.

Examples

Run this code
x <- seq(1.0, 5, 0.25)
dhc.gpz(x, 2.0, 0.5, 2.5)
phc.gpz(x, 2.0, 0.5, 2.5)
qhc.gpz(0.5, 2.0, 0.5, 2.5)
rhc.gpz(10, 2.0, 0.5, 2.5)
hhc.gpz(x, 2.0, 0.5, 2.5)

# Data
x <- stress66
# ML estimates
params = list(alpha=1.6660, lambda=0.0328, theta=2.0578)
#P–P (probability–probability) plot
pp.plot(x, params = params, pfun = phc.gpz, fit.line=TRUE)

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

# Goodness-of-Fit(GoF) and Model Diagnostics 
out <- gofic(x, params = params, dfun=dhc.gpz, pfun=phc.gpz, plot=TRUE)
print.gofic(out)

Run the code above in your browser using DataLab