theta2fit {tsxtreme} | R Documentation |
Fit time series extremes
Description
Appropriate marginal transforms are done before the fit using standard procedures, before the dependence model is fitted to the data. Then the measure of dependence \theta(x,m)
is derived using a method described in Eastoe and Tawn (2012).
Usage
theta2fit(ts, lapl = FALSE, nlag = 1, R = 1000,
u.mar = 0, u.dep, probs = seq(u.dep, 0.9999, length.out = 30),
method.mar = c("mle","mom","pwm"), method = c("prop", "MCi"),
silent = FALSE,
R.boot = 0, block.length = m * 5, levels = c(.025,.975))
Arguments
ts |
numeric vector; time series to be fitted. |
lapl |
logical; is |
nlag |
integer; number of lags to be considered when modelling the dependence in time. |
R |
integer; the number of samples used for estimating |
u.mar |
marginal threshold; used when transforming the time series to Laplace scale if |
u.dep |
dependence threshold; level above which the dependence is modelled. |
probs |
vector of probabilities; the values of |
method.mar |
a character string defining the method used to estimate the marginal GPD; either |
method |
a character string defining the method used to estimate the dependence measure; either |
silent |
logical ( |
R.boot |
integer; the number of samples used for the block bootstrap for the confidence intervals. |
block.length |
integer; the block length used for the block-bootstrapped confidence intervals. |
levels |
vector of probabilities; the quantiles of the bootstrap distribution of the extremal measure to be computed. |
Details
The standard procedure (method="prop"
) to estimating probabilities from a Heffernan-Tawn fit best illustrated in the bivariate context (Y\mid X>u
):
1. sample X
from an exponential distribution above v \ge u
,
2. sample Z
(residuals) from their empirical distribution,
3. compute Y
using the relation Y = \alpha\times X + X^\beta\times Z
,
4. estimate Pr(X > v_x, Y > v_y)
by calculating the proportion p
of Y
samples above v_y
and multiply p
with the marginal survival distribution evaluated at v_x
.
With method="MCi"
a Monte Carlo integration approach is used, where the survivor distribution of Z
is evaluated at pseudo-residuals of the form
\frac{v_y - \alpha\times X}{X^\beta},
where X
is sampled from an exponential distribution above v_x
. Taking the mean of these survival probabilities, we get the Monte Carlo equivalent of p
in the proportion approach.
Value
List containing:
depfit |
an object of class 'stepfit' |
probs |
|
levels |
|
theta |
a matrix with proportion or Monte Carlo estimates of |
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)
plot(ar, type="l")
plot(density(ar))
grid <- seq(-3,3,0.01)
lines(grid, dnorm(grid), col="blue")
## rescale the margin (focus on dependence)
ar <- qlapl(pnorm(ar))
## fit the data
fit <- theta2fit(ts=ar, u.mar=0.95, u.dep=0.98)
## plot theta(x,1)
plot(fit)
abline(h=1, lty="dotted")