This function compares right tails of two sample distributions using a quantile-based approach (QBA).
q.tails(x0, x1, q = 0.99)vectors of the same length (preferably). Tail in x1 is compared against the tail in x0.
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.
A list with two elements:
the quantile step.
vector of differences of the intervals' centers.
Sturges' formula is used to calculate number of intervals (\(k\)) to split the upper \(100(1 - q)\)% portion of x0 and x1 (the right tails). Then, each tail is divided into equally-filled intervals with a quantile step \(d=(1 - q)/k\). Pk reports the difference between corresponding intervals' centers obtained from x0 and x1.
Lyubchich, V. and Gel, Y. R. (2017). Can we weather proof our insurance? Environmetrics 28(2): e2433. DOI: 10.1002/env.2433
Soliman, M., Lyubchich, V., Gel, Y. R., Naser, D., and Esterby, S. (2015). Evaluating the impact of climate change on dynamics of house insurance claims. Ch. 16 in V. Lakshmanan et al. (Eds.) Machine Learning and Data Mining Approaches to Climate Science, pp. 175--183. Springer International Publishing. DOI: 10.1007/978-3-319-17220-0_16
Soliman, M., Naser, D., Lyubchich, V., Gel, Y. R., and Esterby, S. (2014). Evaluating the impact of climate change on dynamics of house insurance claims. In Proceedings of the 4th International Workshop on Climate Informatics: CI2014. September 25--26, 2014, Boulder, Colorado, USA.
# NOT RUN {
x0 <- rnorm(1000)
x1 <- rt(1000, 5)
q.tails(x0, x1)
# }
Run the code above in your browser using DataLab