Learn R Programming

NeuDist (version 1.0.1)

HCGenRayleigh: Half-Cauchy Generalized Rayleigh Distribution

Description

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

Usage

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

Value

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

  • phc.gen.rayleigh: numeric vector of probabilities

  • qhc.gen.rayleigh: numeric vector of quantiles

  • rhc.gen.rayleigh: numeric vector of random variates

  • hhc.gen.rayleigh: 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 Generalized Rayleigh distribution is parameterized by the parameters \(\alpha > 0\), \(\lambda > 0\), and \(\theta > 0\).

The Half-Cauchy Generalized Rayleigh distribution has CDF:

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

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

The implementation includes the following functions:

  • dhc.gen.rayleigh() — Density function

  • phc.gen.rayleigh() — Distribution function

  • qhc.gen.rayleigh() — Quantile function

  • rhc.gen.rayleigh() — Random generation

  • hhc.gen.rayleigh() — Hazard function

References

Sapkota, L.P., & Kumar, V. (2023). Half-Cauchy Generalized Rayleigh : Theory and Applications.South East Asian J. Math. & Math. Sc., 19(1), 335--360. tools:::Rd_expr_doi("10.56827/SEAJMMS.2023.1901.27")

Shrestha, S.K., & Kumar, V. (2014). Bayesian Analysis for the Generalized Rayleigh Distribution. International Journal of Statistika and Mathematika, 9(3), 118--131.

Kundu, D., & Raqab, M.Z. (2005). Generalized Rayleigh Distribution: Different Methods of Estimation. Computational Statistics and Data Analysis, 49, 187--200.

Examples

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

# Data
x <- stress66
# ML estimates
params = list(alpha=1.4585, lambda=0.5300, theta=0.1655)
#P–P (probability–probability) plot
pp.plot(x, params = params, pfun = phc.gen.rayleigh, fit.line=TRUE)

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

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

Run the code above in your browser using DataLab