ggprentice function

The Generalized Gamma Distribution (Prentice's alternative parametrization)

The Generalized Gamma Distribution (Prentice's alternative parametrization)

Probability function, distribution function, quantile function and random generation for the distribution with parameters mu, sigma and varphi.

dggprentice(x, mu, sigma, varphi, log = FALSE) pggprentice(q, mu = 0, sigma = 1, varphi, lower.tail = TRUE, log.p = FALSE) qggprentice(p, mu = 0, sigma = 1, varphi, lower.tail = TRUE, log.p = FALSE) rggprentice(n, mu = 0, sigma = 1, varphi, ...)

Arguments

  • x: vector of (non-negative integer) quantiles.
  • mu: location parameter of the distribution.
  • sigma: scale parameter of the distribution (sigma > 0).
  • varphi: shape parameter of the distribution.
  • log, log.p: logical; if TRUE, probabilities p are given as log(p).
  • q: vector of quantiles.
  • lower.tail: logical; if TRUE (default), probabilities are P[Xx]P[X \le x]; otherwise, P[X>x]P[X > x].
  • p: vector of probabilities.
  • n: number of random values to return.
  • ...: further arguments passed to other methods.

Returns

dggprentice gives the (log) probability function, pggprentice gives the (log) distribution function, qggprentice gives the quantile function, and rggprentice generates random deviates.

Details

Probability density function:

f(xμ,σ,φ)={φ(φ2)φ2σxΓ(φ2)exp{φ2[φwexp(φw)]}I[0,)(x),φ012πxσexp{12(log(x)μσ)2}I[0,)(x),φ=0 f(x | \mu, \sigma, \varphi) =\begin{cases}\frac{|\varphi|(\varphi^{-2})^{\varphi^{-2}}}{\sigma x\Gamma(\varphi^{-2})}\exp\{\varphi^{-2}[\varphi w - \exp(\varphi w)]\}I_{[0, \infty)}(x), & \varphi \neq 0 \\\frac{1}{\sqrt{2\pi}x\sigma}\exp\left\{-\frac{1}{2}\left(\frac{log(x)-\mu}{\sigma}\right)^2\right\}I_{[0, \infty)}(x), & \varphi = 0\end{cases}

where w=log(x)μσw = \frac{\log(x) - \mu}{\sigma}, for <μ<-\infty < \mu < \infty, σ>0\sigma>0 and <φ<-\infty < \varphi < \infty.

Distribution function:

F(xμ,σ,φ)={FG(y1/φ2,1),φ>01FG(y1/φ2,1),φ<0FLN(xμ,σ),φ=0 F(x|\mu, \sigma, \varphi) =\begin{cases}F_{G}(y|1/\varphi^2, 1), & \varphi > 0 \\1-F_{G}(y|1/\varphi^2, 1), & \varphi < 0 \\F_{LN}(x|\mu, \sigma), & \varphi = 0\end{cases}

where y=(xσ)φy = \displaystyle\left(\frac{x}{\sigma}\right)^\varphi, FG(ν,1)F_{G}(\cdot|\nu, 1) is the distribution function of a gamma distribution with shape parameter 1/φ21/\varphi^2 and scale parameter equals to 1, and FLN(xμ,σ)F_{LN}(x|\mu, \sigma) corresponds to the distribution function of a lognormal distribution with location parameter μ\mu and scale parameter σ\sigma.