This function computes the estimate of \(g\) and the associated confidence interval for \(g\) as well as \(alpha\), the corresponding shape parameter under the assumption of a gamma model, according to Iwashita and Klar (2024). Three methods are implemented to compute the confidence intervals: a method based on the unbiased variance estimators of the underlying U-statistics, and two resampling methods (jackknife and bootstrap).
gamma_tail(
x,
d,
confint = FALSE,
method = c("unbiased", "bootstrap", "jackknife"),
R = 1000,
conf.level = 0.95,
alpha.max = 100
)A matrix containing:
The value of the threshold d.
Estimate of g.
The lower bound of the confidence interval for g (if confint = TRUE).
The upper bound of the confidence interval for g (if confint = TRUE).
Estimate of the shape parameter under a gamma model.
The lower bound of the confidence interval for alpha (if confint = TRUE).
The upper bound of the confidence interval for alpha (if confint = TRUE).
a vector containing the sample data.
the threshold for the computation of g.
a boolean value indicating whether a confidence interval should be computed.
the method used for computing the confidence intervals (options include unbiased variance estimator, jackknife, and bootstrap).
the number of the bootstrap replicates.
the confidence level for the interval.
the upper limit of the interval to be searched for the root in an internal routine (the default value of 100 should be increased in case of error).
The function \(g\) introduced by Asmussen and Lehtomaa (2017) is used to distinguish between log-concave and log-convex tail behavior. It is defined as:
$$ g(d) = E\left[ \frac{|X_1 - X_2|}{X_1 + X_2} \bigg| X_1 + X_2 > d \right] $$
where \(X_1, X_2\) are independent and identically distributed (i.i.d.) positive random variables. For gamma distributions, \(g\) takes a constant value, making it a useful tool for detecting gamma-tailed distributions.
This function estimates \(g(d)\) using U-statistics. The estimator \(\hat{g}(d)\) is given by:
$$ \hat{g}(d) = \frac{ U^{(1)}_n (d) }{ U^{(2)}_n (d) }, \quad d > 0, $$
where
$$ U^{(1)}_n (d) = \frac{2}{n(n-1)} \sum_{1 \leq i < j \leq n} \frac{|X_i - X_j|}{X_i + X_j} 1(X_i + X_j > d), $$
$$ U^{(2)}_n (d) = \frac{2}{n(n-1)} \sum_{1 \leq i < j \leq n} 1(X_i + X_j > d). $$
Confidence intervals for \(g(d)\), based on the following variance estimation methods, are also provided:
Unbiased Variance Estimator
Bootstrap Resampling
Jackknife Resampling
The \((1-\gamma)\) confidence interval for \(\hat{g}_{n}(d)\) is given by:
$$ \left[ \max\!\Bigl\{ \hat{g}_{n}(d)\;-\; z_{1 - \gamma/2} \,\frac{\hat{\sigma}_{d}}{ \sqrt{n\,U^{(2)}_{n}(d)} }, \;0 \Bigr\}, \;\; \min\!\Bigl\{ \hat{g}_{n}(d)\;+\; z_{1 - \gamma/2} \,\frac{\hat{\sigma}_{d}}{ \sqrt{n\,U^{(2)}_{n}(d)} }, \;1 \Bigr\} \right]. $$ Here, \(z_{1 - \gamma/2} = \Phi^{-1}(1 - \tfrac{\gamma}{2})\) is the appropriate quantile of the standard normal distribution and \(\hat{\sigma}_d\) is an estimator of the standard deviation based on one of the methods above.
Iwashita, T. & Klar, B. (2024). A gamma tail statistic and its asymptotics. Statistica Neerlandica 78:2, 264-280. tools:::Rd_expr_doi("https://doi.org/10.1111/stan.12316")
Asmussen, S. & Lehtomaa, J. (2017). Distinguishing Log-Concavity from Heavy Tails. Risks 2017, 5, 10. tools:::Rd_expr_doi("https://doi.org/10.3390/risks5010010")
x <- rgamma(100, shape = 2, scale = 1)
gamma_tail(x, d = 2, confint = FALSE, method = "unbiased", R = 1000)
Run the code above in your browser using DataLab