Learn R Programming

SpatialExtremes (version 2.0-0)

print.copula: Printing objects of class copula''

Description

A method for printing object of class ``copula''.

Usage

## S3 method for class 'copula':
print(x, digits = max(3, getOption("digits") - 3), ...)

Arguments

x
An object of class ``copula. Most often, x is the output of the fitcopula function.
digits
The number of digits to be printed.
...
Other options to be passed to the print function.

Value

  • Print several information on screen.

Examples

Run this code
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)
M0

Run the code above in your browser using DataLab