profile2d {SpatialExtremes} | R Documentation |
Computes profile surfaces for fitted max-stable models.
## S3 method for class 'maxstab': profile2d(fitted, params, ranges, n = 10, plot = TRUE, ...)
fitted |
An object of class ``maxstab''. Most often, it will be
the output of the function fitmaxstab . |
params |
A character vector giving the two model parameters that are to be profiled. |
ranges |
A matrix corresponding to the ranges for the profiled model parameters that must be explored. Each row corresponds to one model parameter range. |
n |
Integer. The number of profiled model parameter that must be considered. |
plot |
Logical. If TRUE (default), the profile surface is
plotted. |
... |
Extra options that must be passed to the
plot function. |
A list with two arguments: coord
and llik
. coord
is a matrix representing the grid where the profiled model parameters
are fixed. llik
the corresponding pairwise log-likelihood.
This function can be really time consuming!
Mathieu Ribatet
require(RandomFields) ##Define the coordinates of each location n.site <- 30 locations <- matrix(rnorm(2*n.site, sd = sqrt(.2)), ncol = 2) colnames(locations) <- c("lon", "lat") ##Simulate a max-stable process - with unit Frechet margins ms0 <- MaxStableRF(locations[,1], locations[,2], grid=FALSE, model="wh", param=c(0,1,0,30, .5), maxstable="extr", n = 30) ms1 <- t(ms0) ##Now define the spatial model for the GEV parameters param.loc <- -10 + 2 * locations[,2] param.scale <- 5 + 2 * locations[,1] + locations[,2]^2 param.shape <- rep(0.2, n.site) ##Transform the unit Frechet margins to GEV for (i in 1:n.site) ms1[,i] <- param.scale[i] * (ms1[,i]^param.shape[i] - 1) / param.shape[i] + param.loc[i] ##Define a model for the GEV margins to be fitted ##shape ~ 1 stands for the GEV shape parameter is constant ##over the region loc.form <- loc ~ lat scale.form <- scale ~ lon + (lat^2) shape.form <- shape ~ 1 ##Fit a max-stable process ## 1- using the Schlather representation ## Not run: fitted <- fitmaxstab(ms1, locations, "schlather", loc.form, scale.form, shape.form) ## End(Not run) ##Plot the profile pairwise log-likelihood for the smooth parameter ## Not run: ranges <- rbind(c(9,11), c(.3, .8)) profile2d(fitted, c("range", "smooth"), ranges = ranges) ## End(Not run)