tails_q function

Quantile-Based Tails Comparison

Quantile-Based Tails Comparison

Compare right tails of two sample distributions using a quantile-based approach (QBA); see if(!exists(".Rdpack.currefs")) .Rdpack.currefs <-new.env();Rdpack::insert_citeOnly(keys="Soliman_etal_2014_insurance;textual",package="funtimes",cached_env=.Rdpack.currefs) , if(!exists(".Rdpack.currefs")) .Rdpack.currefs <-new.env();Rdpack::insert_citeOnly(keys="Soliman_etal_2015_insurance;textual",package="funtimes",cached_env=.Rdpack.currefs) , and if(!exists(".Rdpack.currefs")) .Rdpack.currefs <-new.env();Rdpack::insert_citeOnly(keys="Lyubchich_Gel_2017_insurance;textual",package="funtimes",cached_env=.Rdpack.currefs) .

tails_q(x0, x1, q = 0.99)

Arguments

  • x0, x1: vectors of the same length (preferably). Tail in x1 is compared against the tail in x0.
  • q: a quantile defining the right tail for both x0 and x1. Values above the thresholds quantile(x0, probs = q) and quantile(x1, probs = q) are considered as the respective right tails.

Returns

A list with two elements: - d: the step in probabilities for defining the quantiles.

  • Pk: vector of differences of the intervals' centers.

Details

Sturges' formula is used to calculate the number of intervals (kk) to split the upper 100(1q)100(1 - q)\

(the right tails). Then, each tail is divided into equally-filled intervals with a quantile step d=(1q)/kd=(1 - q)/k. Pk reports the difference between corresponding intervals' centers obtained from x0 and x1.

Examples

x0 <- rnorm(1000) x1 <- rt(1000, 5) tails_q(x0, x1)

References

if(!exists(".Rdpack.currefs")) .Rdpack.currefs <-new.env();Rdpack::insert_all_ref(.Rdpack.currefs)

See Also

i.tails

Author(s)

Vyacheslav Lyubchich, Yulia R. Gel

  • Maintainer: Vyacheslav Lyubchich
  • License: GPL (>= 2)
  • Last published: 2023-03-21

Useful links