Learn R Programming

funtimes (version 5.0)

i.tails: Interval-Based Tails Comparison

Description

This function compares right tails of two sample distributions using an interval-based approach (IBA).

Usage

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).

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 intervals' centers.

Details

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

References

Chu, C., Gel, Y. R., and Lyubchich, V. (2015). Climate change from an insurance perspective: a case study of Norway. In J. G. Dy et al. (Eds.) Proceedings of the 5th International Workshop on Climate Informatics: CI2015. September 24--25, 2015, Boulder, Colorado, USA.

Lyubchich, V. and Gel, Y. R. (2017). Can we weather proof our insurance? Environmetrics 28(2): e2433. DOI: 10.1002/env.2433

See Also

q.tails

Examples

Run this code
# NOT RUN {
x0 <- rnorm(1000)
x1 <- rt(1000, 5)
i.tails(x0, x1)
# }

Run the code above in your browser using DataLab