tails_i function

Interval-Based Tails Comparison

Interval-Based Tails Comparison

Compare right tails of two sample distributions using an interval-based approach (IBA); see if(!exists(".Rdpack.currefs")) .Rdpack.currefs <-new.env();Rdpack::insert_citeOnly(keys="Chu_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_i(x0, x1, d = NULL)

Arguments

  • x0, x1: vectors of the same length (preferably). Tail in x1 is compared against the tail in x0.
  • d: a threshold defining the tail. The threshold is the same for both x0 and x1. Default is quantile(x0, probs = 0.99).

Returns

A list with two elements: - Nk: vector that tells how many more x1-values compared with x0-values there are within each interval.

  • Ck: vector of the intervals' centers.

Details

Sturges' formula is used to calculate the number of intervals (kk) for x0 \ge d, then interval width is derived. The tails, x0 \ge d and x1 \ge d, are divided into intervals. The number of x1-values within each interval is compared with the number of x0-values within the same interval (this difference is reported as Nk).

Examples

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

References

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

See Also

q.tails

Author(s)

Calvin Chu, Yulia R. Gel, Vyacheslav Lyubchich

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

Useful links