View source: R/lnorm_tailplot.R
lnorm_tail | R Documentation |
This function computes the estimate of s
and the associated confidence interval for s
as well as the standard deviation sigma on the log-scale of the lognormal distribution. 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).
lnorm_tail(
x,
u,
confint = FALSE,
method = c("unbiased", "bootstrap", "jackknife"),
R = 1000,
conf.level = 0.95
)
x |
a vector containing the sample data. |
u |
the threshold for the computation of s. |
confint |
a boolean value indicating whether the confidence interval should be computed. |
method |
the method used for computing the confidence intervals (options include unbiased variance estimator, jackknife, and bootstrap). |
R |
the number of the bootstrap replicates. |
conf.level |
the confidence level for the interval. |
The function s
, defined by
s(u) = \mathbb{E}\!\left[
\frac{|X_{1} - X_{2}|}{X_{1} + X_{2}} \;\middle|\; X_{1}\,X_{2} > u
\right],
where X_1,X_2
are independent and identically distributed (i.i.d.) positive random variables, takes a constant value if and only if X_1
follows a lognormal distribution.
Thus, s
can be used to detect distributions with lognormal tails. The characterization of the lognormal distribution is based on the work of Mosimann (1970).
This function estimates s(u)
using U-statistics, similarly as in Iwashita and Klar (2024).
A matrix containing:
threshold |
The value of the threshold u. |
s.estimate |
Estimate of the tail functional s. |
s.ci1 |
The lower bound of the confidence interval for s (if |
s.ci2 |
The upper bound of the confidence interval for s (if |
sigma |
Estimate of the scale parameter under a lognormal model. |
sigma.ci1 |
The lower bound of the confidence interval for sigma (if |
sigma.ci2 |
The upper bound of the confidence interval for sigma (if |
Mosimann, J. E. (1970). Size allometry: size and shape variables with characterizations of the lognormal and generalized gamma distributions. Journal of the American Statistical Association, 65(330):930–945. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.2307/2284599")}
Iwashita, T. & Klar, B. (2024). A gamma tail statistic and its asymptotics. Statistica Neerlandica 78:2, 264-280. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.1111/stan.12316")}
x = rlnorm(1e3, 2, 2)
u = round( quantile(x, 0.98) )
lnorm_tail(x, u, confint = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.