margtransf {ReturnCurves}R Documentation

Marginal Transformation

Description

Marginal transformation of a bivariate random vector to standard exponential margins following Coles and Tawn (1991). Variables within each margin are assumed identically distributed.

Usage

margtransf(data, qmarg = rep(0.95, 2), constrainedshape = TRUE)

Arguments

data

A matrix containing the data on the original margins.

qmarg

A vector containing the marginal quantile used to fit the Generalised Pareto Distribution (GPD) for each variable. Default is rep(0.95, 2).

constrainedshape

Logical. If TRUE (Default), the estimated shape parameter of the Generalised Pareto Distribution (GPD) is constrained to lie strictly above -1.

Details

Given a threshold value \(u\), each stationary random vector is transformed by using the empirical cumulative distribution function (cdf) below \(u\), and a Generalise Pareto Distribution (GPD) fit above \(u\).

The option to constrain \(\xi > -1\) is included as \(\xi \leq -1\) implies that the fitted upper endpoint of the distribution's support is the maximum data point. This situation is rarely encountered in practice.

Value

An object of S4 class margtransf.class. This object returns the arguments of the function, a slot parameters containing a matrix with the shape and scale parameters of the Generalised Pareto Distribution (GPD) for each variable, a slot thresh containing a vector with the threshold \(u\) above which the GPD is fitted, and a slot dataexp containing a matrix with the data on standard exponential margins.

The plot function takes an object of S4 class margtransf.class, and a which argument specifying the type of plot desired (see Examples):

"hist"

Plots the marginal distributions of the two variables on original and standard exponential margins.

"ts"

Plots the time series of the two variables on original and standard exponential margins.

"joint"

Plots the joint distribution of the two variables on original and standard exponential margins.

"all"

Plots all the above mentioned plots (default).

References

Coles SG, Tawn JA (1991). “Modelling Extreme Multivariate Events.” Journal of the Royal Statistical Society. Series B (Methodological), 53(2), 377–392. ISSN 00359246, doi: 10.1111/j.2517-6161.1991.tb01830.x.

Examples

library(ReturnCurves)

data(airdata)

n <- dim(airdata)[1]

margdata <- margtransf(airdata)

# Plots the marginal distributions of X and Y on original vs standard exponential margins
plot(margdata, which = "hist") 

# Plots the time series of X and Y on original vs standard exponential margins
plot(margdata, which = "ts") 

# Plots the joint distribution of X and Y on original vs standard exponential margins
plot(margdata, which = "joint") 

# Plots all the available plots
plot(margdata, which = "all") 

# To see the the S4 object's slots
str(margdata)

# To access the matrix with the data on standard exponential margins
margdata@dataexp


[Package ReturnCurves version 1.0 Index]