map {SpatialExtremes}R Documentation

Produces a 2D map from a fitted max-stable process

Description

Produces a 2D map from a fitted max-stable process.

Usage

map(fitted, param = "quant", ..., ret.per = 100, ranges =
apply(fitted$coord, 2, range), n = 80, col = terrain.colors(n),
plot.contour = TRUE)

Arguments

fitted An object of class maxstab. Most often, it will be the output of the function fitmaxstab.
param A character string. Must be one of "loc", "scale", "shape" or "quant" for a map of the location, scale, shape parameters or for a map of a specified quantile.
... Several arguments to be passed to the link{image} and contour functions.
ret.per A numeric giving the return period for which the quantile map is plotted. It is only required if param = "quant".
ranges A 2 by 2 matrix gving the ranges for the x and y axis. Each column corresponds to one axis.
n Integer giving the grid size for the map. It will need n^2 computations.
col A list of colors such as that generated by 'rainbow', 'heat.colors', 'topo.colors', 'terrain.colors' or similar functions.
plot.contour Logical. If TRUE (default), contour lines are added to the plot.

Value

A plot. Additionally, a list with the details for plotting the map is returned invisibly.

Author(s)

Mathieu Ribatet

See Also

condmap, filled.contour, heatmap, heat.colors, topo.colors, terrain.colors, rainbow

Examples

## Not run: 
require(RandomFields)

##Define the coordinate of each location
n.site <- 30
locations <- matrix(runif(2*n.site, 0, 10), 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 = 40)
ms0 <- t(ms0)
ms1 <- ms0

##Now define the spatial model for the GEV parameters
param.loc <- -10 - 4 * locations[,1] + locations[,2]^2
param.scale <- 5 + locations[,1] + locations[,2]^2 / 10
param.shape <- rep(.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 ~ lon + I(lat^2)
scale.form <- scale ~ lon + I(lat^2)
shape.form <- shape ~ lat + lon

##  1- Fit a max-stable process
schlather <- fitmaxstab(ms1, locations, "whitmat", loc.form, scale.form,
                        shape.form)

##  2- Produce a map of the location, scale and shape parameters
map(schlather, "loc", col = rainbow(80))
title("Location")
map(schlather, "scale", col = heat.colors(80))
title("Scale")
map(schlather, "shape", col = topo.colors(100))
title("Shape")
##  3- Produce a map for the 50 years return level
new.ranges <- cbind(c(0, 15), c(0, 15))
colnames(new.ranges) <- c("lon", "lat")

map(schlather, "quant", ret.per = 50 , ranges = new.ranges)
title("50-year return level")
## End(Not run)

[Package SpatialExtremes version 1.1-1 Index]