Learn R Programming

spatialTailDep (version 1.0.2)

Mestimator: Function Mestimator

Description

Function to compute the pairwise M-estimator for the parameters of the Smith model or the Brown-Resnick process.

Usage

Mestimator(x, locations, pairIndices, k, model, Tol = 1e-05, startingValue = NULL, Omega = diag(nrow(pairIndices)), iterate = TRUE, covMat = TRUE)

Arguments

x
An $n$ x $d$ data matrix.
locations
A $d$ x 2 matrix containing the Cartesian coordinates of $d$ points in the plane.
pairIndices
A $q$ x 2 matrix containing the indices of $q$ pairs of points from the matrix locations.
k
The threshold parameter in the definition of the empirical stable tail dependence function.
model
Choose between "smith" and "BR".
Tol
The tolerance parameter in the numerical integration procedure; defaults to 1e-05.
startingValue
Initial value of the parameters in the minimization routine. Defaults to diag(2) for the Smith model and (1, 1.5, 0.75, 0.75) for the BR process.
Omega
A $q$ x $q$ matrix specifying the metric with which the distance between the parametric and nonparametric estimates will be computed. The default is the identity matrix, i.e., the Euclidean metric.
iterate
A Boolean variable. If TRUE (the default), then the estimator is calculated twice, first with Omega specified by the user, and then a second time with the optimal Omega calculated at the initial estimate.
covMat
A Boolean variable. If TRUE (the default), the covariance matrix is calculated.

Value

A list with the following components:
theta
The estimator with estimated optimal weight matrix.
theta_pilot
The estimator without the optimal weight matrix.
covMatrix
The estimated covariance matrix for the estimator.

Details

For a detailed description of the estimation procedure, see Einmahl et al. (2014). Some tips for using this function:
  • n versus d: if the number of locations $d$ is small ($d < 8$ say), a sufficiently large sample size (eg $n > 2000$) is needed to obtain a satisfying result, especially for the Brown-Resnick process. However, if $d$ is large, a sample size of $n = 500$ should suffice.
  • pairIndices: if the number of pairs $q$ is large, Mestimator will be rather slow. This is due to the calculation of Omega and covMat. Setting iterate = FALSE and covMat = FALSE will make this procedure fast even for several hundreds of pairs of locations.
  • Tol: the tolerance parameter is used when calculating the three- and four-dimensional integrals in the asymptotic covariance matrix (see Appendix B in Einmahl et al. (2014)). A tolerance of 1e-04 often suffices, although the default tolerance is a safer choice.
  • StartingValue: for the Smith model, the estimator usually doesn't depend on the starting value at all. For the Brown-Resnick process, it is advised to try a couple of starting values if $d$ is very small, preferably a starting value with $c < 1$ and one with $c > 1$.
  • iterate: if iterate = TRUE, the matrix Omega is calculated. This weight matrix tends to have a larger effect when $d$ is large and/or when the Smith model is used.
  • covMat: if the resulting covariance matrix is incorrect (eg negative diagonal values), then Tol is set too high. For the Smith model, the order of the parameters is $(\sigma_{11},\sigma_{22},\sigma_{12})$.

References

Einmahl, J.H.J., Kiriliouk, A., Krajina, A. and Segers, J. (2014), "An M-estimator of spatial tail dependence". See http://arxiv.org/abs/1403.1975.

See Also

selectPairIndices, pairCoordinates

Examples

Run this code
## define the locations of 4 stations
(locations <- rbind(c(1,1),c(2,1),c(1,2),c(2,2)))
## select the pairs of locations; here, we select all locations
(pairIndices <- selectPairIndices(locations, maxDistance = 2))

## We use the rmaxstab function from the package SpatialExtremes to
## simulate from the Smith and the Brown-Resnick process.

## The Smith model
set.seed(2)
x<-rmaxstab(n = 5000, coord = locations,cov.mod="gauss",cov11=1,cov22=2,cov12=0.5)
## calculate the pairwise M-estimator. This may take up to one minute or longer.
## Mestimator(x, locations, pairIndices, 100, model="smith",Tol = 5e-04)

## The Brown-Resnick process
set.seed(2)
x <- rmaxstab(n = 5000, coord = locations, cov.mod = "brown", range = 3, smooth = 1)
## We can only simulate isotropic processes with rmaxstab, so we multiply the coordinates
## of the locations with V^(-1) (beta,c). Here we choose beta = 0.25 and c = 1.5
(Vmat<-matrix(c(cos(0.25),1.5*sin(0.25),-sin(0.25),1.5*cos(0.25)),nrow=2))
(locationsAniso <- locations %*% t(solve(Vmat)))
## calculate the pairwise M-estimator. This may take up to one minute or longer.
## Mestimator(x, locationsAniso, pairIndices, 300, model="BR",Tol = 5e-04)

Run the code above in your browser using DataLab