Last chance! 50% off unlimited learning
Sale ends in
This function derives the MLE of a spatial GEV model.
fitspatgev(data, covariables, loc.form, scale.form, shape.form,
temp.cov = NULL, temp.form.loc = NULL, temp.form.scale = NULL,
temp.form.shape = NULL, ..., start, control = list(maxit = 10000),
method = "Nelder", warn = TRUE, corr = FALSE)
A matrix representing the data. Each column corresponds to one location.
Matrix with named columns giving required covariates for the GEV parameter models.
R formulas defining the spatial models for the GEV parameters. See section Details.
Matrix with names columns giving additional *temporal*
covariates for the GEV parameters. If NULL
, no temporal trend
are assume for the GEV parameters --- see section Details.
R formulas defining the temporal trends for the GEV parameters. May be missing. See section Details.
A named list giving the initial values for the
parameters over which the pairwise likelihood is to be minimized. If
start
is omitted the routine attempts to find good starting
values - but might fail.
Several arguments to be passed to the
optim
functions. See section details.
The control argument to be passed to the
optim
function.
The method used for the numerical optimisation
procedure. Must be one of BFGS
, Nelder-Mead
,
CG
, L-BFGS-B
or SANN
. See optim
for details.
Logical. If TRUE
(default), users will be warned if
the starting values lie in a zero density region.
Logical. If TRUE
, the asymptotic correlation matrix
is computed.
An object of class spatgev
. Namely, this is a list with the
following arguments:
The parameter estimates.
All the parameters e.g. parameter estimates and fixed parameters.
The standard errors.
The asymptotic MLE variance covariance matrix.
Some information about the optimization procedure.
The log-likelihood and deviance values.
The formulas defining the spatial models for the GEV parameters.
The covariables used for the spatial models.
The inverse of the Hessian matrix of the negative log-likelihood.
The variance covariance matrix of the score.
A kind of "spatial" GEV model can be defined by using response surfaces for the GEV parameters. For instance, the GEV location parameters are defined through the following equation:
The log-likelihood for the GEV spatial model is consequently defined as follows:
Most often, there will be some dependence between stations. However, it can be seen from the log-likelihood definition that we supposed that the stations are mutually independent. Consequently, to get reliable standard error estimates, these standard errors are estimated with their sandwich estimates.
There are two different kind of covariates : "spatial" and "temporal".
A "spatial" covariate may have different values accross station but
does not depend on time. For example the coordinates of the stations
are obviously "spatial". These "spatial" covariates should be used
with the marg.cov
and loc.form, scale.form, shape.form
.
A "temporal" covariates may have different values accross time but
does not depend on space. For example the years where the annual
maxima were recorded is "temporal". These "temporal" covariates should
be used with the temp.cov
and temp.form.loc,
temp.form.scale, temp.form.shape
.
As a consequence note that marg.cov
must have K rows (K being
the number of sites) while temp.cov
must have n rows (n being
the number of observations).
# NOT RUN {
## 1- Simulate a max-stable random field
n.site <- 35
locations <- matrix(runif(2*n.site, 0, 10), ncol = 2)
colnames(locations) <- c("lon", "lat")
data <- rmaxstab(50, locations, cov.mod = "whitmat", nugget = 0, range =
3, smooth = 0.5)
## 2- Transformation to non unit Frechet margins
param.loc <- -10 + 2 * locations[,2]
param.scale <- 5 + 2 * locations[,1]
param.shape <- rep(0.2, n.site)
for (i in 1:n.site)
data[,i] <- frech2gev(data[,i], param.loc[i], param.scale[i],
param.shape[i])
## 3- Fit a ''spatial GEV'' mdoel to data with the following models for
## the GEV parameters
form.loc <- loc ~ lat
form.scale <- scale ~ lon
form.shape <- shape ~ 1
fitspatgev(data, locations, form.loc, form.scale, form.shape)
# }
Run the code above in your browser using DataLab