Last chance! 50% off unlimited learning
Sale ends in
This function fits various copula-based models to spatial extremes data sets.
fitcopula(data, coord, copula = "gaussian", cov.mod = "whitmat",
loc.form, scale.form, shape.form, marg.cov = NULL, temp.cov = NULL,
temp.form.loc = NULL, temp.form.scale = NULL, temp.form.shape = NULL,
..., start, control = list(maxit = 10000), method = "Nelder", std.err =
TRUE, warn = TRUE, corr = FALSE)
A matrix representing the data. Each column corresponds to one location.
A matrix that gives the coordinates of each location. Each row corresponds to one location.
A character string. Must be one of "gaussian" and "student" for a Gaussian and Student copula.
A character string corresponding to the correlation function family used in the copula. Must be one of "whitmat", "cauchy", "powexp", "bessel" or "caugen" for the Whittle-Matern, the Cauchy, the Powered Exponential, the Bessel and the Generalized Cauchy correlation families.
R formulas defining the
spatial linear model for the GEV parameters. May be missing. See
section Details of function fitmaxstab
.
Matrix with named columns giving additional covariates
for the GEV parameters. If NULL
, no extra covariates are
used.
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 of
function fitmaxstab
.
R formulas
defining the temporal trends for the GEV parameters. May be
missing. See section Details of function fitmaxstab
.
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.
A list giving the control parameters to be passed to
the optim
function.
Logical. Should the standard errors be computed ? The
default is to return the standard errors, i.e., std.err =
TRUE
.
Logical. If TRUE
(default), users are warned if
the log-likelihood is infinite at starting values and/or problems
arised while computing the standard errors.
Logical. If TRUE
(non default), the asymptotic
correlation matrix is computed.
This function returns a object of class copula
.
This function does not use max-stable copula and the use of non max-stable copula for modelling spatial extreme is highly questionable. This function was mainly implemented for educational purposes and not for concrete modelling purposes.
Davison, A.C., Padoan, S.A., Ribatet, M. (2010) Statistical Modelling of Spatial Extremes. Submitted to Statistical Science.
# NOT RUN {
n.site <- 30
n.obs <- 50
coord <- matrix(runif(2 * n.site, -10, 10), ncol = 2)
colnames(coord) <- c("lon", "lat")
## Generate data from a Gaussian copula model
data <- rcopula(n.obs, coord, "gaussian", "powexp", nugget = 0, range = 4, smooth = 1.2)
## Transform the margins to GEV
locs <- -5 + coord[,"lon"] / 10
scales <- 10 + coord[,"lat"] / 2
shapes <- rep(0.2, n.site)
for (i in 1:n.site)
data[,i] <- frech2gev(data[,i], locs[i], scales[i], shapes[i])
## Fit a Gaussian copula model
## 1. Define trend surfaces
loc.form <- y ~ lon
scale.form <- y ~ lat
shape.form <- y ~ 1
## 2. Fit
M0 <- fitcopula(data, coord, "gaussian", "powexp", loc.form, scale.form,
shape.form, nugget = 0)
# }
Run the code above in your browser using DataLab