## 1- Random field generation
require(RandomFields)
n.site <- 30
locations <- matrix(runif(2*n.site, 0, 10), ncol = 2)
colnames(locations) <- c("lon", "lat")
ms0 <- MaxStableRF(locations[,1], locations[,2], model = "wh",
grid = FALSE, maxstable = "extr",
param = c(0, 1, 0, 3, 1), n = 60)
ms0 <- t(ms0)
## 2- Fit a max-stable processes
schlather <- fitmaxstab(ms0, locations, "whitmat",
fit.marge = FALSE)
## 3- Plot the extremal coefficient
extcoeff(schlather)Run the code above in your browser using DataLab