Title: | Rmetrics - Bivariate Dependence Structures with Copulae |
Date: | 2023-01-03 |
Version: | 4022.85 |
Author: | Diethelm Wuertz [aut], Tobias Setz [aut], Yohan Chalabi [ctb], Paul Smith [cre] |
Maintainer: | Paul Smith <paul@waternumbers.co.uk> |
Description: | Provides a collection of functions to manage, to investigate and to analyze bivariate financial returns by Copulae. Included are the families of Archemedean, Elliptical, Extreme Value, and Empirical Copulae. |
Depends: | R (≥ 2.15.1), timeDate, timeSeries, fBasics, fMultivar |
Imports: | grDevices, graphics, stats |
Suggests: | methods, RUnit, tcltk, mvtnorm, sn |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
URL: | https://www.rmetrics.org |
NeedsCompilation: | no |
Packaged: | 2023-01-07 20:15:28 UTC; paul |
Repository: | CRAN |
Date/Publication: | 2023-01-07 22:50:11 UTC |
Modelling Copulae and Dependence Structures
Description
The Rmetrics fCopulae
package is a collection of functions to
manage, to investigate and to analyze bivariate financial returns by
Copulae. Included are the families of Archemedean, Elliptical,
Extreme Value, and Empirical Copulae.
Details
Package: | fCopulae |
Type: | Package |
Version: | R 3.0.1 |
Date: | 2014 |
License: | GPL Version 2 or later |
Copyright: | (c) 1999-2014 Rmetrics Assiciation |
URL: | https://www.rmetrics.org |
1 Introduction
The package fCoplae
was written to explore and investigate
bivariate copulae and dependence structures.
2 Archimedean Copulae
This chapter contains functions for analysing and modeling Archemedean copulae.
Archimedean Copula Density, Probability and Random Numbers:
darchmCopula Computes Archimedean copula density parchmCopula Computes Archimedean copula probability rarchmCopula Generates Archimedean copula random variates
For the Gumbel Copula we have a fast implementation.
rgumbelCopula Generates fast gumbel random variates dgumbelCopula Computes bivariate Gumbel copula density pgumbelCopula Computes bivariate Gumbel copula probability
Archimedean Copula Dependency Structure:
archmTau Returns Kendall's tau for Archemedean copulae archmRho Returns Spearman's rho for Archemedean copulae
archmTailCoeff Computes tail dependence for Archimedean copulae archmTailPlot Plots Archimedean tail dependence function
Archimedean Copula Generator:
archmList Returns list of implemented Archimedean copulae archmParam Sets Default parameters for an Archimedean copula archmRange Returns the range of valid alpha values archmCheck Checks if alpha is in the valid range
Phi Computes Archimedean Phi, inverse and derivatives PhiSlider Displays interactively generator function Kfunc Computes Archimedean Density Kc and its Inverse KfuncSlider Displays interactively the density and concordance
Archemedean Copula Modeling:
archmCopulaSim Simulates bivariate elliptical copula archmCopulaFit Fits the paramter of an elliptical copula
Archemedean Copula Slider:
darchmSlider Displays interactively archimedean density parchmSlider Displays interactively Archimedean probability rarchmSlider Displays interactively Archimedean probability
3 Elliptical Copulae
This chapter contains functions for analysing and modeling elliptical copulae.
Elliptical Copula Density, Probability and Random Numbers:
dellipticalCopula Computes elliptical copula density pellipticalCopula Computes elliptical copula probability rellipticalCopula Generates elliptical copula variates
Elliptical Copula Slider:
dellipticalSlider Generates interactive plots of density pellipticalSlider Generates interactive plots of probability rellipticalSlider Generates interactive plots of random variates
Elliptical Copula Dependency Structures:
ellipticalTau Computes Kendall's tau for elliptical copulae ellipticalRho Computes Spearman's rho for elliptical copulae
ellipticalTailCoeff Computes tail dependence for elliptical copulae ellipticalTailPlot Plots tail dependence function
Elliptical Copula Generator:
ellipticalList Returns list of implemented Elliptical copulae ellipticalParam Sets default parameters for an elliptical copula ellipticalRange Returns the range of valid rho values ellipticalCheck Checks if rho is in the valid range
gfunc Generator function for elliptical distributions gfuncSlider Slider for generator, density and probability
Elliptical Copula Modeling:
ellipticalCopulaSim Simulates bivariate elliptical copula ellipticalCopulaFit Fits the paramter of an elliptical copula
4 Extreme Value Copulae
This chapter contains functions for analysing and modeling extreme value copulae.
Extremem Value Copula Density, Probability and Random Numbers:
devCopula Computes extreme value copula density pevCopula Computes extreme value copula probability revCopula Generates extreme value copula random variates
devSlider Displays interactively plots of density pevSlider Displays interactively plots of probability revSlider isplays interactively plots of random variates
Extreme Value Copula Dependeny Structures:
evTau Returns Kendall's tau for extreme value copulae evRho Returns Spearman's rho for extreme value copulae
evTailCoeff Computes tail dependence for extreme value copulae evTailCoeffSlider Plots extreme value tail dependence function
Extreme Value Copula Generator:
evList Returns list of implemented extreme value copulae evParam Sets Default parameters for an extreme value copula evCheck Checks if parameters are in the valid range evRange Returns the range of valid parameter values
Afunc Computes Dependence function AfuncSlider Displays interactively dependence function
Extreme Value Copula Modeling:
evCopulaSim Simulates bivariate extreme value copula evCopulaFit Fits the paramter of an extreme value copula
5 Empirical Copula.
This chapter contains functions for analysing and modeling empirical copulae.
Empirical Copulae Density and Probability:
pempiricalCopula Computes empirical copula probability dempiricalCopula Computes empirical copula density
About Rmetrics:
The fCopulae
Rmetrics package is written for educational
support in teaching "Computational Finance and Financial Engineering"
and licensed under the GPL.
Bivariate Archimedean Copulae
Description
A collection and description of functions to
investigate bivariate Archimedean copulae.
Archimedean Copulae Functions:
rarchmCopula | Generates Archimedean copula variates, |
parchmCopula | computes Archimedean copula probability, |
darchmCopula | computes Archimedean copula density, |
rarchmSlider | displays interactive plots of variates, |
parchmSlider | displays interactive plots of probability, |
darchmSlider | displays interactive plots of density. |
Special Copulae Functions:
rgumbelCopula | Generates Gumbel copula variates, |
pgumbelCopula | computes Gumbel copula probability, |
dgumbelCopula | computes Gumbel copula density. |
Usage
rarchmCopula(n, alpha = NULL, type = archmList())
parchmCopula(u = 0.5, v = u, alpha = NULL, type = archmList(), output =
c("vector", "list"), alternative = FALSE )
darchmCopula(u = 0.5, v = u, alpha = NULL, type = archmList(), output =
c("vector", "list"), alternative = FALSE )
rarchmSlider(B = 10)
parchmSlider(type = c("persp", "contour"), B = 10)
darchmSlider(type = c("persp", "contour"), B = 10)
rgumbelCopula(n, alpha = 2)
pgumbelCopula(u = 0.5, v = u, alpha = 2, output = c("vector", "list"))
dgumbelCopula(u = 0.5, v = u, alpha = 2, output = c("vector", "list"))
Arguments
alpha |
[Phi*][*archmCopula] - |
alternative |
[*Copula] - |
B |
[*Slider] - |
n |
[rarchmCopula] - |
output |
[*archmCopula] - |
type |
[*archmCopula] - |
u , v |
[*archmCopula] - |
Value
The function pcopula
returns a numeric matrix of probabilities
computed at grid positions x
|y
.
The function parchmCopula
returns a numeric matrix with values
computed for the Archemedean copula.
The function darchmCopula
returns a numeric matrix with values
computed for thedensity of the Archemedean copula.
The functions Phi*
return a numeric vector with the values
computed from the Archemedean generator, its derivatives, or its
inverse.
The functions cK
and cKInv
return a numeric vector with the
values of the density and inverse for Archimedian copulae.
Author(s)
Diethelm Wuertz for the Rmetrics R-port.
Bivariate Archimedean Copulae
Description
A collection and description of functions to
investigate bivariate Archimedean copulae.
Archimedean Copulae Functions:
archmTau | Computes Kendall's tau for Archimedean copulae, |
archmRho | computes Spearman's rho for Archimedean copulae, |
archmTailCoeff | computes tail dependence for Archimedean copulae, |
archmTailPlot | plots tail dependence for Archimedean copulae. |
Usage
archmTau(alpha = NULL, type = archmList(), lower = 1.0e-10)
archmRho(alpha = NULL, type = archmList(), method = c("integrate2d", "adapt"),
error = 1.0e-5)
archmTailCoeff(alpha = NULL, type = archmList())
archmTailPlot(alpha = NULL, type = archmList(), tail = c("Upper", "Lower"))
Arguments
alpha |
the parameter of the Archemedean copula. A numerical value. |
error |
[archmRho] - |
lower |
[archmTau] - |
tail |
[archmTailPlot] - |
type |
the type of the Archimedean copula. A character string ranging
beween |
method |
[archmRho] - |
Value
The function pcopula
returns a numeric matrix of probabilities
computed at grid positions x
|y
.
The function parchmCopula
returns a numeric matrix with values
computed for the Archemedean copula.
The function darchmCopula
returns a numeric matrix with values
computed for thedensity of the Archemedean copula.
The functions Phi*
return a numeric vector with the values
computed from the Archemedean generator, its derivatives, or its
inverse.
The functions cK
and cKInv
return a numeric vector with the
values of the density and inverse for Archimedian copulae.
Author(s)
Diethelm Wuertz for the Rmetrics R-port.
Bivariate Archimedean Copulae
Description
A collection and description of functions
concerned with the generator function for
the Archimedean copula and with functions
for setting and checking the distributional
parameters.
Functions:
evList | Returns list of implemented Archimedean copulae, |
archmParam | Sets default parameters for an Archimedean copula, |
archmRange | returns the range of valid rho values, |
archmCheck | checks if rho is in the valid range, |
Phi | Computes generator Phi, inverse and derivatives, |
PhiSlider | displays interactively generator function, |
Kfunc | computes copula density and its inverse, |
KfuncSlider | displays interactively density function. |
Usage
archmList()
archmParam(type = archmList())
archmRange(type = archmList(), B = Inf)
archmCheck(alpha, type = archmList())
Phi(x, alpha = NULL, type = archmList(), inv = FALSE, deriv = paste(0:2))
PhiSlider(B = 5)
Kfunc(x, alpha = NULL, type = archmList(), inv = FALSE, lower = 1.0e-8)
KfuncSlider(B = 5)
Arguments
alpha |
[Phi*][*archmCopula] - |
B |
[archmRange] - |
deriv |
[Phi] - |
inv |
[Phi][Kfunc] - |
lower |
[Kfunc] - |
type |
[*archmCopula][Phi][Kfunc] - |
x |
[Kfunc] - |
Value
The function Phi
returns a numeric vector with the values
computed from the Archemedean generator, its derivatives, or its
inverse.
The function Kfunc
returns a numeric vector with the
values of the density and inverse for Archimedian copulae.
Author(s)
Diethelm Wuertz for the Rmetrics R-port.
References
RB Nelson - An Introduction to Copulas
Examples
## archmList -
# Return list of implemented copulae:
archmList()
Bivariate Archimedean Copulae
Description
A collection and description of functions to
investigate bivariate Archimedean copulae.
Archimedean Copulae Functions:
archmCopulaSim | simulates an Archimedean copula, |
archmCopulaFit | fits the parameters of an Archimedean copula. |
Usage
archmCopulaSim(n, alpha = NULL, type = archmList())
archmCopulaFit(u, v = NULL, type = archmList(), ...)
Arguments
alpha |
[Phi*][*archmCopula] - |
n |
[rarchmCopula] - |
type |
the type of the Archimedean copula. A character string ranging
beween |
u , v |
[*archmCopula] - |
... |
[archmCopulaFit] - |
Value
The function pcopula
returns a numeric matrix of probabilities
computed at grid positions x
|y
.
The function parchmCopula
returns a numeric matrix with values
computed for the Archemedean copula.
The function darchmCopula
returns a numeric matrix with values
computed for thedensity of the Archemedean copula.
The functions Phi*
return a numeric vector with the values
computed from the Archemedean generator, its derivatives, or its
inverse.
The functions cK
and cKInv
return a numeric vector with the
values of the density and inverse for Archimedian copulae.
Author(s)
Diethelm Wuertz for the Rmetrics R-port.
Bivariate Copula Class
Description
A collection and description of functions to specify the
copula class and to investigate bivariate Frechet copulae.
The class representation and methods are:
fCOPULA | representation for an S4 object of class "fCOPULA", |
show | S4 print method. |
Frechet Copulae:
pfrechetCopula | computes Frechet copula probability. |
Usage
## S4 method for signature 'fCOPULA'
show(object)
pfrechetCopula(u = 0.5, v = u, type = c("m", "pi", "w"),
output = c("vector", "list"))
Arguments
object |
[show] - |
output |
[*frechetCopula] - |
type |
[*frechetCopula] - |
u , v |
two numeric values or vectors of the same length at which
the copula will be computed. If |
Details
The function pfrechetCopula
returns a numeric matrix of
probabilities computed at grid positions u
|v
. The
arguments u
and v
are two single values or two
numeric vectors of the same length. If v
is not specified
then the same values are taken as for u
. Alternatively,
u
may be given as a two column vector or as a list with
two entries as vectors. The first column or entry is taken as
u
and the second as v
.
Value
The print method show
returns an S4 object of
class "fCOPULA"
. The object contains the following slots:
@call |
the function call. |
@copula |
the name of the copula. |
@param |
a list whose elements specify the model parameters of the copula. |
@title |
a character string with the name of the copula. This can be overwritten specifying a user defined input argument. |
@description |
a character string with an optional user defined description. By default just the current date will be returned. |
The function pfrechetCopula
returns a numeric vector of
probabilities. An attribute named "control"
is added
which returns the name of the Frechet copula.
Author(s)
Diethelm Wuertz for the Rmetrics R-port.
Examples
## fCOPULA -
getClass("fCOPULA")
## pfrechet -
# The Frechet Copula - m:
pfrechetCopula(0.5)
pfrechetCopula(0.25, 0.75)
pfrechetCopula(runif(5))
## grid2d -
grid2d()
pfrechetCopula(grid2d())
Bivariate Copula Environment
Description
Set and Get functions for the Copula environment.
Bivariate Elliptical Copulae
Description
A collection and description of functions to investigate
bivariate elliptical copulae.
Elliptical Copulae Functions:
rellipticalCopula | Generates elliptical copula variates, |
pellipticalCopula | computes elliptical copula probability, |
dellipticalCopula | computes elliptical copula density, |
rellipticalSlider | displays interactive plots of variates, |
pellipticalSlider | displays interactive plots of probability, |
dellipticalSlider | displays interactive plots of density. |
Usage
rellipticalCopula(n, rho = 0.75, param = NULL, type = c("norm", "cauchy",
"t"))
pellipticalCopula(u = 0.5, v = u, rho = 0.75, param = NULL,
type = ellipticalList(), output = c("vector", "list"), border = TRUE)
dellipticalCopula(u = 0.5, v = u, rho = 0.75, param = NULL,
type = ellipticalList(), output = c("vector", "list"), border = TRUE)
rellipticalSlider(B = 100)
pellipticalSlider(type = c("persp", "contour"), B = 20)
dellipticalSlider(type = c("persp", "contour"), B = 20)
Arguments
B |
[*Slider] - |
border |
[pellipticalCopula][dellipticalCopula] - |
n |
[rellipticalCopula][ellipticalCopulaSim] - |
output |
[pellipticalCopula][dellipticalCopula] - |
rho |
[*ellipticalCopula] - |
param |
[*ellipticalCopula][gfunc] - |
type |
[*ellipticalCopula][gfunc] - |
u , v |
[*ellipticalCopula] - |
Value
Copula Functions:
The functions [rpd]ellipticalCopula
return a numeric vector
of random variates, probabilities, or densities for the specified
copula computed at grid coordinates u
|v
.
The functions [rpd]ellipticalSlider
display an interactive
graph of an perspective copula plot either for random variates,
probabilities or densities. Alternatively, an image underlayed
contour plot can be shown.
Copula Dependence Measures:
The functions ellipticalTau
and ellipticalRho
return
a numericc value for Kendall's Tau and Spearman's Rho.
Copula Tail Coefficient:
The function ellipticalTailCoeff
returns the coefficient of
tail dependence for a specified copula. The function
ellipticalTailPlot
displays a whole plot for the upper or
alternatively for the lower tail dependence as a function of
u
for a set of nine rho
values.
Copula Generator Function:
The function gfunc
computes the generator function for the
specified copula, by default the normal copula. If the argument
x
is missing, then the normalization constand lambda will
be returned, otherwise if x
is specified the values for the
function g(x) will be freturned. The selected type of copula
is added to the output as an attribute named "control"
.
The function gfuncSlider
allows to display interactively
the generator function, the marginal density, the marginal
probability, and the contours of the the bivariate density.
Copula Simulation and Parameter Fitting:
The function ellipticalCopulaSim
returns a numeric two-column
matrix with randomly generated variates for the specified copula.
The function ellipticalCopulaFit
returns a fit to empirical
data for the specified copula. The returned object is a list with
elements from the function nlminb
.
Author(s)
Diethelm Wuertz for the Rmetrics R-port.
Examples
## [rp]ellipticalCopula -
# Default Normal Copula:
rellipticalCopula(10)
pellipticalCopula(10)
## [rp]ellipticalCopula -
# Student-t Copula Probability and Density:
u <- grid2d(x = (0:25)/25)
pellipticalCopula(u, rho = 0.75, param = 4,
type = "t", output = "list")
d <- dellipticalCopula(u, rho = 0.75, param = 4,
type = "t", output = "list")
persp(d, theta = -40, phi = 30, col = "steelblue")
## ellipticalTau -
## ellipticalRho -
# Dependence Measures:
ellipticalTau(rho = -0.5)
ellipticalRho(rho = 0.75, type = "logistic", subdivisions = 100)
## ellipticalTailCoeff -
# Student-t Tail Coefficient:
ellipticalTailCoeff(rho = 0.25, param = 3, type = "t")
## gfunc -
# Generator Function:
plot(gfunc(x = 0:10), main = "Generator Function")
## ellipticalCopulaSim -
## ellipticalCopulaSim -
# Simualtion and Parameter Fitting:
rv <- ellipticalCopulaSim(n = 100, rho = 0.75)
ellipticalCopulaFit(rv)
Bivariate Elliptical Copulae
Description
A collection and description of functions to investigate
bivariate elliptical copulae.
Elliptical Copulae Functions:
ellipticalTau | Computes Kendall's tau for elliptical copulae, |
ellipticalRho | computes Spearman's rho for elliptical copulae, |
ellipticalTailCoeff | computes tail dependence for elliptical copulae, |
ellipticalTailPlot | plots tail dependence for elliptical copulae. |
Usage
ellipticalTau(rho)
ellipticalRho(rho, param = NULL, type = ellipticalList(), subdivisions = 500)
ellipticalTailCoeff(rho, param = NULL, type = c("norm", "cauchy", "t"))
ellipticalTailPlot(param = NULL, type = c("norm", "cauchy", "t"),
tail = c("Lower", "Upper"))
Arguments
rho |
[*ellipticalCopula] - |
param |
[*ellipticalCopula][gfunc] - |
subdivisions |
[ellipticalRho] - |
tail |
[ellipticalTailPlot] - |
type |
[*ellipticalCopula][gfunc] - |
Value
Copula Functions:
The functions [rpd]ellipticalCopula
return a numeric vector
of random variates, probabilities, or densities for the specified
copula computed at grid coordinates u
|v
.
The functions [rpd]ellipticalSlider
display an interactive
graph of an perspective copula plot either for random variates,
probabilities or densities. Alternatively, an image underlayed
contour plot can be shown.
Copula Dependence Measures:
The functions ellipticalTau
and ellipticalRho
return
a numericc value for Kendall's Tau and Spearman's Rho.
Copula Tail Coefficient:
The function ellipticalTailCoeff
returns the coefficient of
tail dependence for a specified copula. The function
ellipticalTailPlot
displays a whole plot for the upper or
alternatively for the lower tail dependence as a function of
u
for a set of nine rho
values.
Copula Generator Function:
The function gfunc
computes the generator function for the
specified copula, by default the normal copula. If the argument
x
is missing, then the normalization constand lambda will
be returned, otherwise if x
is specified the values for the
function g(x) will be freturned. The selected type of copula
is added to the output as an attribute named "control"
.
The function gfuncSlider
allows to display interactively
the generator function, the marginal density, the marginal
probability, and the contours of the the bivariate density.
Copula Simulation and Parameter Fitting:
The function ellipticalCopulaSim
returns a numeric two-column
matrix with randomly generated variates for the specified copula.
The function ellipticalCopulaFit
returns a fit to empirical
data for the specified copula. The returned object is a list with
elements from the function nlminb
.
Author(s)
Diethelm Wuertz for the Rmetrics R-port.
Examples
## [rp]ellipticalCopula -
# Default Normal Copula:
rellipticalCopula(10)
pellipticalCopula(10)
## [rp]ellipticalCopula -
# Student-t Copula Probability and Density:
u = grid2d(x = (0:25)/25)
pellipticalCopula(u, rho = 0.75, param = 4,
type = "t", output = "list")
d <- dellipticalCopula(u, rho = 0.75, param = 4,
type = "t", output = "list")
persp(d, theta = -40, phi = 30, col = "steelblue")
## ellipticalTau -
## ellipticalRho -
# Dependence Measures:
ellipticalTau(rho = -0.5)
ellipticalRho(rho = 0.75, type = "logistic", subdivisions = 100)
## ellipticalTailCoeff -
# Student-t Tail Coefficient:
ellipticalTailCoeff(rho = 0.25, param = 3, type = "t")
## gfunc -
# Generator Function:
plot(gfunc(x = 0:10), main = "Generator Function")
## ellipticalCopulaSim -
## ellipticalCopulaSim -
# Simualtion and Parameter Fitting:
rv <- ellipticalCopulaSim(n = 100, rho = 0.75)
ellipticalCopulaFit(rv)
Bivariate Elliptical Copulae
Description
A collection and description of functions
concerned with the generator function for
the elliptical copula and with functions
for setting and checking the distributional
parameters.
Functions:
ellipticalList | Returns list of implemented elliptical copulae, |
ellipticalParam | Sets default parameters for an elliptical copula, |
ellipticalRange | returns the range of valid rho values, |
ellipticalCheck | checks if rho is in the valid range, |
gfunc | Generator function for elliptical distributions, |
gfuncSlider | Slider for generator, density and probability. |
Usage
ellipticalList()
ellipticalParam(type = ellipticalList())
ellipticalRange(type = ellipticalList())
ellipticalCheck(rho = 0.75, param = NULL, type = ellipticalList())
gfunc(x, param = NULL, type = ellipticalList())
gfuncSlider(B = 10)
Arguments
B |
[*Slider] - |
rho |
[*ellipticalCopula] - |
param |
[*ellipticalCopula][gfunc] - |
type |
[*ellipticalCopula][gfunc] - |
x |
[gfunc] - |
Value
Copula Functions:
The functions [rpd]ellipticalCopula
return a numeric vector
of random variates, probabilities, or densities for the specified
copula computed at grid coordinates u
|v
.
The functions [rpd]ellipticalSlider
display an interactive
graph of an perspective copula plot either for random variates,
probabilities or densities. Alternatively, an image underlayed
contour plot can be shown.
Copula Dependence Measures:
The functions ellipticalTau
and ellipticalRho
return
a numericc value for Kendall's Tau and Spearman's Rho.
Copula Tail Coefficient:
The function ellipticalTailCoeff
returns the coefficient of
tail dependence for a specified copula. The function
ellipticalTailPlot
displays a whole plot for the upper or
alternatively for the lower tail dependence as a function of
u
for a set of nine rho
values.
Copula Generator Function:
The function gfunc
computes the generator function for the
specified copula, by default the normal copula. If the argument
x
is missing, then the normalization constand lambda will
be returned, otherwise if x
is specified the values for the
function g(x) will be freturned. The selected type of copula
is added to the output as an attribute named "control"
.
The function gfuncSlider
allows to display interactively
the generator function, the marginal density, the marginal
probability, and the contours of the the bivariate density.
Copula Simulation and Parameter Fitting:
The function ellipticalCopulaSim
returns a numeric two-column
matrix with randomly generated variates for the specified copula.
The function ellipticalCopulaFit
returns a fit to empirical
data for the specified copula. The returned object is a list with
elements from the function nlminb
.
Author(s)
Diethelm Wuertz for the Rmetrics R-port.
Examples
## ellipticalList -
# List implemented copulae:
ellipticalList()
## gfunc -
# Generator Function:
gfunc(x <- (0:10)/10, param = 2, type = "t")
## gfuncSlider -
# Try:
## Not run:
gfuncSlider()
## End(Not run)
Bivariate Elliptical Copulae
Description
A collection and description of functions to investigate
bivariate elliptical copulae.
Elliptical Copulae Functions:
ellipticalCopulaSim | simulates an elliptical copula, |
ellipticalCopulaFit | fits the parameters of an elliptical copula. |
Usage
ellipticalCopulaSim(n, rho = 0.75, param = NULL, type = c("norm", "cauchy", "t"))
ellipticalCopulaFit(u, v, type = c("norm", "cauchy", "t"), ...)
Arguments
n |
[rellipticalCopula][ellipticalCopulaSim] - |
rho |
[*ellipticalCopula] - |
param |
[*ellipticalCopula][gfunc] - |
type |
[*ellipticalCopula][gfunc] - |
u , v |
[*ellipticalCopula] - |
... |
[ellipticalCopulaFit] - |
Value
Copula Functions:
The functions [rpd]ellipticalCopula
return a numeric vector
of random variates, probabilities, or densities for the specified
copula computed at grid coordinates u
|v
.
The functions [rpd]ellipticalSlider
display an interactive
graph of an perspective copula plot either for random variates,
probabilities or densities. Alternatively, an image underlayed
contour plot can be shown.
Copula Dependence Measures:
The functions ellipticalTau
and ellipticalRho
return
a numericc value for Kendall's Tau and Spearman's Rho.
Copula Tail Coefficient:
The function ellipticalTailCoeff
returns the coefficient of
tail dependence for a specified copula. The function
ellipticalTailPlot
displays a whole plot for the upper or
alternatively for the lower tail dependence as a function of
u
for a set of nine rho
values.
Copula Generator Function:
The function gfunc
computes the generator function for the
specified copula, by default the normal copula. If the argument
x
is missing, then the normalization constand lambda will
be returned, otherwise if x
is specified the values for the
function g(x) will be freturned. The selected type of copula
is added to the output as an attribute named "control"
.
The function gfuncSlider
allows to display interactively
the generator function, the marginal density, the marginal
probability, and the contours of the the bivariate density.
Copula Simulation and Parameter Fitting:
The function ellipticalCopulaSim
returns a numeric two-column
matrix with randomly generated variates for the specified copula.
The function ellipticalCopulaFit
returns a fit to empirical
data for the specified copula. The returned object is a list with
elements from the function nlminb
.
Author(s)
Diethelm Wuertz for the Rmetrics R-port.
Examples
## [rp]ellipticalCopula -
# Default Normal Copula:
rellipticalCopula(10)
pellipticalCopula(10)
## [rp]ellipticalCopula -
# Student-t Copula Probability and Density:
u = grid2d(x = (0:25)/25)
# CHECK ERROR
# pellipticalCopula(u, rho = 0.75, param = 4,
# type = "t", output = "list")
# CHECK ERROR DONE
d = dellipticalCopula(u, rho = 0.75, param = 4,
type = "t", output = "list")
persp(d, theta = -40, phi = 30, col = "steelblue")
## ellipticalTau -
## ellipticalRho -
# Dependence Measures:
ellipticalTau(rho = -0.5)
ellipticalRho(rho = 0.75, type = "logistic", subdivisions = 100)
## ellipticalTailCoeff -
# Student-t Tail Coefficient:
ellipticalTailCoeff(rho = 0.25, param = 3, type = "t")
## gfunc -
# Generator Function:
plot(gfunc(x = 0:10), main = "Generator Function")
## ellipticalCopulaSim -
## ellipticalCopulaSim -
# Simualtion and Parameter Fitting:
rv <- ellipticalCopulaSim(n = 100, rho = 0.75)
ellipticalCopulaFit(rv)
Bivariate Empirical Copulae
Description
A collection and description of functions to investigate
bivariate empirical copulae.
Empirical Copulae Functions:
pempiricalCopula | computes empirical copula probability, |
dempiricalCopula | computes empirical copula density. |
Usage
pempiricalCopula(u, v, N = 10)
dempiricalCopula(u, v, N = 10)
Arguments
N |
[empiricalCopula] - |
u , v |
[*evCopula][*archmCopula] - |
Value
Th functions *Spec
return an S4 object
of class "fCOPULA"
. The object contains the following slots:
@call |
the function call. |
@copula |
the name of the copula. |
@param |
a list whose elements specify the model parameters. |
@title |
a character string with the name of the copula. This can be overwritten specifying a user defined input argument. |
@description |
a character string with an optional user defined description. By default just the current date when the test was applied will be returned. |
The function pcopula
returns a numeric matrix of probabilities
computed at grid positions x
|y
.
The function parchmCopula
returns a numeric matrix with values
computed for the Archemedean copula.
The function darchmCopula
returns a numeric matrix with values
computed for thedensity of the Archemedean copula.
The functions Phi*
return a numeric vector with the values
computed from the Archemedean generator, its derivatives, or its
inverse.
The functions cK
and cKInv
return a numeric vector with the
values of the density and inverse for Archimedian copulae.
Author(s)
Diethelm Wuertz for the Rmetrics R-port.
Bivariate Extreme Value Copulae
Description
A collection and description of functions to investigate
bivariate extreme value copulae.
Extreme Value Copulae Functions:
revCopula | Generates extreme value copula random variates, |
pevCopula | computes extreme value copula probability, |
devCopula | computes extreme value copula density, |
revSlider | displays interactive plots of extreme value random variates, |
pevSlider | displays interactive plots of extreme value probability, |
devSlider | displays interactive plots of extreme value density. |
Usage
revCopula(n, param = NULL, type = evList())
pevCopula(u = 0.5, v = u, param = NULL, type = evList(),
output = c("vector", "list"), alternative = FALSE )
devCopula(u = 0.5, v = u, param = NULL, type = evList(),
output = c("vector", "list"), alternative = FALSE )
revSlider(B = 10)
pevSlider(type = c("persp", "contour"), B = 10)
devSlider(type = c("persp", "contour"), B = 10)
Arguments
alternative |
[evRho][evTau][*evCopula] - |
B |
[*Slider] - |
n |
[revCopula][evCopulaSim] - |
output |
[*evCopula] - |
param |
[*ev*][A*] - |
type |
[*ev*][Afunc] - |
u , v |
[*evCopula][*archmCopula] - |
Value
The function pcopula
returns a numeric matrix of probabilities
computed at grid positions x
|y
.
The function parchmCopula
returns a numeric matrix with values
computed for the Archemedean copula.
The function darchmCopula
returns a numeric matrix with values
computed for thedensity of the Archemedean copula.
The functions Phi*
return a numeric vector with the values
computed from the Archemedean generator, its derivatives, or its
inverse.
The functions cK
and cKInv
return a numeric vector with the
values of the density and inverse for Archimedian copulae.
Author(s)
Diethelm Wuertz for the Rmetrics R-port.
Examples
## fCOPULA -
getClass("fCOPULA")
getSlots("fCOPULA")
## revCopula -
# Not yet implemented
# revCopula(n = 10, type = "galambos")
## pevCopula -
pevCopula(u = grid2d(), type = "galambos", output = "list")
## devCopula -
devCopula(u = grid2d(), type = "galambos", output = "list")
## AfuncSlider -
# Generator, try:
## Not run: AfuncSlider()
Bivariate Extreme Value Copulae
Description
A collection and description of functions to investigate
bivariate extreme value copulae.
Extreme Value Copulae Functions:
evTau | Computes Kendall's tau for extreme value copulae, |
evRho | computes Spearman's rho for extreme value copulae, |
evTailCoeff | computes tail dependence for extreme value copulae, |
evTailCoeffSlider | plots tail dependence for extreme value copulae. |
Usage
evTau(param = NULL, type = evList(), alternative = FALSE)
evRho(param = NULL, type = evList(), alternative = FALSE)
evTailCoeff(param = NULL, type = evList())
evTailCoeffSlider(B = 10)
Arguments
alternative |
[evRho][evTau][*evCopula] - |
B |
[*Slider] - |
param |
[*ev*][A*] - |
type |
[*ev*][Afunc] - |
Value
The function pcopula
returns a numeric matrix of probabilities
computed at grid positions x
|y
.
The function parchmCopula
returns a numeric matrix with values
computed for the Archemedean copula.
The function darchmCopula
returns a numeric matrix with values
computed for thedensity of the Archemedean copula.
The functions Phi*
return a numeric vector with the values
computed from the Archemedean generator, its derivatives, or its
inverse.
The functions cK
and cKInv
return a numeric vector with the
values of the density and inverse for Archimedian copulae.
Author(s)
Diethelm Wuertz for the Rmetrics R-port.
Examples
## fCOPULA -
getClass("fCOPULA")
getSlots("fCOPULA")
## revCopula -
# Not yet implemented
# revCopula(n = 10, type = "galambos")
## pevCopula -
pevCopula(u = grid2d(), type = "galambos", output = "list")
## devCopula -
devCopula(u = grid2d(), type = "galambos", output = "list")
## AfuncSlider -
# Generator, try:
## Not run: AfuncSlider()
Bivariate Extreme Value Copulae
Description
A collection and description of functions
concerned with the generator function for
the extreme value copula and with functions
for setting and checking the distributional
parameters.
Functions:
evList | Returns list of implemented extreme value copulae, |
evParam | sets default parameters for an extreme value copula, |
evRange | returns the range of valid rho values, |
evCheck | checks if rho is in the valid range, |
Afunc | computes dependence function, |
AfuncSlider | displays interactively dependence function. |
Usage
evList()
evParam(type = evList())
evRange(type = evList())
evCheck(param, type = evList())
Afunc(x, param = NULL, type = evList())
AfuncSlider()
Arguments
param |
distribution and copulae parameters. A numeric value or vector
of named parameters as required by the copula specified by the
variable |
type |
the type of the extreme value copula. A character string selected from: "gumbel", "galambos", "husler.reiss", "tawn", or "bb5". |
x |
a numeric value or vector ranging between zero and one. |
Value
The function pcopula
returns a numeric matrix of probabilities
computed at grid positions x
|y
.
The function parchmCopula
returns a numeric matrix with values
computed for the Archemedean copula.
The function darchmCopula
returns a numeric matrix with values
computed for thedensity of the Archemedean copula.
The functions Phi*
return a numeric vector with the values
computed from the Archemedean generator, its derivatives, or its
inverse.
The functions cK
and cKInv
return a numeric vector with the
values of the density and inverse for Archimedian copulae.
Author(s)
Diethelm Wuertz for the Rmetrics R-port.
Examples
## fCOPULA -
getClass("fCOPULA")
getSlots("fCOPULA")
## revCopula -
# Not yet implemented
# revCopula(n = 10, type = "galambos")
## pevCopula -
pevCopula(u = grid2d(), type = "galambos", output = "list")
## devCopula -
devCopula(u = grid2d(), type = "galambos", output = "list")
## AfuncSlider -
# Generator, try:
## Not run: AfuncSlider()
Bivariate Extreme Value Copulae
Description
A collection and description of functions to investigate
bivariate extreme value copulae.
Extreme Value Copulae Functions:
evCopulaSim | simulates an extreme value copula, |
evCopulaFit | fits the parameters of an extreme value copula. |
Usage
evCopulaSim(n, param = NULL, type = evList())
evCopulaFit(u, v = NULL, type = evList(), ...)
Arguments
n |
[revCopula][evCopulaSim] - |
param |
[*ev*][A*] - |
type |
[*ev*][Afunc] - |
u , v |
[*evCopula][*archmCopula] - |
... |
[evCopulaFit] - |
Value
The function pcopula
returns a numeric matrix of probabilities
computed at grid positions x
|y
.
The function parchmCopula
returns a numeric matrix with values
computed for the Archemedean copula.
The function darchmCopula
returns a numeric matrix with values
computed for thedensity of the Archemedean copula.
The functions Phi*
return a numeric vector with the values
computed from the Archemedean generator, its derivatives, or its
inverse.
The functions cK
and cKInv
return a numeric vector with the
values of the density and inverse for Archimedian copulae.
Author(s)
Diethelm Wuertz for the Rmetrics R-port.
Examples
## fCOPULA -
getClass("fCOPULA")
getSlots("fCOPULA")
## revCopula -
# Not yet implemented
# revCopula(n = 10, type = "galambos")
## pevCopula -
pevCopula(u = grid2d(), type = "galambos", output = "list")
## devCopula -
devCopula(u = grid2d(), type = "galambos", output = "list")
## AfuncSlider -
# Generator, try:
## Not run: AfuncSlider()