forked from vlyubchich/funtimes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
q.tails.Rd
51 lines (40 loc) · 1.92 KB
/
q.tails.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
\name{q.tails}
\alias{q.tails}
\title{Quantile-based tails comparison}
\description{
This function compares right tails of two sample distributions using a quantile-based approach (QBA).
}
\usage{
q.tails(x0, x1, q=0.99)
}
\arguments{
\item{x0,x1}{vectors of the same length (preferably). Tail in \code{x1} is compared against the tail in \code{x0}.}
\item{q}{a quantile defining the right tail for both \code{x0} and \code{x1}. Values above the thresholds \code{quantile(x0, probs=q)} and \code{quantile(x1, probs=q)} are considered as the respective right tails.}
}
\details{
Sturges' formula is used to calculate number of intervals (\eqn{k}) to split the upper \eqn{100(1-q)}\% portion of \code{x0} and \code{x1} (the right tails). Then, each tail is divided into equally-filled intervals with a quantile step \eqn{d=(1-q)/k}. \code{Pk} reports the difference between corresponding intervals' centers obtained from \code{x0} and \code{x1}.
}
\value{
A list with two elements:
\item{d}{the quantile step.}
\item{Pk}{vector of differences of the intervals' centers.}
}
\references{
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.) \emph{Machine Learning and Data Mining Approaches to Climate Science}, pages 175--183. Springer International Publishing.
DOI: \href{http://dx.doi.org/10.1007/978-3-319-17220-0}{10.1007/978-3-319-17220-0}
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 \emph{Proceedings of the 4th International Workshop on Climate Informatics}.
\url{http://esc.cbl.umces.edu/pubs/2014-Soliman et al-CI_proceedings.pdf}
}
\author{Vyacheslav Lyubchich, Yulia R. Gel}
\seealso{\code{\link{i.tails}}
}
\examples{
x0 <- rnorm(1000)
x1 <- rt(1000, 5)
q.tails(x0, x1)
}
\keyword{ts}