margtransf | R Documentation |
Marginal transformation of a bivariate random vector to standard exponential margins following \insertCiteColesTawn1991;textualReturnCurves. Variables within each margin are assumed identically distributed.
margtransf(data, qmarg = rep(0.95, 2), constrainedshape = TRUE)
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 |
constrainedshape |
Logical. If |
Given a threshold value \mjeqnuu, each stationary random vector is transformed by using the empirical cumulative distribution function (cdf) below \mjeqnuu, and a Generalise Pareto Distribution (GPD) fit above \mjeqnuu.
The option to constrain \mjeqn\xi > -1 is included as \mjeqn\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.
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 \mjeqnuu 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). |
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.