thetaruns {tsxtreme} | R Documentation |
Runs estimator
Description
Compute the empirical estimator of the extremal index using the runs method (Smith & Weissman, 1994, JRSSB).
Usage
thetaruns(ts, lapl = FALSE, nlag = 1,
u.mar = 0, probs = seq(u.mar, 0.995, length.out = 30),
method.mar = c("mle", "mom", "pwm"),
R.boot = 0, block.length = (nlag+1) * 5, levels = c(0.025, 0.975))
Arguments
ts |
a vector, the time series for which to estimate the threshold-based extremal index |
lapl |
logical; is |
nlag |
the run-length; an integer larger or equal to 1. |
u.mar |
marginal threshold (probability); used when transforming the time series to Laplace scale if |
probs |
vector of probabilities; the values of |
method.mar |
a character string defining the method used to estimate the marginal GPD; either |
block.length |
integer; the block length used for the block-bootstrapped confidence intervals. |
R.boot |
integer; the number of samples used for the block bootstrap. |
levels |
vector of probabilites; the quantiles of the posterior distribution of the extremal index |
Details
Consider a stationary time series (X_t)
. A characterisation of the extremal index is
\theta(x,m) = Pr(X_1\le x,\ldots,X_m\le x \mid X_0\ge x).
In the limit when x
and m
tend to \infty
appropriately, \theta
corresponds to the asymptotic inverse mean cluster size. It also links the generalised extreme value distribution of the independent series (Y_t)
, with the same marginal distribution as (X_t)
,
G_Y(z)=G_X^\theta(z),
with G_X
and G_Y
the extreme value distributions of (X_t)
and (Y_t)
respectively.
nlag
corresponds to the run-length m
and probs
is a set of values for x
.
The runs estimator is computed, which consists of counting the proportion of clusters to the number of exceedances of a threshold x
; two exceedances of the threshold belong to different clusters if there are at least m+1
non-exceedances inbetween.
Value
An object of class 'depmeasure
' containing:
theta |
matrix; estimates of the extremal index |
nbr.exc |
numeric vector; number of exceedances for each threshold corresponding to the elements in |
probs |
|
levels |
numeric vector; |
nlag |
|
See Also
Examples
## generate data from an AR(1)
## with Gaussian marginal distribution
n <- 10000
dep <- 0.5
ar <- numeric(n)
ar[1] <- rnorm(1)
for(i in 2:n)
ar[i] <- rnorm(1, mean=dep*ar[i-1], sd=1-dep^2)
## transform to Laplace scale
ar <- qlapl(pnorm(ar))
## compute empirical estimate
theta <- thetaruns(ts=ar, u.mar=.95, probs=c(.95,.98,.99))
## output
plot(theta, ylim=c(.2,1))
abline(h=1, lty="dotted")