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 θ(x,m)\theta(x,m), with xx a probability level and mm a run-length (see details).

lapl

logical; is ts on the Laplace scale already? The default (FALSE) assumes unknown marginal distribution.

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 lapl is FALSE; if lapl is TRUE, it is nevertheless used when bootstrapping, since the bootstrapped series generally do not have Laplace marginal distributions.

probs

vector of probabilities; the values of xx for which to evaluate θ(x,m)\theta(x,m).

method.mar

a character string defining the method used to estimate the marginal GPD; either "mle" for maximum likelihood or "mom" for method of moments or "pwm" for probability weighted moments methods. Defaults to "mle".

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 θ(x,m)\theta(x,m) to output.

Details

Consider a stationary time series (Xt)(X_t). A characterisation of the extremal index is

θ(x,m)=Pr(X1x,,XmxX0x).\theta(x,m) = Pr(X_1\le x,\ldots,X_m\le x \mid X_0\ge x).

In the limit when xx and mm 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 (Yt)(Y_t), with the same marginal distribution as (Xt)(X_t),

GY(z)=GXθ(z),G_Y(z)=G_X^\theta(z),

with GXG_X and GYG_Y the extreme value distributions of (Xt)(X_t) and (Yt)(Y_t) respectively.

nlag corresponds to the run-length mm and probs is a set of values for xx. The runs estimator is computed, which consists of counting the proportion of clusters to the number of exceedances of a threshold xx; two exceedances of the threshold belong to different clusters if there are at least m+1m+1 non-exceedances inbetween.

Value

An object of class 'depmeasure' containing:

theta

matrix; estimates of the extremal index θ(x,m)\theta(x,m) with rows corresponding to the probs values of xx and the columns to the runs estimate and the chosen levels-quantiles of the bootstrap distribution.

nbr.exc

numeric vector; number of exceedances for each threshold corresponding to the elements in probs.

probs

probs.

levels

numeric vector; probs converted to the original scale of ts.

nlag

nlag.

See Also

theta2fit, thetafit

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

[Package tsxtreme version 0.3.3 Index]