i.tails: Interval-Based Tails Comparison In funtimes: Functions for Time Series Analysis

Description

Compare right tails of two sample distributions using an interval-based approach (IBA); see \insertCiteChu_etal_2015_insurance;textualfuntimes and \insertCiteLyubchich_Gel_2017_insurance;textualfuntimes.

Usage

 `1` ```i.tails(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)`.

Details

Sturges' formula is used to calculate number of intervals (k) for `x0` `d`, then interval width is derived. The tails, `x0` `d` and `x1` `d`, are divided into the intervals. 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`).

Value

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.

Author(s)

Calvin Chu, Yulia R. Gel, Vyacheslav Lyubchich

References

\insertAllCited

`q.tails`
 ```1 2 3``` ```x0 <- rnorm(1000) x1 <- rt(1000, 5) i.tails(x0, x1) ```