Learn R Programming

distTails (version 0.1.2)

dFTG: FTG Density Function

Description

This function computes the density of the full-tail gamma with the input sample data. The expression for the density used is: $$g(x; \alpha, \theta, \rho) = \frac{\rho^{\alpha}}{\sigma}\left(\rho + \frac{x}{\sigma}\right)^{\alpha - 1}\exp\left(-\left(\rho + \frac{x}{\sigma}\right)\right)/\Gamma(\alpha, \rho).$$

Usage

dFTG(x, threshold, scale, shape)

Arguments

x

Sample data.

threshold

Minimum value of the tail.

scale

Scale parameter.

shape

Shape parameter.

Value

Gives the density of the FTG. The length of the result is determined by the length of x.

References

del Castillo, Joan & Daoudi, Jalila & Serra, Isabel. (2012). The full-tails gamma distribution applied to model extreme values. ASTIN Bulletin. <doi:10.1017/asb.2017.9>.

Examples

Run this code
# NOT RUN {
a <- 0.3
t <- 0.3
r <- 0.8
n <- 1000
sample <- rFTG(n, a, t, r)
x <- seq(min(sample), max(sample), length.out = 200)
d <- dFTG(x, a, t, r)
hist(sample, breaks = "FD", probability = TRUE)
lines(x, d, col = "red")
# }

Run the code above in your browser using DataLab