Title: | Statistical Inference of Vine Copulas |
---|---|
Description: | Provides tools for the statistical analysis of regular vine copula models, see Aas et al. (2009) <doi:10.1016/j.insmatheco.2007.02.001> and Dissman et al. (2013) <doi:10.1016/j.csda.2012.08.010>. The package includes tools for parameter estimation, model selection, simulation, goodness-of-fit tests, and visualization. Tools for estimation, selection and exploratory data analysis of bivariate copula models are also provided. |
Authors: | Thomas Nagler [aut, cre], Ulf Schepsmeier [aut], Jakob Stoeber [aut], Eike Christian Brechmann [aut], Benedikt Graeler [aut], Tobias Erhardt [aut], Carlos Almeida [ctb], Aleksey Min [ctb, ths], Claudia Czado [ctb, ths], Mathias Hofmann [ctb], Matthias Killiches [ctb], Harry Joe [ctb], Thibault Vatter [ctb] |
Maintainer: | Thomas Nagler <[email protected]> |
License: | GPL (>= 2) |
Version: | 2.5.2 |
Built: | 2024-11-12 11:05:45 UTC |
Source: | https://github.com/tnagler/vinecopula |
Provides tools for the statistical analysis of regular vine copula models, see Aas et al. (2009) <doi:10.1016/j.insmatheco.2007.02.001> and Dissman et al. (2013) <doi:10.1016/j.csda.2012.08.010>. The package includes tools for parameter estimation, model selection, simulation, goodness-of-fit tests, and visualization. Tools for estimation, selection and exploratory data analysis of bivariate copula models are also provided.
Vine copulas are a flexible class of dependence models consisting of bivariate building blocks (see e.g., Aas et al., 2009). This package is primarily made for the statistical analysis of vine copula models. The package includes tools for parameter estimation, model selection, simulation, goodness-of-fit tests, and visualization. Tools for estimation, selection and exploratory data analysis of bivariate copula models are also provided.
The DESCRIPTION file:
Package: | VineCopula |
Type: | Package |
Title: | Statistical Inference of Vine Copulas |
Version: | 2.5.2 |
Description: | Provides tools for the statistical analysis of regular vine copula models, see Aas et al. (2009) <doi:10.1016/j.insmatheco.2007.02.001> and Dissman et al. (2013) <doi:10.1016/j.csda.2012.08.010>. The package includes tools for parameter estimation, model selection, simulation, goodness-of-fit tests, and visualization. Tools for estimation, selection and exploratory data analysis of bivariate copula models are also provided. |
Authors@R: | c( person("Thomas", "Nagler",, "[email protected]", role = c("aut", "cre")), person("Ulf", "Schepsmeier",, "[email protected]", role = "aut"), person("Jakob", "Stoeber",, role = "aut"), person("Eike Christian", "Brechmann",, role = "aut"), person("Benedikt", "Graeler",, role = "aut"), person("Tobias", "Erhardt",, "[email protected]", role = "aut"), person("Carlos", "Almeida",, role = "ctb"), person("Aleksey", "Min",, role = c("ctb", "ths")), person("Claudia", "Czado",, role = c("ctb", "ths")), person("Mathias", "Hofmann",, role = "ctb"), person("Matthias", "Killiches",, role = "ctb"), person("Harry", "Joe",, role = "ctb"), person("Thibault", "Vatter",, role = "ctb") ) |
Depends: | R (>= 3.1.0) |
Imports: | graphics, grDevices, stats, utils, MASS, mvtnorm, methods, ADGofTest, lattice, parallel |
Suggests: | TSP, shiny, testthat, numDeriv, kdecopula (>= 0.8.0), network |
License: | GPL (>= 2) |
LazyLoad: | yes |
BugReports: | https://github.com/tnagler/VineCopula/issues |
URL: | https://github.com/tnagler/VineCopula |
RoxygenNote: | 7.3.2.9000 |
Encoding: | UTF-8 |
Roxygen: | list(markdown = TRUE) |
Repository: | https://tnagler.r-universe.dev |
RemoteUrl: | https://github.com/tnagler/vinecopula |
RemoteRef: | HEAD |
RemoteSha: | 5f101f722a9a366361c3b4e0270a4e9fa211bc45 |
Author: | Thomas Nagler [aut, cre], Ulf Schepsmeier [aut], Jakob Stoeber [aut], Eike Christian Brechmann [aut], Benedikt Graeler [aut], Tobias Erhardt [aut], Carlos Almeida [ctb], Aleksey Min [ctb, ths], Claudia Czado [ctb, ths], Mathias Hofmann [ctb], Matthias Killiches [ctb], Harry Joe [ctb], Thibault Vatter [ctb] |
Maintainer: | Thomas Nagler <[email protected]> |
The package VineCopula
is a continuation of the
package CDVine
by U. Schepsmeier and E. C. Brechmann (see Brechmann
and Schepsmeier (2013)). It includes all functions implemented in CDVine for
the bivariate case (BiCop-functions).
Maintainer: Thomas Nagler [email protected]
Authors:
Ulf Schepsmeier [email protected]
Jakob Stoeber
Eike Christian Brechmann
Benedikt Graeler
Tobias Erhardt [email protected]
Other contributors:
Carlos Almeida [contributor]
Aleksey Min [contributor, thesis advisor]
Claudia Czado [contributor, thesis advisor]
Mathias Hofmann [contributor]
Matthias Killiches [contributor]
Harry Joe [contributor]
Thibault Vatter [contributor]
Aas, K., C. Czado, A. Frigessi, and H. Bakken (2009). Pair-copula constructions of multiple dependence. Insurance: Mathematics and Economics 44 (2), 182-198.
Bedford, T. and R. M. Cooke (2001). Probability density decomposition for conditionally dependent random variables modeled by vines. Annals of Mathematics and Artificial intelligence 32, 245-268.
Bedford, T. and R. M. Cooke (2002). Vines - a new graphical model for dependent random variables. Annals of Statistics 30, 1031-1068.
Brechmann, E. C., C. Czado, and K. Aas (2012). Truncated regular vines in high dimensions with applications to financial data. Canadian Journal of Statistics 40 (1), 68-85.
Brechmann, E. C. and C. Czado (2011). Risk management with high-dimensional vine copulas: An analysis of the Euro Stoxx 50. Statistics & Risk Modeling, 30 (4), 307-342.
Brechmann, E. C. and U. Schepsmeier (2013). Modeling Dependence with C- and D-Vine Copulas: The R Package CDVine. Journal of Statistical Software, 52 (3), 1-27. doi:10.18637/jss.v052.i03.
Czado, C., U. Schepsmeier, and A. Min (2012). Maximum likelihood estimation of mixed C-vines with application to exchange rates. Statistical Modelling, 12(3), 229-255.
Dissmann, J. F., E. C. Brechmann, C. Czado, and D. Kurowicka (2013). Selecting and estimating regular vine copulae and application to financial returns. Computational Statistics & Data Analysis, 59 (1), 52-69.
Eschenburg, P. (2013). Properties of extreme-value copulas Diploma thesis, Technische Universitaet Muenchen https://mediatum.ub.tum.de/node?id=1145695
Joe, H. (1996). Families of m-variate distributions with given margins and m(m-1)/2 bivariate dependence parameters. In L. Rueschendorf, B. Schweizer, and M. D. Taylor (Eds.), Distributions with fixed marginals and related topics, pp. 120-141. Hayward: Institute of Mathematical Statistics.
Joe, H. (1997). Multivariate Models and Dependence Concepts. London: Chapman and Hall.
Knight, W. R. (1966). A computer method for calculating Kendall's tau with ungrouped data. Journal of the American Statistical Association 61 (314), 436-439.
Kurowicka, D. and R. M. Cooke (2006). Uncertainty Analysis with High Dimensional Dependence Modelling. Chichester: John Wiley.
Kurowicka, D. and H. Joe (Eds.) (2011). Dependence Modeling: Vine Copula Handbook. Singapore: World Scientific Publishing Co.
Nelsen, R. (2006). An introduction to copulas. Springer
Schepsmeier, U. and J. Stoeber (2014). Derivatives and Fisher information of
bivariate copulas. Statistical Papers, 55 (2), 525-542.
https://link.springer.com/article/10.1007/s00362-013-0498-x.
Schepsmeier, U. (2013) A goodness-of-fit test for regular vine copula models. Preprint https://arxiv.org/abs/1306.0818
Schepsmeier, U. (2015) Efficient information based goodness-of-fit tests for vine copula models with fixed margins. Journal of Multivariate Analysis 138, 34-52.
Stoeber, J. and U. Schepsmeier (2013). Estimating standard errors in regular
vine copula models. Computational Statistics, 28 (6), 2679-2707
https://link.springer.com/article/10.1007/s00180-013-0423-8#.
White, H. (1982) Maximum likelihood estimation of misspecified models, Econometrica, 50, 1-26.
Useful links:
The function as.copuladata
coerces an object (data.frame
,
matrix
, list
) to a copuladata
object.
as.copuladata(data)
as.copuladata(data)
data |
Either a |
Tobias Erhardt
data(daxreturns) data <- as.matrix(daxreturns) class(as.copuladata(data)) data <- as.data.frame(daxreturns) class(as.copuladata(data)) data <- as.list(daxreturns) names(data) <- names(daxreturns) class(as.copuladata(data))
data(daxreturns) data <- as.matrix(daxreturns) class(as.copuladata(data)) data <- as.data.frame(daxreturns) class(as.copuladata(data)) data <- as.list(daxreturns) names(data) <- names(daxreturns) class(as.copuladata(data))
This function computes the empirical Blomqvist's beta.
BetaMatrix(data)
BetaMatrix(data)
data |
An N x d data matrix. |
Matrix of the empirical Blomqvist's betas.
Ulf Schepsmeier
Blomqvist, N. (1950). On a measure of dependence between two random variables. The Annals of Mathematical Statistics, 21(4), 593-600.
Nelsen, R. (2006). An introduction to copulas. Springer
TauMatrix()
, BiCopPar2Beta()
,
RVinePar2Beta()
data(daxreturns) data <- as.matrix(daxreturns) # compute the empirical Blomqvist's betas BetaMatrix(data)
data(daxreturns) data <- as.matrix(daxreturns) # compute the empirical Blomqvist's betas BetaMatrix(data)
This function creates an object of class BiCop
and checks for
family/parameter consistency.
BiCop(family, par, par2 = 0, tau = NULL, check.pars = TRUE)
BiCop(family, par, par2 = 0, tau = NULL, check.pars = TRUE)
family |
An integer defining the bivariate copula family: |
par |
Copula parameter. |
par2 |
Second parameter for bivariate copulas with two parameters (t,
BB1, BB6, BB7, BB8, Tawn type 1 and type 2; default is |
tau |
numeric; value of Kendall's tau; has to lie in the interval
(-1, 1). Can only be used with one-parameter families and the t copula.
If |
check.pars |
logical; default is |
An object of class BiCop()
. It is a list containing
information about the bivariate copula. Its components are:
family , par , par2
|
copula family number and parameter(s), |
npars |
number of parameters, |
familyname |
name of the copula family, |
tau |
Kendall's tau, |
beta |
Blomqvist's beta, |
taildep |
lower and upper tail dependence coefficients, |
call |
the call that created the object. |
Objects of this class are also returned by the BiCopEst()
and
BiCopSelect()
functions. In this case, further information about
the fit is added.
For a comprehensive summary of the model, use summary(object)
;
to see all its contents, use str(object)
.
Thomas Nagler
BiCopPDF()
,
BiCopHfunc()
,
BiCopSim()
,
BiCopEst()
,
BiCopSelect()
,
plot.BiCop()
,
contour.BiCop()
## create BiCop object for bivariate t-copula obj <- BiCop(family = 2, par = 0.4, par2 = 6) obj ## see the object's content or a summary str(obj) summary(obj) ## a selection of functions that can be used with BiCop objects simdata <- BiCopSim(300, obj) # simulate data BiCopPDF(0.5, 0.5, obj) # evaluate density in (0.5,0.5) plot(obj) # surface plot of copula density contour(obj) # contour plot with standard normal margins print(obj) # brief overview of BiCop object summary(obj) # comprehensive overview of BiCop object
## create BiCop object for bivariate t-copula obj <- BiCop(family = 2, par = 0.4, par2 = 6) obj ## see the object's content or a summary str(obj) summary(obj) ## a selection of functions that can be used with BiCop objects simdata <- BiCopSim(300, obj) # simulate data BiCopPDF(0.5, 0.5, obj) # evaluate density in (0.5,0.5) plot(obj) # surface plot of copula density contour(obj) # contour plot with standard normal margins print(obj) # brief overview of BiCop object summary(obj) # comprehensive overview of BiCop object
This function evaluates the cumulative distribution function (CDF) of a given parametric bivariate copula.
BiCopCDF(u1, u2, family, par, par2 = 0, obj = NULL, check.pars = TRUE)
BiCopCDF(u1, u2, family, par, par2 = 0, obj = NULL, check.pars = TRUE)
u1 , u2
|
numeric vectors of equal length with values in |
family |
integer; single number or vector of size |
par |
numeric; single number or vector of size |
par2 |
numeric; single number or vector of size |
obj |
|
check.pars |
logical; default is |
If the family and parameter specification is stored in a BiCop()
object obj
, the alternative version
BiCopCDF(u1, u2, obj)
can be used.
A numeric vector of the bivariate copula distribution function
of the copula family
with parameter(s) par
, par2
evaluated at u1
and u2
.
The calculation of the cumulative distribution function (CDF) of the
Student's t copula (family = 2
) is only approximate. For numerical
reasons, the degree of freedom parameter (par2
) is rounded to an
integer before calculation of the CDF.
Eike Brechmann
BiCopPDF()
,
BiCopHfunc()
,
BiCopSim()
,
BiCop()
## simulate from a bivariate Clayton copula set.seed(123) cop <- BiCop(family = 3, par = 3.4) simdata <- BiCopSim(300, cop) ## evaluate the distribution function of the bivariate Clayton copula u1 <- simdata[,1] u2 <- simdata[,2] BiCopCDF(u1, u2, cop) ## select a bivariate copula for the simulated data cop <- BiCopSelect(u1, u2) summary(cop) ## and evaluate its CDF BiCopCDF(u1, u2, cop)
## simulate from a bivariate Clayton copula set.seed(123) cop <- BiCop(family = 3, par = 3.4) simdata <- BiCopSim(300, cop) ## evaluate the distribution function of the bivariate Clayton copula u1 <- simdata[,1] u2 <- simdata[,2] BiCopCDF(u1, u2, cop) ## select a bivariate copula for the simulated data cop <- BiCopSelect(u1, u2) summary(cop) ## and evaluate its CDF BiCopCDF(u1, u2, cop)
The function checks if a certain combination of copula family and parameters can be used within other functions of this package.
BiCopCheck(family, par, par2 = 0, ...)
BiCopCheck(family, par, par2 = 0, ...)
family |
An integer defining the bivariate copula family: |
par |
Copula parameter. |
par2 |
Second parameter for bivariate copulas with two parameters (t,
BB1, BB6, BB7, BB8, Tawn type 1 and type 2; default is |
... |
used internally. |
A logical indicating whether the family can be used with the parameter specification.
Thomas Nagler
## check parameter of Clayton copula BiCopCheck(3, 1) # works ## Not run: BiCopCheck(3, -1) # does not work (only positive parameter is allowed)
## check parameter of Clayton copula BiCopCheck(3, 1) # works ## Not run: BiCopCheck(3, -1) # does not work (only positive parameter is allowed)
This function creates a chi-plot of given bivariate copula data.
BiCopChiPlot(u1, u2, PLOT = TRUE, mode = "NULL", ...)
BiCopChiPlot(u1, u2, PLOT = TRUE, mode = "NULL", ...)
u1 , u2
|
Data vectors of equal length with values in |
PLOT |
Logical; whether the results are plotted. If |
mode |
Character; whether a general, lower or upper chi-plot is
calculated. Possible values are |
... |
Additional plot arguments. |
For observations the chi-plot is based on the following two quantities: the
chi-statistics
and the lambda-statistics
where ,
and
are the empirical distribution functions
of the uniform random variables
and
and of
, respectively. Further,
and
.
These quantities only depend on the ranks of the data and are scaled to the
interval .
measures a distance of a data point
to the center of the
bivariate data set, while
corresponds to a correlation
coefficient between dichotomized values of
and
. Under
independence it holds that
and
asymptotically, i.e., values of
close to zero indicate independence—corresponding to
.
When plotting these quantities, the pairs of will tend to be located above zero for
positively dependent margins and vice versa for negatively dependent
margins. Control bounds around zero indicate whether there is significant
dependence present.
If mode = "lower"
or "upper"
, the above quantities are
calculated only for those 's and
's which are
smaller/larger than the respective means of
u1
and
u2
.
lambda |
Lambda-statistics (x-axis). |
chi |
Chi-statistics (y-axis). |
control.bounds |
A 2-dimensional vector of bounds
|
Natalia Belgorodski, Ulf Schepsmeier
Abberger, K. (2004). A simple graphical method to explore tail-dependence in stock-return pairs. Discussion Paper, University of Konstanz, Germany.
Genest, C. and A. C. Favre (2007). Everything you always wanted to know about copula modeling but were afraid to ask. Journal of Hydrologic Engineering, 12 (4), 347-368.
BiCopMetaContour()
, BiCopKPlot()
,
BiCopLambda()
## chi-plots for bivariate Gaussian copula data # simulate copula data fam <- 1 tau <- 0.5 par <- BiCopTau2Par(fam, tau) cop <- BiCop(fam, par) set.seed(123) dat <- BiCopSim(500, cop) # create chi-plots op <- par(mfrow = c(1, 3)) BiCopChiPlot(dat[,1], dat[,2], xlim = c(-1,1), ylim = c(-1,1), main="General chi-plot") BiCopChiPlot(dat[,1], dat[,2], mode = "lower", xlim = c(-1,1), ylim = c(-1,1), main = "Lower chi-plot") BiCopChiPlot(dat[,1], dat[,2], mode = "upper", xlim = c(-1,1), ylim = c(-1,1), main = "Upper chi-plot") par(op)
## chi-plots for bivariate Gaussian copula data # simulate copula data fam <- 1 tau <- 0.5 par <- BiCopTau2Par(fam, tau) cop <- BiCop(fam, par) set.seed(123) dat <- BiCopSim(500, cop) # create chi-plots op <- par(mfrow = c(1, 3)) BiCopChiPlot(dat[,1], dat[,2], xlim = c(-1,1), ylim = c(-1,1), main="General chi-plot") BiCopChiPlot(dat[,1], dat[,2], mode = "lower", xlim = c(-1,1), ylim = c(-1,1), main = "Lower chi-plot") BiCopChiPlot(dat[,1], dat[,2], mode = "upper", xlim = c(-1,1), ylim = c(-1,1), main = "Upper chi-plot") par(op)
The function starts a shiny app which visualizes copula data and allows to compare it with overlays of density contours or simulated data from different copula families with fitted parameters. Several specifications for the margins are available.
BiCopCompare(u1, u2, familyset = NA, rotations = TRUE)
BiCopCompare(u1, u2, familyset = NA, rotations = TRUE)
u1 , u2
|
Data vectors of equal length with values in |
familyset |
Vector of bivariate copula families to select from.
The vector has to include at least one bivariate copula
family that allows for positive and one that allows for negative dependence.
If |
rotations |
If |
A BiCop()
object containing the model selected by the
user.
Matthias Killiches, Thomas Nagler
# load data data(daxreturns) # find a suitable copula family for the first two stocks ## Not run: fit <- BiCopCompare(daxreturns[, 1], daxreturns[, 2])
# load data data(daxreturns) # find a suitable copula family for the first two stocks ## Not run: fit <- BiCopCompare(daxreturns[, 1], daxreturns[, 2])
This function simulates from a parametric bivariate copula, where on of
the variables is fixed. I.e., we simulate either from
or
, which are both
conditional distribution functions of one variable given another.
BiCopCondSim( N, cond.val, cond.var, family, par, par2 = 0, obj = NULL, check.pars = TRUE )
BiCopCondSim( N, cond.val, cond.var, family, par, par2 = 0, obj = NULL, check.pars = TRUE )
N |
Number of observations simulated. |
cond.val |
numeric vector of length |
cond.var |
either |
family |
integer; single number or vector of size |
par |
numeric; single number or vector of size |
par2 |
numeric; single number or vector of size |
obj |
|
check.pars |
logical; default is |
If the family and parameter specification is stored in a BiCop()
object obj
, the alternative version
BiCopCondSim(N, cond.val, cond.var, obj)
can be used.
A length N
vector of simulated from conditional distributions
related to bivariate copula with family
and parameter(s) par
,
par2
.
Thomas Nagler
BiCopCDF()
, BiCopPDF()
,
RVineSim()
# create bivariate t-copula obj <- BiCop(family = 2, par = -0.7, par2 = 4) # simulate 500 observations of (U1, U2) sim <- BiCopSim(500, obj) hist(sim[, 1]) # data have uniform distribution hist(sim[, 2]) # data have uniform distribution # simulate 500 observations of (U2 | U1 = 0.7) sim1 <- BiCopCondSim(500, cond.val = 0.7, cond.var = 1, obj) hist(sim1) # not uniform! # simulate 500 observations of (U1 | U2 = 0.1) sim2 <- BiCopCondSim(500, cond.val = 0.1, cond.var = 2, obj) hist(sim2) # not uniform!
# create bivariate t-copula obj <- BiCop(family = 2, par = -0.7, par2 = 4) # simulate 500 observations of (U1, U2) sim <- BiCopSim(500, obj) hist(sim[, 1]) # data have uniform distribution hist(sim[, 2]) # data have uniform distribution # simulate 500 observations of (U2 | U1 = 0.7) sim1 <- BiCopCondSim(500, cond.val = 0.7, cond.var = 1, obj) hist(sim1) # not uniform! # simulate 500 observations of (U1 | U2 = 0.1) sim2 <- BiCopCondSim(500, cond.val = 0.1, cond.var = 2, obj) hist(sim2) # not uniform!
This function evaluates the derivative of a given parametric bivariate copula density with respect to its parameter(s) or one of its arguments.
BiCopDeriv( u1, u2, family, par, par2 = 0, deriv = "par", log = FALSE, obj = NULL, check.pars = TRUE )
BiCopDeriv( u1, u2, family, par, par2 = 0, deriv = "par", log = FALSE, obj = NULL, check.pars = TRUE )
u1 , u2
|
numeric vectors of equal length with values in |
family |
integer; single number or vector of size |
par |
numeric; single number or vector of size |
par2 |
integer; single number or vector of size |
deriv |
Derivative argument |
log |
Logical; if |
obj |
|
check.pars |
logical; default is |
If the family and parameter specification is stored in a BiCop()
object obj
, the alternative version
BiCopDeriv(u1, u2, obj, deriv = "par", log = FALSE)
can be used.
A numeric vector of the bivariate copula derivative
of the copula family
with parameter(s) par
, par2
with respect to deriv
,
evaluated at u1
and u2
.
Ulf Schepsmeier
Schepsmeier, U. and J. Stoeber (2014). Derivatives and Fisher
information of bivariate copulas. Statistical Papers, 55 (2), 525-542.
https://link.springer.com/article/10.1007/s00362-013-0498-x.
RVineGrad()
, RVineHessian()
,
BiCopDeriv2()
, BiCopHfuncDeriv()
,
BiCop()
## simulate from a bivariate Student-t copula set.seed(123) cop <- BiCop(family = 2, par = -0.7, par2 = 4) simdata <- BiCopSim(100, cop) ## derivative of the bivariate t-copula with respect to the first parameter u1 <- simdata[,1] u2 <- simdata[,2] BiCopDeriv(u1, u2, cop, deriv = "par") ## estimate a Student-t copula for the simulated data cop <- BiCopEst(u1, u2, family = 2) ## and evaluate its derivative w.r.t. the second argument u2 BiCopDeriv(u1, u2, cop, deriv = "u2")
## simulate from a bivariate Student-t copula set.seed(123) cop <- BiCop(family = 2, par = -0.7, par2 = 4) simdata <- BiCopSim(100, cop) ## derivative of the bivariate t-copula with respect to the first parameter u1 <- simdata[,1] u2 <- simdata[,2] BiCopDeriv(u1, u2, cop, deriv = "par") ## estimate a Student-t copula for the simulated data cop <- BiCopEst(u1, u2, family = 2) ## and evaluate its derivative w.r.t. the second argument u2 BiCopDeriv(u1, u2, cop, deriv = "u2")
This function evaluates the second derivative of a given parametric bivariate copula density with respect to its parameter(s) and/or its arguments.
BiCopDeriv2( u1, u2, family, par, par2 = 0, deriv = "par", obj = NULL, check.pars = TRUE )
BiCopDeriv2( u1, u2, family, par, par2 = 0, deriv = "par", obj = NULL, check.pars = TRUE )
u1 , u2
|
numeric vectors of equal length with values in |
family |
integer; single number or vector of size |
par |
Copula parameter. |
par2 |
integer; single number or vector of size |
deriv |
Derivative argument |
obj |
|
check.pars |
logical; default is |
If the family and parameter specification is stored in a BiCop()
object obj
, the alternative version
BiCopDeriv2(u1, u2, obj, deriv = "par")
can be used.
A numeric vector of the second-order bivariate copula derivative
of the copula family
with parameter(s) par
, par2
with respect to deriv
evaluated at u1
and u2
.
Ulf Schepsmeier, Jakob Stoeber
Schepsmeier, U. and J. Stoeber (2014). Derivatives and Fisher
information of bivariate copulas. Statistical Papers, 55 (2), 525-542.
https://link.springer.com/article/10.1007/s00362-013-0498-x.
RVineGrad()
, RVineHessian()
,
BiCopDeriv()
, BiCopHfuncDeriv()
, BiCop()
## simulate from a bivariate Student-t copula set.seed(123) cop <- BiCop(family = 2, par = -0.7, par2 = 4) simdata <- BiCopSim(100, cop) ## second derivative of the Student-t copula w.r.t. the first parameter u1 <- simdata[,1] u2 <- simdata[,2] BiCopDeriv2(u1, u2, cop, deriv = "par") ## estimate a Student-t copula for the simulated data cop <- BiCopEst(u1, u2, family = 2) ## and evaluate its second derivative w.r.t. the second argument u2 BiCopDeriv2(u1, u2, cop, deriv = "u2")
## simulate from a bivariate Student-t copula set.seed(123) cop <- BiCop(family = 2, par = -0.7, par2 = 4) simdata <- BiCopSim(100, cop) ## second derivative of the Student-t copula w.r.t. the first parameter u1 <- simdata[,1] u2 <- simdata[,2] BiCopDeriv2(u1, u2, cop, deriv = "par") ## estimate a Student-t copula for the simulated data cop <- BiCopEst(u1, u2, family = 2) ## and evaluate its second derivative w.r.t. the second argument u2 BiCopDeriv2(u1, u2, cop, deriv = "u2")
This function estimates the parameter(s) of a bivariate copula using either inversion of empirical Kendall's tau (for one parameter copula families only) or maximum likelihood estimation for implemented copula families.
BiCopEst( u1, u2, family, method = "mle", se = FALSE, max.df = 30, max.BB = list(BB1 = c(5, 6), BB6 = c(6, 6), BB7 = c(5, 6), BB8 = c(6, 1)), weights = NA )
BiCopEst( u1, u2, family, method = "mle", se = FALSE, max.df = 30, max.BB = list(BB1 = c(5, 6), BB6 = c(6, 6), BB7 = c(5, 6), BB8 = c(6, 1)), weights = NA )
u1 , u2
|
Data vectors of equal length with values in |
family |
An integer defining the bivariate copula family: |
method |
indicates the estimation method: either maximum
likelihood estimation ( |
se |
Logical; whether standard error(s) of parameter estimates is/are
estimated (default: |
max.df |
Numeric; upper bound for the estimation of the degrees of
freedom parameter of the t-copula (default: |
max.BB |
List; upper bounds for the estimation of the two parameters
(in absolute values) of the BB1, BB6, BB7 and BB8 copulas |
weights |
Numerical; weights for each observation (optional). |
If method = "itau"
, the function computes the empirical Kendall's tau
of the given copula data and exploits the one-to-one relationship of copula
parameter and Kendall's tau which is available for many one parameter
bivariate copula families (see BiCopPar2Tau()
and
BiCopTau2Par()
). The inversion of Kendall's tau is however not
available for all bivariate copula families (see above). If a two parameter
copula family is chosen and method = "itau"
, a warning message is
returned and the MLE is calculated.
For method = "mle"
copula parameters are estimated by maximum
likelihood using starting values obtained by method = "itau"
. If no
starting values are available by inversion of Kendall's tau, starting values
have to be provided given expert knowledge and the boundaries max.df
and max.BB
respectively. Note: The MLE is performed via numerical
maximization using the L_BFGS-B method. For the Gaussian, the t- and the
one-parametric Archimedean copulas we can use the gradients, but for the BB
copulas we have to use finite differences for the L_BFGS-B method.
A warning message is returned if the estimate of the degrees of freedom
parameter of the t-copula is larger than max.df
. For high degrees of
freedom the t-copula is almost indistinguishable from the Gaussian and it is
advised to use the Gaussian copula in this case. As a rule of thumb
max.df = 30
typically is a good choice. Moreover, standard errors of
the degrees of freedom parameter estimate cannot be estimated in this case.
An object of class BiCop()
, augmented with the following
entries:
se , se2
|
standard errors for the parameter estimates (if
|
nobs |
number of observations, |
logLik |
log likelihood |
AIC |
Aikaike's Informaton Criterion, |
BIC |
Bayesian's Informaton Criterion, |
emptau |
empirical value of Kendall's tau, |
p.value.indeptest |
p-value of the independence test. |
For a comprehensive summary of the fitted model, use summary(object)
;
to see all its contents, use str(object)
.
Ulf Schepsmeier, Eike Brechmann, Jakob Stoeber, Carlos Almeida
Joe, H. (1997). Multivariate Models and Dependence Concepts. Chapman and Hall, London.
BiCop()
,
BiCopPar2Tau()
,
BiCopTau2Par()
,
RVineSeqEst()
,
BiCopSelect()
,
## Example 1: bivariate Gaussian copula dat <- BiCopSim(500, 1, 0.7) u1 <- dat[, 1] v1 <- dat[, 2] # estimate parameters of Gaussian copula by inversion of Kendall's tau est1.tau <- BiCopEst(u1, v1, family = 1, method = "itau") est1.tau # short overview summary(est1.tau) # comprehensive overview str(est1.tau) # see all contents of the object # check if parameter actually coincides with inversion of Kendall's tau tau1 <- cor(u1, v1, method = "kendall") all.equal(BiCopTau2Par(1, tau1), est1.tau$par) # maximum likelihood estimate for comparison est1.mle <- BiCopEst(u1, v1, family = 1, method = "mle") summary(est1.mle) ## Example 2: bivariate Clayton and survival Gumbel copulas # simulate from a Clayton copula dat <- BiCopSim(500, 3, 2.5) u2 <- dat[, 1] v2 <- dat[, 2] # empirical Kendall's tau tau2 <- cor(u2, v2, method = "kendall") # inversion of empirical Kendall's tau for the Clayton copula BiCopTau2Par(3, tau2) BiCopEst(u2, v2, family = 3, method = "itau") # inversion of empirical Kendall's tau for the survival Gumbel copula BiCopTau2Par(14, tau2) BiCopEst(u2, v2, family = 14, method = "itau") # maximum likelihood estimates for comparison BiCopEst(u2, v2, family = 3, method = "mle") BiCopEst(u2, v2, family = 14, method = "mle")
## Example 1: bivariate Gaussian copula dat <- BiCopSim(500, 1, 0.7) u1 <- dat[, 1] v1 <- dat[, 2] # estimate parameters of Gaussian copula by inversion of Kendall's tau est1.tau <- BiCopEst(u1, v1, family = 1, method = "itau") est1.tau # short overview summary(est1.tau) # comprehensive overview str(est1.tau) # see all contents of the object # check if parameter actually coincides with inversion of Kendall's tau tau1 <- cor(u1, v1, method = "kendall") all.equal(BiCopTau2Par(1, tau1), est1.tau$par) # maximum likelihood estimate for comparison est1.mle <- BiCopEst(u1, v1, family = 1, method = "mle") summary(est1.mle) ## Example 2: bivariate Clayton and survival Gumbel copulas # simulate from a Clayton copula dat <- BiCopSim(500, 3, 2.5) u2 <- dat[, 1] v2 <- dat[, 2] # empirical Kendall's tau tau2 <- cor(u2, v2, method = "kendall") # inversion of empirical Kendall's tau for the Clayton copula BiCopTau2Par(3, tau2) BiCopEst(u2, v2, family = 3, method = "itau") # inversion of empirical Kendall's tau for the survival Gumbel copula BiCopTau2Par(14, tau2) BiCopEst(u2, v2, family = 14, method = "itau") # maximum likelihood estimates for comparison BiCopEst(u2, v2, family = 3, method = "mle") BiCopEst(u2, v2, family = 14, method = "mle")
This function allows to compare bivariate copula models across a number of families w.r.t. the fit statistics log-likelihood, AIC, and BIC. For each family, the parameters are estimated by maximum likelihood.
BiCopEstList(u1, u2, familyset = NA, weights = NA, rotations = TRUE, ...)
BiCopEstList(u1, u2, familyset = NA, weights = NA, rotations = TRUE, ...)
u1 , u2
|
Data vectors of equal length with values in |
familyset |
Vector of bivariate copula families to select from.
The vector has to include at least one bivariate copula
family that allows for positive and one that allows for negative dependence.
If |
weights |
Numerical; weights for each observation (optional). |
rotations |
If |
... |
further arguments passed to |
First all available copulas are fitted using maximum likelihood estimation.
Then the criteria are computed for all available copula families (e.g., if
u1
and u2
are negatively
dependent, Clayton, Gumbel, Joe, BB1, BB6, BB7 and BB8 and their survival
copulas are not considered) and the family with the minimum value is chosen.
For observations the AIC of a bivariate copula family
with parameter(s)
is defined as
where for one parameter
copulas and
for the two parameter t-, BB1, BB6, BB7 and BB8
copulas. Similarly, the BIC is given by
Evidently, if the BIC is chosen, the penalty for two parameter families is stronger than when using the AIC.
A list containing
models |
a list of |
summary |
a data frame containing the log-likelihoods, AICs, and BICs of all the fitted models. |
Thomas Nagler
Akaike, H. (1973). Information theory and an extension of the maximum likelihood principle. In B. N. Petrov and F. Csaki (Eds.), Proceedings of the Second International Symposium on Information Theory Budapest, Akademiai Kiado, pp. 267-281.
Schwarz, G. E. (1978). Estimating the dimension of a model. Annals of Statistics 6 (2), 461-464.
## compare models data(daxreturns) comp <- BiCopEstList(daxreturns[, 1], daxreturns[, 4])
## compare models data(daxreturns) comp <- BiCopEstList(daxreturns[, 1], daxreturns[, 4])
This function performs a goodness-of-fit test for bivariate copulas, either based on White's information matrix equality (White, 1982) as introduced by Huang and Prokhorov (2011) or based on Kendall's process (Wang and Wells, 2000; Genest et al., 2006). It computes the test statistics and p-values.
BiCopGofTest( u1, u2, family, par = 0, par2 = 0, method = "white", max.df = 30, B = 100, obj = NULL )
BiCopGofTest( u1, u2, family, par = 0, par2 = 0, method = "white", max.df = 30, B = 100, obj = NULL )
u1 , u2
|
Numeric vectors of equal length with values in |
family |
An integer defining the bivariate copula family: |
par |
Copula parameter (optional). |
par2 |
Second parameter for bivariate t-copula (optional); default:
|
method |
A string indicating the goodness-of-fit method: |
max.df |
Numeric; upper bound for the estimation of the degrees of
freedom parameter of the t-copula (default: |
B |
Integer; number of bootstrap samples (default: |
obj |
|
method = "white"
:
This goodness-of fit test uses the information
matrix equality of White (1982) and was investigated by Huang and Prokhorov
(2011). The main contribution is that under correct model specification the
Fisher Information can be equivalently calculated as minus the expected
Hessian matrix or as the expected outer product of the score function. The
null hypothesis is
against the alternative
where
is the expected Hessian matrix and
is the expected outer product of the score
function. For the calculation of the test statistic we use the consistent
maximum likelihood estimator
and the sample counter parts
of
and
. The
correction of the covariance-matrix in the test statistic for the
uncertainty in the margins is skipped. The implemented tests assumes that
where is no uncertainty in the margins. The correction can be found in Huang
and Prokhorov (2011). It involves two-dimensional integrals.
WARNING: For
the t-copula the test may be unstable. The results for the t-copula
therefore have to be treated carefully.method = "kendall"
:
This copula goodness-of-fit test is based on Kendall's process as
proposed by Wang and Wells (2000). For computation of p-values, the
parametric bootstrap described by Genest et al. (2006) is used. For
rotated copulas the input arguments are transformed and the goodness-of-fit
procedure for the corresponding non-rotated copula is used.
For method = "white"
:
p.value |
Asymptotic p-value. |
statistic |
The observed test statistic. |
For method ="kendall"
p.value.CvM |
Bootstrapped p-value of the goodness-of-fit
test using the Cramer-von Mises statistic (if |
p.value.KS |
Bootstrapped p-value of the goodness-of-fit test using the
Kolmogorov-Smirnov statistic (if |
statistic.CvM |
The observed Cramer-von Mises test statistic. |
statistic.KS |
The observed Kolmogorov-Smirnov test statistic. |
Ulf Schepsmeier, Wanling Huang, Jiying Luo, Eike Brechmann
Huang, W. and A. Prokhorov (2014). A goodness-of-fit test for copulas. Econometric Reviews, 33 (7), 751-771.
Wang, W. and M. T. Wells (2000). Model selection and semiparametric inference for bivariate failure-time data. Journal of the American Statistical Association, 95 (449), 62-72.
Genest, C., Quessy, J. F., and Remillard, B. (2006). Goodness-of-fit
Procedures for Copula Models Based on the Probability Integral Transformation.
Scandinavian Journal of Statistics, 33(2), 337-366.
Luo J. (2011). Stepwise estimation of D-vines with arbitrary specified
copula pairs and EDA tools. Diploma thesis, Technische Universitaet
Muenchen.
https://mediatum.ub.tum.de/?id=1079291.
White, H. (1982) Maximum likelihood estimation of misspecified models, Econometrica, 50, 1-26.
BiCopDeriv2()
, BiCopDeriv()
,
BiCopIndTest()
, BiCopVuongClarke()
# simulate from a bivariate Clayton copula simdata <- BiCopSim(100, 3, 2) u1 <- simdata[,1] u2 <- simdata[,2] # perform White's goodness-of-fit test for the true copula BiCopGofTest(u1, u2, family = 3) # perform White's goodness-of-fit test for the Frank copula BiCopGofTest(u1, u2, family = 5) # perform Kendall's goodness-of-fit test for the true copula BiCopGofTest(u1, u2, family = 3, method = "kendall", B=50) # perform Kendall's goodness-of-fit test for the Frank copula BiCopGofTest(u1, u2, family = 5, method = "kendall", B=50)
# simulate from a bivariate Clayton copula simdata <- BiCopSim(100, 3, 2) u1 <- simdata[,1] u2 <- simdata[,2] # perform White's goodness-of-fit test for the true copula BiCopGofTest(u1, u2, family = 3) # perform White's goodness-of-fit test for the Frank copula BiCopGofTest(u1, u2, family = 5) # perform Kendall's goodness-of-fit test for the true copula BiCopGofTest(u1, u2, family = 3, method = "kendall", B=50) # perform Kendall's goodness-of-fit test for the Frank copula BiCopGofTest(u1, u2, family = 5, method = "kendall", B=50)
Evaluate the conditional distribution function (h-function) of a given parametric bivariate copula.
BiCopHfunc(u1, u2, family, par, par2 = 0, obj = NULL, check.pars = TRUE) BiCopHfunc1(u1, u2, family, par, par2 = 0, obj = NULL, check.pars = TRUE) BiCopHfunc2(u1, u2, family, par, par2 = 0, obj = NULL, check.pars = TRUE)
BiCopHfunc(u1, u2, family, par, par2 = 0, obj = NULL, check.pars = TRUE) BiCopHfunc1(u1, u2, family, par, par2 = 0, obj = NULL, check.pars = TRUE) BiCopHfunc2(u1, u2, family, par, par2 = 0, obj = NULL, check.pars = TRUE)
u1 , u2
|
numeric vectors of equal length with values in |
family |
integer; single number or vector of size |
par |
numeric; single number or vector of size |
par2 |
numeric; single number or vector of size |
obj |
|
check.pars |
logical; default is |
The h-function is defined as the conditional distribution function of a bivariate copula, i.e.,
where , and
is a bivariate copula distribution
function with parameter(s)
.
For more details see Aas et al. (2009).
If the family and parameter specification is stored in a BiCop()
object obj
, the alternative versions
BiCopHfunc(u1, u2, obj) BiCopHfunc1(u1, u2, obj) BiCopHfunc2(u1, u2, obj)
can be used.
BiCopHfunc
returns a list with
hfunc1 |
Numeric vector of the conditional distribution
function (h-function) of the copula |
hfunc2 |
Numeric vector of the conditional distribution function
(h-function) of the copula |
BiCopHfunc1
is a faster version that only calculates hfunc1
;
BiCopHfunc2
only calculates hfunc2
.
Ulf Schepsmeier
Aas, K., C. Czado, A. Frigessi, and H. Bakken (2009). Pair-copula constructions of multiple dependence. Insurance: Mathematics and Economics 44 (2), 182-198.
BiCopHinv()
, BiCopPDF()
, BiCopCDF()
,
RVineLogLik()
, RVineSeqEst()
, BiCop()
data(daxreturns) # h-functions of the Gaussian copula cop <- BiCop(family = 1, par = 0.5) h <- BiCopHfunc(daxreturns[, 2], daxreturns[, 1], cop) # or using the fast versions h1 <- BiCopHfunc1(daxreturns[, 2], daxreturns[, 1], cop) h2 <- BiCopHfunc2(daxreturns[, 2], daxreturns[, 1], cop) all.equal(h$hfunc1, h1) all.equal(h$hfunc2, h2)
data(daxreturns) # h-functions of the Gaussian copula cop <- BiCop(family = 1, par = 0.5) h <- BiCopHfunc(daxreturns[, 2], daxreturns[, 1], cop) # or using the fast versions h1 <- BiCopHfunc1(daxreturns[, 2], daxreturns[, 1], cop) h2 <- BiCopHfunc2(daxreturns[, 2], daxreturns[, 1], cop) all.equal(h$hfunc1, h1) all.equal(h$hfunc2, h2)
This function evaluates the derivative of a given conditional parametric bivariate copula (h-function) with respect to its parameter(s) or one of its arguments.
BiCopHfuncDeriv( u1, u2, family, par, par2 = 0, deriv = "par", obj = NULL, check.pars = TRUE )
BiCopHfuncDeriv( u1, u2, family, par, par2 = 0, deriv = "par", obj = NULL, check.pars = TRUE )
u1 , u2
|
numeric vectors of equal length with values in |
family |
integer; single number or vector of size |
par |
numeric; single number or vector of size |
par2 |
integer; single number or vector of size |
deriv |
Derivative argument |
obj |
|
check.pars |
logical; default is |
If the family and parameter specification is stored in a BiCop()
object obj
, the alternative version
BiCopHfuncDeriv(u1, u2, obj, deriv = "par")
can be used.
A numeric vector of the conditional bivariate copula derivative
of the copula family
,
with parameter(s) par
, par2
,
with respect to deriv
,
evaluated at u1
and u2
.
Ulf Schepsmeier
Schepsmeier, U. and J. Stoeber (2014). Derivatives and Fisher
information of bivariate copulas. Statistical Papers, 55 (2), 525-542.
https://link.springer.com/article/10.1007/s00362-013-0498-x.
RVineGrad()
, RVineHessian()
,
BiCopDeriv2()
, BiCopDeriv2()
,
BiCopHfuncDeriv()
, BiCop()
## simulate from a bivariate Student-t copula set.seed(123) cop <- BiCop(family = 2, par = -0.7, par2 = 4) simdata <- BiCopSim(100, cop) ## derivative of the conditional Student-t copula ## with respect to the first parameter u1 <- simdata[,1] u2 <- simdata[,2] BiCopHfuncDeriv(u1, u2, cop, deriv = "par") ## estimate a Student-t copula for the simulated data cop <- BiCopEst(u1, u2, family = 2) ## and evaluate the derivative of the conditional copula ## w.r.t. the second argument u2 BiCopHfuncDeriv(u1, u2, cop, deriv = "u2")
## simulate from a bivariate Student-t copula set.seed(123) cop <- BiCop(family = 2, par = -0.7, par2 = 4) simdata <- BiCopSim(100, cop) ## derivative of the conditional Student-t copula ## with respect to the first parameter u1 <- simdata[,1] u2 <- simdata[,2] BiCopHfuncDeriv(u1, u2, cop, deriv = "par") ## estimate a Student-t copula for the simulated data cop <- BiCopEst(u1, u2, family = 2) ## and evaluate the derivative of the conditional copula ## w.r.t. the second argument u2 BiCopHfuncDeriv(u1, u2, cop, deriv = "u2")
This function evaluates the second derivative of a given conditional parametric bivariate copula (h-function) with respect to its parameter(s) and/or its arguments.
BiCopHfuncDeriv2( u1, u2, family, par, par2 = 0, deriv = "par", obj = NULL, check.pars = TRUE )
BiCopHfuncDeriv2( u1, u2, family, par, par2 = 0, deriv = "par", obj = NULL, check.pars = TRUE )
u1 , u2
|
numeric vectors of equal length with values in |
family |
integer; single number or vector of size |
par |
numeric; single number or vector of size |
par2 |
integer; single number or vector of size |
deriv |
Derivative argument |
obj |
|
check.pars |
logical; default is |
If the family and parameter specification is stored in a BiCop()
object obj
, the alternative version
BiCopHfuncDeriv2(u1, u2, obj, deriv = "par")
can be used.
A numeric vector of the second-order conditional bivariate copula derivative
of the copula family
with parameter(s) par
, par2
with respect to deriv
evaluated at u1
and u2
.
Ulf Schepsmeier, Jakob Stoeber
Schepsmeier, U. and J. Stoeber (2014). Derivatives and Fisher
information of bivariate copulas. Statistical Papers, 55 (2), 525-542.
https://link.springer.com/article/10.1007/s00362-013-0498-x.
RVineGrad()
, RVineHessian()
,
BiCopDeriv()
, BiCopDeriv2()
,
BiCopHfuncDeriv()
, BiCop()
## simulate from a bivariate Student-t copula set.seed(123) cop <- BiCop(family = 2, par = -0.7, par2 = 4) simdata <- BiCopSim(100, cop) ## second derivative of the conditional bivariate t-copula ## with respect to the first parameter u1 <- simdata[,1] u2 <- simdata[,2] BiCopHfuncDeriv2(u1, u2, cop, deriv = "par") ## estimate a Student-t copula for the simulated data cop <- BiCopEst(u1, u2, family = 2) ## and evaluate the derivative of the conditional copula ## w.r.t. the second argument u2 BiCopHfuncDeriv2(u1, u2, cop, deriv = "u2")
## simulate from a bivariate Student-t copula set.seed(123) cop <- BiCop(family = 2, par = -0.7, par2 = 4) simdata <- BiCopSim(100, cop) ## second derivative of the conditional bivariate t-copula ## with respect to the first parameter u1 <- simdata[,1] u2 <- simdata[,2] BiCopHfuncDeriv2(u1, u2, cop, deriv = "par") ## estimate a Student-t copula for the simulated data cop <- BiCopEst(u1, u2, family = 2) ## and evaluate the derivative of the conditional copula ## w.r.t. the second argument u2 BiCopHfuncDeriv2(u1, u2, cop, deriv = "u2")
Evaluate the inverse conditional distribution function (inverse h-function) of a given parametric bivariate copula.
BiCopHinv(u1, u2, family, par, par2 = 0, obj = NULL, check.pars = TRUE) BiCopHinv1(u1, u2, family, par, par2 = 0, obj = NULL, check.pars = TRUE) BiCopHinv2(u1, u2, family, par, par2 = 0, obj = NULL, check.pars = TRUE)
BiCopHinv(u1, u2, family, par, par2 = 0, obj = NULL, check.pars = TRUE) BiCopHinv1(u1, u2, family, par, par2 = 0, obj = NULL, check.pars = TRUE) BiCopHinv2(u1, u2, family, par, par2 = 0, obj = NULL, check.pars = TRUE)
u1 , u2
|
numeric vectors of equal length with values in |
family |
integer; single number or vector of size |
par |
numeric; single number or vector of size |
par2 |
numeric; single number or vector of size |
obj |
|
check.pars |
logical; default is |
The h-function is defined as the conditional distribution function of a bivariate copula, i.e.,
where , and
is a bivariate copula distribution
function with parameter(s)
.
For more details see Aas et al. (2009).
If the family and parameter specification is stored in a BiCop()
object obj
, the alternative version
BiCopHinv(u1, u2, obj), BiCopHinv1(u1, u2, obj), BiCopHinv2(u1, u2, obj)
can be used.
BiCopHinv
returns a list with
hinv1 |
Numeric vector of the inverse conditional distribution function
(inverse h-function) of the copula |
hinv2 |
Numeric vector of the inverse conditional distribution function
(inverse h-function) of the copula |
BiCopHinv1
is a faster version that only calculates hinv1
;
BiCopHinv2
only calculates hinv2
.
Ulf Schepsmeier, Thomas Nagler
Aas, K., C. Czado, A. Frigessi, and H. Bakken (2009). Pair-copula constructions of multiple dependence. Insurance: Mathematics and Economics 44 (2), 182-198.
BiCopHfunc()
, BiCopPDF()
, BiCopCDF()
,
RVineLogLik()
, RVineSeqEst()
, BiCop()
# inverse h-functions of the Gaussian copula cop <- BiCop(1, 0.5) hi <- BiCopHinv(0.1, 0.2, cop) # or using the fast versions hi1 <- BiCopHinv1(0.1, 0.2, cop) hi2 <- BiCopHinv2(0.1, 0.2, cop) all.equal(hi$hinv1, hi1) all.equal(hi$hinv2, hi2) # check if it is actually the inverse cop <- BiCop(3, 3) all.equal(0.2, BiCopHfunc1(0.1, BiCopHinv1(0.1, 0.2, cop), cop)) all.equal(0.1, BiCopHfunc2(BiCopHinv2(0.1, 0.2, cop), 0.2, cop))
# inverse h-functions of the Gaussian copula cop <- BiCop(1, 0.5) hi <- BiCopHinv(0.1, 0.2, cop) # or using the fast versions hi1 <- BiCopHinv1(0.1, 0.2, cop) hi2 <- BiCopHinv2(0.1, 0.2, cop) all.equal(hi$hinv1, hi1) all.equal(hi$hinv2, hi2) # check if it is actually the inverse cop <- BiCop(3, 3) all.equal(0.2, BiCopHfunc1(0.1, BiCopHinv1(0.1, 0.2, cop), cop)) all.equal(0.1, BiCopHfunc2(BiCopHinv2(0.1, 0.2, cop), 0.2, cop))
This function returns the p-value of a bivariate asymptotic independence
test based on Kendall's .
BiCopIndTest(u1, u2)
BiCopIndTest(u1, u2)
u1 , u2
|
Data vectors of equal length with values in |
The test exploits the asymptotic normality of the test statistic
where is the number of observations (length of
u1
) and
the empirical Kendall's tau of the data vectors
u1
and u2
. The p-value of the null hypothesis of bivariate independence
hence is asymptotically
where is the standard normal distribution function.
statistic |
Test statistic of the independence test. |
p.value |
P-value of the independence test. |
Jeffrey Dissmann
Genest, C. and A. C. Favre (2007). Everything you always wanted to know about copula modeling but were afraid to ask. Journal of Hydrologic Engineering, 12 (4), 347-368.
BiCopGofTest()
, BiCopPar2Tau()
,
BiCopTau2Par()
, BiCopSelect()
,RVineCopSelect()
, RVineStructureSelect()
## Example 1: Gaussian copula with large dependence parameter cop <- BiCop(1, 0.7) dat <- BiCopSim(500, cop) # perform the asymptotic independence test BiCopIndTest(dat[, 1], dat[, 2]) ## Example 2: Gaussian copula with small dependence parameter cop <- BiCop(1, 0.01) dat <- BiCopSim(500, cop) # perform the asymptotic independence test BiCopIndTest(dat[, 1], dat[, 2])
## Example 1: Gaussian copula with large dependence parameter cop <- BiCop(1, 0.7) dat <- BiCopSim(500, cop) # perform the asymptotic independence test BiCopIndTest(dat[, 1], dat[, 2]) ## Example 2: Gaussian copula with small dependence parameter cop <- BiCop(1, 0.01) dat <- BiCopSim(500, cop) # perform the asymptotic independence test BiCopIndTest(dat[, 1], dat[, 2])
A kernel density estimate of the copula density is visualized. The function
provides the same options as plot.BiCop()
. Further arguments can
be passed to kdecopula::kdecop()
to modify the estimate. The
kdecopula::kdecopula-package()
must be installed to use
this function.
BiCopKDE(u1, u2, type = "contour", margins, size, kde.pars = list(), ...)
BiCopKDE(u1, u2, type = "contour", margins, size, kde.pars = list(), ...)
u1 , u2
|
numeric vectors of equal length with values in |
type |
plot type; either |
margins |
only relevant for types |
size |
integer; the plot is based on values on a |
kde.pars |
list of arguments passed to
|
... |
optional arguments passed to |
For further details on estimation see kdecopula::kdecop()
.
Thomas Nagler
# simulate data from Joe copula cop <- BiCop(3, tau = 0.3) u <- BiCopSim(1000, cop) contour(cop) # true contours # kernel contours with standard normal margins BiCopKDE(u[, 1], u[, 2]) BiCopKDE(u[, 1], u[, 2], kde.pars = list(mult = 0.5)) # undersmooth BiCopKDE(u[, 1], u[, 2], kde.pars = list(mult = 2)) # oversmooth # kernel density with uniform margins BiCopKDE(u[, 1], u[, 2], type = "surface", zlim = c(0, 4)) plot(cop, zlim = c(0, 4)) # true density # kernel contours are also used in pairs.copuladata data(daxreturns) data <- as.copuladata(daxreturns) pairs(data[c(4, 5, 14, 15)])
# simulate data from Joe copula cop <- BiCop(3, tau = 0.3) u <- BiCopSim(1000, cop) contour(cop) # true contours # kernel contours with standard normal margins BiCopKDE(u[, 1], u[, 2]) BiCopKDE(u[, 1], u[, 2], kde.pars = list(mult = 0.5)) # undersmooth BiCopKDE(u[, 1], u[, 2], kde.pars = list(mult = 2)) # oversmooth # kernel density with uniform margins BiCopKDE(u[, 1], u[, 2], type = "surface", zlim = c(0, 4)) plot(cop, zlim = c(0, 4)) # true density # kernel contours are also used in pairs.copuladata data(daxreturns) data <- as.copuladata(daxreturns) pairs(data[c(4, 5, 14, 15)])
This function creates a Kendall's plot (K-plot) of given bivariate copula data.
BiCopKPlot(u1, u2, PLOT = TRUE, ...)
BiCopKPlot(u1, u2, PLOT = TRUE, ...)
u1 , u2
|
Data vectors of equal length with values in |
PLOT |
Logical; whether the results are plotted. If |
... |
Additional plot arguments. |
For observations the K-plot considers two quantities: First, the ordered values of
the empirical bivariate distribution function
and, second,
,
which are the expected values of the order statistics from a random sample
of size
of the random variable
under the null
hypothesis of independence between
and
.
can be calculated as follows
where
and is the corresponding density.
K-plots can be seen as the bivariate copula equivalent to QQ-plots. If the
points of a K-plot lie approximately on the diagonal , then
and
are approximately independent. Any deviation from
the diagonal line points towards dependence. In case of positive dependence,
the points of the K-plot should be located above the diagonal line, and vice
versa for negative dependence. The larger the deviation from the diagonal,
the stronger is the degree of dependency. There is a perfect positive
dependence if points
lie on the curve
located above the main diagonal. If points
however lie on the x-axis,
this indicates a perfect negative dependence between
and
.
W.in |
W-statistics (x-axis). |
Hi.sort |
H-statistics (y-axis). |
Natalia Belgorodski, Ulf Schepsmeier
Genest, C. and A. C. Favre (2007). Everything you always wanted to know about copula modeling but were afraid to ask. Journal of Hydrologic Engineering, 12 (4), 347-368.
BiCopMetaContour()
, BiCopChiPlot()
,
BiCopLambda()
, BiCopGofTest()
## Gaussian and Clayton copulas n <- 500 tau <- 0.5 # simulate from Gaussian copula fam <- 1 par <- BiCopTau2Par(fam, tau) cop1 <- BiCop(fam, par) set.seed(123) dat1 <- BiCopSim(n, cop1) # simulate from Clayton copula fam <- 3 par <- BiCopTau2Par(fam, tau) cop2 <- BiCop(fam, par) set.seed(123) dat2 <- BiCopSim(n, cop2) # create K-plots op <- par(mfrow = c(1, 2)) BiCopKPlot(dat1[,1], dat1[,2], main = "Gaussian copula") BiCopKPlot(dat2[,1], dat2[,2], main = "Clayton copula") par(op)
## Gaussian and Clayton copulas n <- 500 tau <- 0.5 # simulate from Gaussian copula fam <- 1 par <- BiCopTau2Par(fam, tau) cop1 <- BiCop(fam, par) set.seed(123) dat1 <- BiCopSim(n, cop1) # simulate from Clayton copula fam <- 3 par <- BiCopTau2Par(fam, tau) cop2 <- BiCop(fam, par) set.seed(123) dat2 <- BiCopSim(n, cop2) # create K-plots op <- par(mfrow = c(1, 2)) BiCopKPlot(dat1[,1], dat1[,2], main = "Gaussian copula") BiCopKPlot(dat2[,1], dat2[,2], main = "Clayton copula") par(op)
This function plots/returns the lambda-function of given bivariate copula data.
BiCopLambda( u1 = NULL, u2 = NULL, family = "emp", par = 0, par2 = 0, PLOT = TRUE, obj = NULL, ... )
BiCopLambda( u1 = NULL, u2 = NULL, family = "emp", par = 0, par2 = 0, PLOT = TRUE, obj = NULL, ... )
u1 , u2
|
Data vectors of equal length with values in |
family |
An integer defining the bivariate copula family or indicating
the empirical lambda-function: |
par |
Copula parameter; if the empirical lambda-function is chosen,
|
par2 |
Second copula parameter for t-, BB1, BB6, BB7 and BB8 copulas
(default: |
PLOT |
Logical; whether the results are plotted. If |
obj |
|
... |
Additional plot arguments. |
If the family and parameter specification is stored in a BiCop()
object obj
, the alternative versions
BiCopLambda(obj, PLOT = TRUE, ...)
and
BiCopLambda((u1, u2, obj, PLOT = TRUE, ...)
can be used.
empLambda |
If the empirical lambda-function is chosen and
|
theoLambda |
If the theoretical lambda-function is chosen and
|
The -function is characteristic for each bivariate copula
family and defined by Kendall's distribution function
:
with
For Archimedean copulas one has the following closed form expression
in terms of the generator function of the copula
:
where is the derivative of
. For
more details see Genest and Rivest (1993) or Schepsmeier (2010).
For the bivariate Gaussian and Student-t copula no closed form expression for
the theoretical -function exists. Therefore it is simulated based
on samples of size 1000. For all other implemented copula families there are
closed form expressions available.
The plot of the theoretical -function also shows the limits of
the
-function corresponding to Kendall's tau
and
Kendall's tau
(
).
For rotated bivariate copulas one has to transform the input arguments
u1
and/or u2
. In particular, for copulas rotated by 90 degrees
u1
has to be set to 1-u1
, for 270 degrees u2
to
1-u2
and for survival copulas u1
and u2
to 1-u1
and 1-u2
, respectively. Then -functions for the
corresponding non-rotated copula families can be considered.
Ulf Schepsmeier
Genest, C. and L.-P. Rivest (1993). Statistical inference procedures for bivariate Archimedean copulas. Journal of the American Statistical Association, 88 (423), 1034-1043.
Schepsmeier, U. (2010). Maximum likelihood estimation of C-vine pair-copula
constructions based on bivariate copulas from different families. Diploma
thesis, Technische Universitaet Muenchen.
https://mediatum.ub.tum.de/?id=1079296.
BiCopMetaContour()
, BiCopKPlot()
,
BiCopChiPlot()
, BiCop()
# simulate from Clayton copula cop <- BiCop(3, tau = 0.5) dat <- BiCopSim(1000, cop) # create lambda-function plots op <- par(mfrow = c(1, 3)) BiCopLambda(dat[, 1], dat[, 2]) # empirical lambda-function BiCopLambda(cop) # theoretical lambda-function BiCopLambda(dat[, 1], dat[, 2], cop) # both par(op)
# simulate from Clayton copula cop <- BiCop(3, tau = 0.5) dat <- BiCopSim(1000, cop) # create lambda-function plots op <- par(mfrow = c(1, 3)) BiCopLambda(dat[, 1], dat[, 2]) # empirical lambda-function BiCopLambda(cop) # theoretical lambda-function BiCopLambda(dat[, 1], dat[, 2], cop) # both par(op)
Note: This function is deprecated and only available for backwards
compatibility. See contour.BiCop()
for contour plots of
parametric copulas, and BiCopKDE()
for kernel estimates.
BiCopMetaContour( u1 = NULL, u2 = NULL, bw = 1, size = 100, levels = c(0.01, 0.05, 0.1, 0.15, 0.2), family = "emp", par = 0, par2 = 0, PLOT = TRUE, margins = "norm", margins.par = 0, xylim = NA, obj = NULL, ... )
BiCopMetaContour( u1 = NULL, u2 = NULL, bw = 1, size = 100, levels = c(0.01, 0.05, 0.1, 0.15, 0.2), family = "emp", par = 0, par2 = 0, PLOT = TRUE, margins = "norm", margins.par = 0, xylim = NA, obj = NULL, ... )
u1 , u2
|
Data vectors of equal length with values in |
bw |
Bandwidth (smoothing factor; default: |
size |
Number of grid points; default: |
levels |
Vector of contour levels. For Gaussian, Student-t or
exponential margins the default value ( |
family |
An integer defining the bivariate copula family or indicating
an empirical contour plot: |
par |
Copula parameter; if empirical contour plot, |
par2 |
Second copula parameter for t-, BB1, BB6, BB7, BB8, Tawn type 1
and type 2 copulas (default: |
PLOT |
Logical; whether the results are plotted. If |
margins |
Character; margins for the bivariate copula contour plot.
Possible margins are: |
margins.par |
Parameter(s) of the distribution of the margins if
necessary (default: |
xylim |
A 2-dimensional vector of the x- and y-limits. By default
( |
obj |
|
... |
Additional plot arguments. |
x |
A vector of length |
y |
A vector of length |
z |
A matrix of dimension
|
The combination family = 0
(independence copula) and
margins = "unif"
(uniform margins) is not possible because all
z
-values are equal.
Ulf Schepsmeier, Alexander Bauer
BiCopChiPlot()
, BiCopKPlot()
,
BiCopLambda()
## meta Clayton distribution with Gaussian margins cop <- BiCop(family = 1, tau = 0.5) BiCopMetaContour(obj = cop, main = "Clayton - normal margins") # better: contour(cop, main = "Clayton - normal margins") ## empirical contour plot with standard normal margins dat <- BiCopSim(1000, cop) BiCopMetaContour(dat[, 1], dat[, 2], bw = 2, family = "emp", main = "empirical - normal margins") # better: BiCopKDE(dat[, 1], dat[, 2], main = "empirical - normal margins") ## empirical contour plot with exponential margins BiCopMetaContour(dat[, 1], dat[, 2], bw = 2, main = "empirical - exponential margins", margins = "exp", margins.par = 1) # better: BiCopKDE(dat[, 1], dat[, 2], main = "empirical - exponential margins", margins = "exp")
## meta Clayton distribution with Gaussian margins cop <- BiCop(family = 1, tau = 0.5) BiCopMetaContour(obj = cop, main = "Clayton - normal margins") # better: contour(cop, main = "Clayton - normal margins") ## empirical contour plot with standard normal margins dat <- BiCopSim(1000, cop) BiCopMetaContour(dat[, 1], dat[, 2], bw = 2, family = "emp", main = "empirical - normal margins") # better: BiCopKDE(dat[, 1], dat[, 2], main = "empirical - normal margins") ## empirical contour plot with exponential margins BiCopMetaContour(dat[, 1], dat[, 2], bw = 2, main = "empirical - exponential margins", margins = "exp", margins.par = 1) # better: BiCopKDE(dat[, 1], dat[, 2], main = "empirical - exponential margins", margins = "exp")
This function transforms the bivariate copula family number into its character expression and vice versa.
BiCopName(family, short = TRUE)
BiCopName(family, short = TRUE)
family |
Bivariate copula family, either its number or its character expression (see table below).
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
short |
Logical; if the number of a bivariate copula family is used and
|
The transformed bivariate copula family (see table above).
Ulf Schepsmeier
## family number to character expression family <- 1 BiCopName(family, short = TRUE) # short version BiCopName(family, short = FALSE) # long version ## family character expression (short version) to number family <- "C" BiCopName(family) # as number ## family character expression (long version) to number family <- "Clayton" BiCopName(family) # as number ## vectors of families BiCopName(1:10) # as character expression BiCopName(c("Clayton","t","J")) # as number
## family number to character expression family <- 1 BiCopName(family, short = TRUE) # short version BiCopName(family, short = FALSE) # long version ## family character expression (short version) to number family <- "C" BiCopName(family) # as number ## family character expression (long version) to number family <- "Clayton" BiCopName(family) # as number ## vectors of families BiCopName(1:10) # as character expression BiCopName(c("Clayton","t","J")) # as number
This function computes the theoretical Blomqvist's beta value of a bivariate copula for given parameter values.
BiCopPar2Beta(family, par, par2 = 0, obj = NULL, check.pars = TRUE)
BiCopPar2Beta(family, par, par2 = 0, obj = NULL, check.pars = TRUE)
family |
integer; single number or vector of size |
par |
numeric; single number or vector of size |
par2 |
numeric; single number or vector of size |
obj |
|
check.pars |
logical; default is |
If the family and parameter specification is stored in a BiCop()
object obj
, the alternative version
BiCopPar2Beta(obj)
can be used.
Theoretical value of Blomqvist's beta corresponding to the bivariate
copula family
and parameter(s) par
, par2
.
The number n
can be chosen arbitrarily, but must agree across
arguments.
Ulf Schepsmeier
Blomqvist, N. (1950). On a measure of dependence between two random variables. The Annals of Mathematical Statistics, 21(4), 593-600.
Nelsen, R. (2006). An introduction to copulas. Springer
## Example 1: Gaussian copula BiCopPar2Beta(family = 1, par = 0.7) BiCop(1, 0.7)$beta # alternative ## Example 2: Clayton copula BiCopPar2Beta(family = 3, par = 2) ## Example 3: different copula families BiCopPar2Beta(family = c(3,4,6), par = 2:4)
## Example 1: Gaussian copula BiCopPar2Beta(family = 1, par = 0.7) BiCop(1, 0.7)$beta # alternative ## Example 2: Clayton copula BiCopPar2Beta(family = 3, par = 2) ## Example 3: different copula families BiCopPar2Beta(family = c(3,4,6), par = 2:4)
This function computes the theoretical tail dependence coefficients of a bivariate copula for given parameter values.
BiCopPar2TailDep(family, par, par2 = 0, obj = NULL, check.pars = TRUE)
BiCopPar2TailDep(family, par, par2 = 0, obj = NULL, check.pars = TRUE)
family |
integer; single number or vector of size |
par |
numeric; single number or vector of size |
par2 |
numeric; single number or vector of size |
obj |
|
check.pars |
logical; default is |
If the family and parameter specification is stored in a BiCop
object
obj
, the alternative version
BiCopPar2TailDep(obj)
can be used.
lower |
Lower tail dependence coefficient for the given
bivariate copula
|
upper |
Upper tail dependence coefficient for the given bivariate
copula family
|
Lower and upper tail dependence coefficients for bivariate copula families
and parameters ( for one parameter families and the first
parameter of the t-copula with
degrees of freedom,
and
for the two parameter BB1, BB6, BB7 and BB8 copulas)
are given in the following table.
No. | Lower tail dependence | Upper tail dependence |
1 |
- | - |
2 |
|
|
3 |
|
- |
4 |
- | |
5 |
- | - |
6 |
- | |
7 |
|
|
8 |
- | |
9 |
|
|
10 |
- | if otherwise 0 |
13 |
- | |
14 |
|
- |
16 |
|
- |
17 |
|
|
18 |
|
- |
19 |
|
|
20 |
if otherwise 0 |
- |
23, 33 |
- | - |
24, 34 |
- | - |
26, 36 |
- | - |
27, 37 |
- | - |
28, 38 |
- | - |
29, 39 |
- | - |
30, 40 |
- | - |
104,204 |
- | |
114, 214 |
|
- |
124, 224 |
- | - |
134, 234 |
- | - |
The number n
can be chosen arbitrarily, but must agree across
arguments.
Eike Brechmann
Joe, H. (1997). Multivariate Models and Dependence Concepts. Chapman and Hall, London.
## Example 1: Gaussian copula BiCopPar2TailDep(1, 0.7) BiCop(1, 0.7)$taildep # alternative ## Example 2: Student-t copula BiCopPar2TailDep(2, c(0.6, 0.7, 0.8), 4) ## Example 3: different copula families BiCopPar2TailDep(c(3, 4, 6), 2)
## Example 1: Gaussian copula BiCopPar2TailDep(1, 0.7) BiCop(1, 0.7)$taildep # alternative ## Example 2: Student-t copula BiCopPar2TailDep(2, c(0.6, 0.7, 0.8), 4) ## Example 3: different copula families BiCopPar2TailDep(c(3, 4, 6), 2)
This function computes the theoretical Kendall's tau value of a bivariate copula for given parameter values.
BiCopPar2Tau(family, par, par2 = 0, obj = NULL, check.pars = TRUE)
BiCopPar2Tau(family, par, par2 = 0, obj = NULL, check.pars = TRUE)
family |
integer; single number or vector of size |
par |
numeric; single number or vector of size |
par2 |
numeric; single number or vector of size |
obj |
|
check.pars |
logical; default is |
If the family and parameter specification is stored in a BiCop()
object obj
, the alternative version
BiCopPar2Tau(obj)
can be used.
Theoretical value of Kendall's tau (vector) corresponding to the
bivariate copula family
and parameter vector
(par, par2)
.
No. (family ) |
Kendall's tau (tau ) |
1, 2 |
|
3, 13 |
|
4, 14 |
|
5 |
|
with (Debye function) |
|
6, 16 |
|
7, 17 |
|
8, 18 |
|
9, 19 |
|
10, 20 |
|
|
|
23, 33 |
|
24, 34 |
|
26, 36 |
|
27, 37 |
|
28, 38 |
|
29, 39 |
|
30, 40 |
|
|
|
104,114 |
|
with |
|
204,214 |
|
with |
|
124,134 |
|
with |
|
224,234 |
|
with |
|
The number n
can be chosen arbitrarily, but must agree across
arguments.
Ulf Schepsmeier, Tobias Erhardt
Joe, H. (1997). Multivariate Models and Dependence Concepts. Chapman and Hall, London.
Czado, C., U. Schepsmeier, and A. Min (2012). Maximum likelihood estimation of mixed C-vines with application to exchange rates. Statistical Modelling, 12(3), 229-255.
## Example 1: Gaussian copula tau0 <- 0.5 rho <- BiCopTau2Par(family = 1, tau = tau0) # transform back tau <- BiCopPar2Tau(family = 1, par = rho) tau - 2/pi*asin(rho) ## Example 2: vpar <- seq(from = 1.1, to = 10, length.out = 100) tauC <- BiCopPar2Tau(family = 3, par = vpar) tauG <- BiCopPar2Tau(family = 4, par = vpar) tauF <- BiCopPar2Tau(family = 5, par = vpar) tauJ <- BiCopPar2Tau(family = 6, par = vpar) plot(tauC ~ vpar, type = "l", ylim = c(0,1)) lines(tauG ~ vpar, col = 2) lines(tauF ~ vpar, col = 3) lines(tauJ ~ vpar, col = 4) ## Example 3: different copula families theta <- BiCopTau2Par(family = c(3,4,6), tau = c(0.4, 0.5, 0.6)) BiCopPar2Tau(family = c(3,4,6), par = theta)
## Example 1: Gaussian copula tau0 <- 0.5 rho <- BiCopTau2Par(family = 1, tau = tau0) # transform back tau <- BiCopPar2Tau(family = 1, par = rho) tau - 2/pi*asin(rho) ## Example 2: vpar <- seq(from = 1.1, to = 10, length.out = 100) tauC <- BiCopPar2Tau(family = 3, par = vpar) tauG <- BiCopPar2Tau(family = 4, par = vpar) tauF <- BiCopPar2Tau(family = 5, par = vpar) tauJ <- BiCopPar2Tau(family = 6, par = vpar) plot(tauC ~ vpar, type = "l", ylim = c(0,1)) lines(tauG ~ vpar, col = 2) lines(tauF ~ vpar, col = 3) lines(tauJ ~ vpar, col = 4) ## Example 3: different copula families theta <- BiCopTau2Par(family = c(3,4,6), tau = c(0.4, 0.5, 0.6)) BiCopPar2Tau(family = c(3,4,6), par = theta)
This function evaluates the probability density function (PDF) of a given parametric bivariate copula.
BiCopPDF(u1, u2, family, par, par2 = 0, obj = NULL, check.pars = TRUE)
BiCopPDF(u1, u2, family, par, par2 = 0, obj = NULL, check.pars = TRUE)
u1 , u2
|
numeric vectors of equal length with values in |
family |
integer; single number or vector of size |
par |
numeric; single number or vector of size |
par2 |
numeric; single number or vector of size |
obj |
|
check.pars |
logical; default is |
If the family and parameter specification is stored in a BiCop()
object obj
, the alternative version
BiCopPDF(u1, u2, obj)
can be used.
A numeric vector of the bivariate copula density
of the copula family
with parameter(s) par
, par2
evaluated at u1
and u2
.
Eike Brechmann
BiCopCDF()
, BiCopHfunc()
,
BiCopSim()
, BiCop()
## simulate from a bivariate Student-t copula cop <- BiCop(family = 2, par = -0.7, par2 = 4) simdata <- BiCopSim(100, cop) ## evaluate the density of the bivariate t-copula u1 <- simdata[,1] u2 <- simdata[,2] BiCopPDF(u1, u2, cop) ## select a bivariate copula for the simulated data fit <- BiCopSelect(u1, u2) summary(fit) ## and evaluate its PDF round(BiCopPDF(u1, u2, fit), 3)
## simulate from a bivariate Student-t copula cop <- BiCop(family = 2, par = -0.7, par2 = 4) simdata <- BiCopSim(100, cop) ## evaluate the density of the bivariate t-copula u1 <- simdata[,1] u2 <- simdata[,2] BiCopPDF(u1, u2, cop) ## select a bivariate copula for the simulated data fit <- BiCopSelect(u1, u2) summary(fit) ## and evaluate its PDF round(BiCopPDF(u1, u2, fit), 3)
This function selects an appropriate bivariate copula family for given bivariate copula data using one of a range of methods. The corresponding parameter estimates are obtained by maximum likelihood estimation.
BiCopSelect( u1, u2, familyset = NA, selectioncrit = "AIC", indeptest = FALSE, level = 0.05, weights = NA, rotations = TRUE, se = FALSE, presel = TRUE, method = "mle" )
BiCopSelect( u1, u2, familyset = NA, selectioncrit = "AIC", indeptest = FALSE, level = 0.05, weights = NA, rotations = TRUE, se = FALSE, presel = TRUE, method = "mle" )
u1 , u2
|
Data vectors of equal length with values in |
familyset |
Vector of bivariate copula families to select from.
The vector has to include at least one bivariate copula
family that allows for positive and one that allows for negative dependence.
If |
selectioncrit |
Character indicating the criterion for bivariate copula
selection. Possible choices: |
indeptest |
Logical; whether a hypothesis test for the independence of
|
level |
Numeric; significance level of the independence test (default:
|
weights |
Numerical; weights for each observation (optional). |
rotations |
If |
se |
Logical; whether standard error(s) of parameter estimates is/are
estimated (default: |
presel |
Logical; whether to exclude families before fitting based on symmetry properties of the data. Makes the selection about 30% faster (on average), but may yield slightly worse results in few special cases. |
method |
indicates the estimation method: either maximum
likelihood estimation ( |
Copulas can be selected according to the Akaike and Bayesian Information
Criteria (AIC and BIC, respectively). First all available copulas are fitted
using maximum likelihood estimation. Then the criteria are computed for all
available copula families (e.g., if u1
and u2
are negatively
dependent, Clayton, Gumbel, Joe, BB1, BB6, BB7 and BB8 and their survival
copulas are not considered) and the family with the minimum value is chosen.
For observations the AIC of a bivariate copula family
with parameter(s)
is defined as
where for one parameter
copulas and
for the two parameter t-, BB1, BB6, BB7 and BB8
copulas. Similarly, the BIC is given by
Evidently, if the BIC is chosen, the penalty for two parameter families is stronger than when using the AIC.
Additionally a test for independence can be performed beforehand.
An object of class BiCop()
, augmented with the following
entries:
se , se2
|
standard errors for the parameter estimates (if
|
nobs |
number of observations, |
logLik |
log likelihood |
AIC |
Aikaike's Informaton Criterion, |
BIC |
Bayesian's Informaton Criterion, |
emptau |
empirical value of Kendall's tau, |
p.value.indeptest |
p-value of the independence test. |
For a comprehensive summary of the fitted model, use
summary(object)
; to see all its contents, use str(object)
.
The parameters of the Student t and BB copulas are restricted (see
defaults in BiCopEst()
to avoid being to close to their limiting
cases.
Eike Brechmann, Jeffrey Dissmann, Thomas Nagler
Akaike, H. (1973). Information theory and an extension of the maximum likelihood principle. In B. N. Petrov and F. Csaki (Eds.), Proceedings of the Second International Symposium on Information Theory Budapest, Akademiai Kiado, pp. 267-281.
Brechmann, E. C. (2010). Truncated and simplified regular vines and their
applications. Diploma thesis, Technische Universitaet Muenchen.
https://mediatum.ub.tum.de/?id=1079285.
Manner, H. (2007). Estimation and model selection of copulas with an application to exchange rates. METEOR research memorandum 07/056, Maastricht University.
Schwarz, G. E. (1978). Estimating the dimension of a model. Annals of Statistics 6 (2), 461-464.
BiCop()
,
BiCopEst()
,
RVineStructureSelect()
,
RVineCopSelect()
,
BiCopIndTest()
,
## Example 1: Gaussian copula with large dependence parameter par <- 0.7 fam <- 1 dat1 <- BiCopSim(500, fam, par) # select the bivariate copula family and estimate the parameter(s) cop1 <- BiCopSelect(dat1[, 1], dat1[, 2], familyset = 1:10, indeptest = FALSE, level = 0.05) cop1 # short overview summary(cop1) # comprehensive overview str(cop1) # see all contents of the object ## Example 2: Gaussian copula with small dependence parameter par <- 0.01 fam <- 1 dat2 <- BiCopSim(500, fam, par) # select the bivariate copula family and estimate the parameter(s) cop2 <- BiCopSelect(dat2[, 1], dat2[, 2], familyset = 0:10, indeptest = TRUE, level = 0.05) summary(cop2) ## Example 3: empirical data data(daxreturns) cop3 <- BiCopSelect(daxreturns[, 1], daxreturns[, 4], familyset = 0:10) summary(cop3)
## Example 1: Gaussian copula with large dependence parameter par <- 0.7 fam <- 1 dat1 <- BiCopSim(500, fam, par) # select the bivariate copula family and estimate the parameter(s) cop1 <- BiCopSelect(dat1[, 1], dat1[, 2], familyset = 1:10, indeptest = FALSE, level = 0.05) cop1 # short overview summary(cop1) # comprehensive overview str(cop1) # see all contents of the object ## Example 2: Gaussian copula with small dependence parameter par <- 0.01 fam <- 1 dat2 <- BiCopSim(500, fam, par) # select the bivariate copula family and estimate the parameter(s) cop2 <- BiCopSelect(dat2[, 1], dat2[, 2], familyset = 0:10, indeptest = TRUE, level = 0.05) summary(cop2) ## Example 3: empirical data data(daxreturns) cop3 <- BiCopSelect(daxreturns[, 1], daxreturns[, 4], familyset = 0:10) summary(cop3)
This function simulates from a given parametric bivariate copula.
BiCopSim(N, family, par, par2 = 0, obj = NULL, check.pars = TRUE)
BiCopSim(N, family, par, par2 = 0, obj = NULL, check.pars = TRUE)
N |
Number of bivariate observations simulated. |
family |
integer; single number or vector of size |
par |
numeric; single number or vector of size |
par2 |
numeric; single number or vector of size |
obj |
|
check.pars |
logical; default is |
If the family and parameter specification is stored in a BiCop()
object obj
, the alternative version
BiCopSim(N, obj)
can be used.
An N
x 2 matrix of data simulated from the bivariate copula
with family
and parameter(s) par
, par2
.
Ulf Schepsmeier
# simulate from a bivariate t-copula simdata <- BiCopSim(100, 2, -0.7, par2 = 4) # or alternatively obj <- BiCop(family = 2, par = -0.7, par2 = 4) simdata2 <- BiCopSim(100, obj)
# simulate from a bivariate t-copula simdata <- BiCopSim(100, 2, -0.7, par2 = 4) # or alternatively obj <- BiCop(family = 2, par = -0.7, par2 = 4) simdata2 <- BiCopSim(100, obj)
This function computes the parameter of a (one parameter) bivariate copula for a given value of Kendall's tau.
BiCopTau2Par(family, tau, check.taus = TRUE)
BiCopTau2Par(family, tau, check.taus = TRUE)
family |
integer; single number or vector of size |
tau |
numeric; single number or vector of size |
check.taus |
logical; default is |
Parameter (vector) corresponding to the bivariate copula family and
the value(s) of Kendall's tau ().
No.
(family ) |
Parameter (par ) |
1, 2 |
|
3, 13 |
|
4, 14 |
|
5 |
no closed form expression (numerical inversion) |
6, 16 |
no closed form expression (numerical inversion) |
23, 33 |
|
24, 34 |
|
26, 36 |
no closed form expression (numerical inversion) |
The number n
can be chosen arbitrarily, but must agree across
arguments.
Jakob Stoeber, Eike Brechmann, Tobias Erhardt
Joe, H. (1997). Multivariate Models and Dependence Concepts. Chapman and Hall, London.
Czado, C., U. Schepsmeier, and A. Min (2012). Maximum likelihood estimation of mixed C-vines with application to exchange rates. Statistical Modelling, 12(3), 229-255.
## Example 1: Gaussian copula tau0 <- 0.5 rho <- BiCopTau2Par(family = 1, tau = tau0) BiCop(1, tau = tau0)$par # alternative ## Example 2: vtau <- seq(from = 0.1, to = 0.8, length.out = 100) thetaC <- BiCopTau2Par(family = 3, tau = vtau) thetaG <- BiCopTau2Par(family = 4, tau = vtau) thetaF <- BiCopTau2Par(family = 5, tau = vtau) thetaJ <- BiCopTau2Par(family = 6, tau = vtau) plot(thetaC ~ vtau, type = "l", ylim = range(thetaF)) lines(thetaG ~ vtau, col = 2) lines(thetaF ~ vtau, col = 3) lines(thetaJ ~ vtau, col = 4) ## Example 3: different copula families theta <- BiCopTau2Par(family = c(3,4,6), tau = c(0.4, 0.5, 0.6)) BiCopPar2Tau(family = c(3,4,6), par = theta)
## Example 1: Gaussian copula tau0 <- 0.5 rho <- BiCopTau2Par(family = 1, tau = tau0) BiCop(1, tau = tau0)$par # alternative ## Example 2: vtau <- seq(from = 0.1, to = 0.8, length.out = 100) thetaC <- BiCopTau2Par(family = 3, tau = vtau) thetaG <- BiCopTau2Par(family = 4, tau = vtau) thetaF <- BiCopTau2Par(family = 5, tau = vtau) thetaJ <- BiCopTau2Par(family = 6, tau = vtau) plot(thetaC ~ vtau, type = "l", ylim = range(thetaF)) lines(thetaG ~ vtau, col = 2) lines(thetaF ~ vtau, col = 3) lines(thetaJ ~ vtau, col = 4) ## Example 3: different copula families theta <- BiCopTau2Par(family = c(3,4,6), tau = c(0.4, 0.5, 0.6)) BiCopPar2Tau(family = c(3,4,6), par = theta)
Based on the Vuong and Clarke tests this function computes a goodness-of-fit score for each bivariate copula family under consideration. For each possible pair of copula families the Vuong and the Clarke tests decides which of the two families fits the given data best and assigns a score—pro or contra a copula family—according to this decision.
BiCopVuongClarke( u1, u2, familyset = NA, correction = FALSE, level = 0.05, rotations = TRUE )
BiCopVuongClarke( u1, u2, familyset = NA, correction = FALSE, level = 0.05, rotations = TRUE )
u1 , u2
|
Data vectors of equal length with values in |
familyset |
An integer vector of bivariate copula families under
consideration, i.e., which are compared in the goodness-of-fit test. If
|
correction |
Correction for the number of parameters. Possible
choices: |
level |
Numerical; significance level of the tests (default:
|
rotations |
If |
The Vuong as well as the Clarke test compare two models against each other
and based on their null hypothesis, allow for a statistically significant
decision among the two models (see the documentations of
RVineVuongTest()
and RVineClarkeTest()
for
descriptions of the two tests). In the goodness-of-fit test proposed by
Belgorodski (2010) this is used for bivariate copula selection. It compares
a model 0 to all other possible models under consideration. If model 0 is
favored over another model, a score of "+1" is assigned and similarly a
score of "-1" if the other model is determined to be superior. No score is
assigned, if the respective test cannot discriminate between two models.
Both tests can be corrected for the numbers of parameters used in the
copulas. Either no correction (correction = FALSE
), the Akaike
correction (correction = "Akaike"
) or the parsimonious Schwarz
correction (correction = "Schwarz"
) can be used.
The models compared here are bivariate parametric copulas and we would like
to determine which family fits the data better than the other families.
E.g., if we would like to test the hypothesis that the bivariate Gaussian
copula fits the data best, then we compare the Gaussian copula against all
other copulas under consideration. In doing so, we investigate the null
hypothesis "The Gaussian copula fits the data better than all other copulas
under consideration", which corresponds to times the hypothesis
"The Gaussian copula
fits the data better than copula
"
for all
, where
is the
number of bivariate copula families under consideration (length of
familyset
). This procedure is done not only for one family but for
all families under consideration, i.e., two scores, one based on the Vuong
and one based on the Clarke test, are returned for each bivariate copula
family. If used as a goodness-of-fit procedure, the family with the highest
score should be selected.
For more and detailed information about the goodness-of-fit test see Belgorodski (2010).
A matrix with Vuong test scores in the first and Clarke test scores in the second row. Column names correspond to bivariate copula families (see above).
Ulf Schepsmeier, Eike Brechmann, Natalia Belgorodski
Belgorodski, N. (2010) Selecting pair-copula families for regular vines with application to the multivariate analysis of European stock market indices Diploma thesis, Technische Universitaet Muenchen. https://mediatum.ub.tum.de/?id=1079284.
Clarke, K. A. (2007). A Simple Distribution-Free Test for Nonnested Model Selection. Political Analysis, 15, 347-363.
Vuong, Q. H. (1989). Ratio tests for model selection and non-nested hypotheses. Econometrica 57 (2), 307-333.
BiCopGofTest()
, RVineVuongTest()
,
RVineClarkeTest()
, BiCopSelect()
# simulate from a t-copula dat <- BiCopSim(500, 2, 0.7, 5) # apply the test for families 1-6 BiCopVuongClarke(dat[,1], dat[,2], familyset = 1:6)
# simulate from a t-copula dat <- BiCopSim(500, 2, 0.7, 5) # apply the test for families 1-6 BiCopVuongClarke(dat[,1], dat[,2], familyset = 1:6)
This function transforms a C-vine structure from the package CDVine to the corresponding R-vine structure.
C2RVine(order, family, par, par2 = rep(0, length(family)))
C2RVine(order, family, par, par2 = rep(0, length(family)))
order |
A d-dimensional vector specifying the order of the root nodes in the C-vine. |
family |
A d*(d-1)/2 vector of pair-copula families with values |
par |
A d*(d-1)/2 vector of pair-copula parameters. |
par2 |
A d*(d-1)/2 vector of second pair-copula parameters (optional;
default: |
An RVineMatrix()
object.
Ulf Schepsmeier, Eike Brechmann
# set up C-vine copula model with mixed pair-copulas d <- 4 dd <- d*(d-1)/2 order <- 1:d family <- c(1, 2, 3, 4, 7, 3) par <- c(0.5, 0.4, 2, 1.5, 1.2, 1.5) par2 <- c(0, 5, 0, 0, 2, 0) # transform to R-vine matrix notation RVM <- C2RVine(order, family, par, par2)
# set up C-vine copula model with mixed pair-copulas d <- 4 dd <- d*(d-1)/2 order <- 1:d family <- c(1, 2, 3, 4, 7, 3) par <- c(0.5, 0.4, 2, 1.5, 1.2, 1.5) par2 <- c(0, 5, 0, 0, 2, 0) # transform to R-vine matrix notation RVM <- C2RVine(order, family, par, par2)
RVineMatrix
objects.There are two plotting generics for RVineMatrix
objects.
plot.RVineMatrix
plots one or all trees of a given R-vine copula
model. Edges can be labeled with information about the corresponding
pair-copula. contour.RVineMatrix
produces a matrix of contour plots
(using plot.BiCop()
).
## S3 method for class 'RVineMatrix' contour(x, tree = "ALL", xylim = NULL, cex.nums = 1, data = NULL, ...) ## S3 method for class 'RVineMatrix' plot( x, tree = "ALL", type = 0, edge.labels = NULL, legend.pos = "bottomleft", interactive = FALSE, ... )
## S3 method for class 'RVineMatrix' contour(x, tree = "ALL", xylim = NULL, cex.nums = 1, data = NULL, ...) ## S3 method for class 'RVineMatrix' plot( x, tree = "ALL", type = 0, edge.labels = NULL, legend.pos = "bottomleft", interactive = FALSE, ... )
x |
|
tree |
|
xylim |
numeric vector of length 2; sets |
cex.nums |
numeric; expansion factor for font of the numbers. |
data |
a data matrix for creating kernel density contours of each pair. |
... |
Arguments passed to
|
type |
integer; specifies how to make use of variable names: |
edge.labels |
character; either a vector of edge labels or one of the
following: |
legend.pos |
the |
interactive |
logical; if TRUE, the user is asked to adjust the positioning of vertices with his mouse. |
If you want the contour boxes to be perfect squares, the plot height should
be 1.25/length(tree)*(d - min(tree))
times the plot width.
Thomas Nagler, Nicole Barthel
RVineMatrix()
,
network::plot.network()
,
plot.BiCop()
,
BiCopName()
,
graphics::legend()
## build vine model strucmat <- matrix(c(3, 1, 2, 0, 2, 1, 0, 0, 1), 3, 3) fammat <- matrix(c(0, 1, 6, 0, 0, 3, 0, 0, 0), 3, 3) parmat <- matrix(c(0, 0.3, 3, 0, 0, 1, 0, 0, 0), 3, 3) par2mat <- matrix(c(0, 0, 0, 0, 0, 0, 0, 0, 0), 3, 3) RVM <- RVineMatrix(strucmat, fammat, parmat, par2mat) # plot trees ## Not run: plot(RVM) # show contour plots contour(RVM)
## build vine model strucmat <- matrix(c(3, 1, 2, 0, 2, 1, 0, 0, 1), 3, 3) fammat <- matrix(c(0, 1, 6, 0, 0, 3, 0, 0, 0), 3, 3) parmat <- matrix(c(0, 0.3, 3, 0, 0, 1, 0, 0, 0), 3, 3) par2mat <- matrix(c(0, 0, 0, 0, 0, 0, 0, 0, 0), 3, 3) RVM <- RVineMatrix(strucmat, fammat, parmat, par2mat) # plot trees ## Not run: plot(RVM) # show contour plots contour(RVM)
This function transforms a D-vine structure from the package CDVine to the corresponding R-vine structure.
D2RVine(order, family, par, par2 = rep(0, length(family)))
D2RVine(order, family, par, par2 = rep(0, length(family)))
order |
A d-dimensional vector specifying the order of the nodes in the D-vine. |
family |
A d*(d-1)/2 vector of pair-copula families with values |
par |
A d*(d-1)/2 vector of pair-copula parameters. |
par2 |
A d*(d-1)/2 vector of second pair-copula parameters (optional;
default: |
An RVineMatrix()
object.
Ulf Schepsmeier
# set up D-vine copula model with mixed pair-copulas d <- 4 dd <- d*(d-1)/2 order <- 1:d family <- c(1, 2, 3, 4, 7, 3) par <- c(0.5, 0.4, 2, 1.5, 1.2, 1.5) par2 <- c(0, 5, 0, 0, 2, 0) # transform to R-vine matrix notation RVM <- D2RVine(order, family, par, par2)
# set up D-vine copula model with mixed pair-copulas d <- 4 dd <- d*(d-1)/2 order <- 1:d family <- c(1, 2, 3, 4, 7, 3) par <- c(0.5, 0.4, 2, 1.5, 1.2, 1.5) par2 <- c(0, 5, 0, 0, 2, 0) # transform to R-vine matrix notation RVM <- D2RVine(order, family, par, par2)
This data set contains transformed standardized residuals of daily log returns of 15 major German stocks represented in the index DAX observed from January 2005 to August 2009. Each time series is filtered using a GARCH(1,1) model with Student t innovations.
A data frame with 1158 observations on 15 variables. Column names correspond to ticker symbols of the stocks.
Yahoo! Finance
# load the data set data(daxreturns) # compute the empirical Kendall's tau matrix TauMatrix(daxreturns)
# load the data set data(daxreturns) # compute the empirical Kendall's tau matrix TauMatrix(daxreturns)
The empirical CDF with tail correction, ensuring that its output is never 0 or 1.
EmpCDF(x)
EmpCDF(x)
x |
numeric vector of observations |
The corrected empirical CDF is defined as
A function with signature function(x)
that returns .
# fit ECDF on simulated data x <- rnorm(100) cdf <- EmpCDF(x) # output is bounded away from 0 and 1 cdf(-50) cdf(50)
# fit ECDF on simulated data x <- rnorm(100) cdf <- EmpCDF(x) # output is bounded away from 0 and 1 cdf(-50) cdf(50)
This function provides pair plots for copula data. Using default setting it plots bivariate contour plots on the lower panel, scatter plots and correlations on the upper panel and histograms on the diagonal panel.
## S3 method for class 'copuladata' pairs( x, labels = names(x), ..., lower.panel = lp.copuladata, upper.panel = up.copuladata, diag.panel = dp.copuladata, label.pos = 0.85, cex.labels = 1, gap = 0, method = "kendall", ccols = terrain.colors(11), margins = "norm" )
## S3 method for class 'copuladata' pairs( x, labels = names(x), ..., lower.panel = lp.copuladata, upper.panel = up.copuladata, diag.panel = dp.copuladata, label.pos = 0.85, cex.labels = 1, gap = 0, method = "kendall", ccols = terrain.colors(11), margins = "norm" )
x |
|
labels |
variable names/labels. |
... |
other graphical parameters (see |
lower.panel |
panel function to be used on the lower diagonal panels (if not supplied, a default function is used) |
upper.panel |
panel function to be used on the upper diagonal panels (if not supplied, a default function is used) |
diag.panel |
panel function to be used on the diagonal panels (if not supplied, a default function is used) |
label.pos |
y position of labels in the diagonal panel; default:
|
cex.labels |
magnification to be used for the labels of the diagonal
panel; default: |
gap |
distance between subplots, in margin lines; default: |
method |
a character string indicating which correlation coefficients
are computed. One of |
ccols |
color to be used for the contour plots; default: |
margins |
character; margins for the contour plots. Options are: |
If the default panel functions are used
col
changes only the color of the points in the scatter plot
(upper.panel
)
cex
changes only the magnification of
the points in the scatter plot (upper.panel
)
Tobias Erhardt
graphics::pairs()
, as.copuladata()
,
BiCopKDE()
data(daxreturns) data <- as.copuladata(daxreturns) sel <- c(4,5,14,15) ## pairs plot with default settings pairs(data[sel]) ## pairs plot with custom settings nlevels <- 20 pairs(data[sel], cex = 2, pch = 1, col = "black", diag.panel = NULL, label.pos = 0.5, cex.labels = 2.5, gap = 1, method = "pearson", ccols = heat.colors(nlevels), margins = "flexp") ## pairs plot with own panel functions up <- function(x, y) { # upper panel: empirical contour plot op <- par(usr = c(-3, 3, -3, 3), new = TRUE) BiCopKDE(x, y, levels = c(0.01, 0.05, 0.1, 0.15, 0.2), margins = "exp", axes = FALSE) on.exit(par(op)) } lp <- function(x, y) { # lower panel: scatter plot (copula data) and correlation op <- par(usr = c(0, 1, 0, 1), new = TRUE) points(x, y, pch = 1, col = "black") r <- cor(x, y, method = "spearman") # Spearman's rho txt <- format(x = r, digits = 3, nsmall = 3)[1] text(x = 0.5, y = 0.5, labels = txt, cex = 1 + abs(r) * 2, col = "blue") on.exit(par(op)) } dp <- function(x) { # diagonal panel: histograms (copula data) op <- par(usr = c(0, 1, 0, 1.5), new = TRUE) hist(x, freq = FALSE, add = TRUE, col = "brown", border = "black", main = "") abline(h = 1, col = "black", lty = 2) on.exit(par(op)) } nlevels <- 20 pairs(data[sel], lower.panel = lp, upper.panel = up, diag.panel = dp, gap = 0.5)
data(daxreturns) data <- as.copuladata(daxreturns) sel <- c(4,5,14,15) ## pairs plot with default settings pairs(data[sel]) ## pairs plot with custom settings nlevels <- 20 pairs(data[sel], cex = 2, pch = 1, col = "black", diag.panel = NULL, label.pos = 0.5, cex.labels = 2.5, gap = 1, method = "pearson", ccols = heat.colors(nlevels), margins = "flexp") ## pairs plot with own panel functions up <- function(x, y) { # upper panel: empirical contour plot op <- par(usr = c(-3, 3, -3, 3), new = TRUE) BiCopKDE(x, y, levels = c(0.01, 0.05, 0.1, 0.15, 0.2), margins = "exp", axes = FALSE) on.exit(par(op)) } lp <- function(x, y) { # lower panel: scatter plot (copula data) and correlation op <- par(usr = c(0, 1, 0, 1), new = TRUE) points(x, y, pch = 1, col = "black") r <- cor(x, y, method = "spearman") # Spearman's rho txt <- format(x = r, digits = 3, nsmall = 3)[1] text(x = 0.5, y = 0.5, labels = txt, cex = 1 + abs(r) * 2, col = "blue") on.exit(par(op)) } dp <- function(x) { # diagonal panel: histograms (copula data) op <- par(usr = c(0, 1, 0, 1.5), new = TRUE) hist(x, freq = FALSE, add = TRUE, col = "brown", border = "black", main = "") abline(h = 1, col = "black", lty = 2) on.exit(par(op)) } nlevels <- 20 pairs(data[sel], lower.panel = lp, upper.panel = up, diag.panel = dp, gap = 0.5)
There are several options for plotting BiCop objects. The density of a
bivariate copula density can be visualized as surface/perspective or contour
plot. Optionally, the density can be coupled with standard normal margins
(default for contour plots). Furthermore, a lambda-plot is available (cf.,
BiCopLambda()
).
## S3 method for class 'BiCop' plot(x, type = "surface", margins, size, ...) ## S3 method for class 'BiCop' contour(x, margins = "norm", size = 100L, ...)
## S3 method for class 'BiCop' plot(x, type = "surface", margins, size, ...) ## S3 method for class 'BiCop' contour(x, margins = "norm", size = 100L, ...)
x |
|
type |
plot type; either |
margins |
only relevant for types |
size |
integer; only relevant for types |
... |
optional arguments passed to |
Thomas Nagler
BiCop()
, contour()
, lattice::wireframe()
## construct BiCop object for a Tawn copula obj <- BiCop(family = 104, par = 2.5, par2 = 0.4) ## plots plot(obj) # surface plot of copula density contour(obj) # contour plot with standard normal margins contour(obj, margins = "unif") # contour plot of copula density
## construct BiCop object for a Tawn copula obj <- BiCop(family = 104, par = 2.5, par2 = 0.4) ## plots plot(obj) # surface plot of copula density contour(obj) # contour plot with standard normal margins contour(obj, margins = "unif") # contour plot of copula density
Compute the pseudo-observations for the given data matrix.
pobs( x, na.last = "keep", ties.method = eval(formals(rank)$ties.method), lower.tail = TRUE )
pobs( x, na.last = "keep", ties.method = eval(formals(rank)$ties.method), lower.tail = TRUE )
x |
|
na.last , ties.method
|
are passed to |
lower.tail |
|
Given realizations
,
of a random vector
,
the pseudo-observations are defined via
for
and
, where
denotes the rank of
among all
,
. The
pseudo-observations can thus also be computed by component-wise applying the
empirical distribution functions to the data and scaling the result by
. This asymptotically negligible scaling factor is used to
force the variates to fall inside the open unit hypercube, for example, to
avoid problems with density evaluation at the boundaries. Note that
pobs(, lower.tail=FALSE)
simply returns 1-pobs()
.
matrix of the same dimensions as x
containing the
pseudo-observations.
This function is adapted from the copula
package.
Marius Hofert, Thomas Nagler
## Simple definition of the function: pobs ## simulate data from a multivariate normal distribution library(mvtnorm) set.seed(123) Sigma <- matrix(c(2, 1, -0.2, 1, 1, 0.3, -0.2, 0.3, 0.5), 3, 3) mu <- c(-3, 2, 1) dat <- rmvnorm(500, sigma = Sigma) pairs(dat) # plot observations ## compute pseudo-observations for copula inference udat <- pobs(dat) pairs(udat) # estimate vine copula model fit <- RVineStructureSelect(udat, familyset = c(1, 2))
## Simple definition of the function: pobs ## simulate data from a multivariate normal distribution library(mvtnorm) set.seed(123) Sigma <- matrix(c(2, 1, -0.2, 1, 1, 0.3, -0.2, 0.3, 0.5), 3, 3) mu <- c(-3, 2, 1) dat <- rmvnorm(500, sigma = Sigma) pairs(dat) # plot observations ## compute pseudo-observations for copula inference udat <- pobs(dat) pairs(udat) # estimate vine copula model fit <- RVineStructureSelect(udat, familyset = c(1, 2))
These functions calculate the Akaike and Bayesian Information criteria of a d-dimensional R-vine copula model for a given copula data set.
RVineAIC(data, RVM, par = RVM$par, par2 = RVM$par2) RVineBIC(data, RVM, par = RVM$par, par2 = RVM$par2)
RVineAIC(data, RVM, par = RVM$par, par2 = RVM$par2) RVineBIC(data, RVM, par = RVM$par, par2 = RVM$par2)
data |
An N x d data matrix (with uniform margins). |
RVM |
An |
par |
A d x d matrix with the pair-copula parameters (optional;
default: |
par2 |
A d x d matrix with the second parameters of pair-copula
families with two parameters (optional; default: |
If denotes the number of parameters of an R-vine copula model with
log-likelihood
and parameter set
, then the Akaike Information Criterion (AIC)
by Akaike (1973) is defined as
for observations
.
Similarly, the Bayesian Information Criterion (BIC) by Schwarz (1978) is given by
AIC , BIC
|
The computed AIC or BIC value, respectively. |
pair.AIC , pair.BIC
|
A d x d matrix of individual contributions to the
AIC or BIC value for each pair-copula, respectively. Note: |
Eike Brechmann
Akaike, H. (1973). Information theory and an extension of the maximum likelihood principle. In B. N. Petrov and F. Csaki (Eds.), Proceedings of the Second International Symposium on Information Theory Budapest, Akademiai Kiado, pp. 267-281.
Schwarz, G. E. (1978). Estimating the dimension of a model. Annals of Statistics 6 (2), 461-464.
RVineLogLik()
, RVineVuongTest()
,
RVineClarkeTest()
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names=c("V1", "V2", "V3", "V4", "V5")) # simulate a sample of size 300 from the R-vine copula model set.seed(123) simdata <- RVineSim(300,RVM) # compute AIC and BIC RVineAIC(simdata, RVM) RVineBIC(simdata, RVM)
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names=c("V1", "V2", "V3", "V4", "V5")) # simulate a sample of size 300 from the R-vine copula model set.seed(123) simdata <- RVineSim(300,RVM) # compute AIC and BIC RVineAIC(simdata, RVM) RVineBIC(simdata, RVM)
This function calculates the cumulative distribution function of a d-dimensional R-vine copula.
RVineCDF(data, RVM, N = 1000)
RVineCDF(data, RVM, N = 1000)
data |
An N x d data matrix that specifies where the CDF shall be evaluated. |
RVM |
An |
N |
Number of points to simulate for the Monte
Carlo integration (default: |
The cumulative distribution function of a -dimensional R-vine copula
cannot be expressed in closed form.
However, it can be calculated by numerical integration. The function uses
the
RVineSim()
function to
simulate a grid of points and then computes the CDF via Monte Carlo.
A vector of length N with the CDF values.
Thibault Vatter
RVineSim()
, RVineMatrix()
, RVineLogLik()
, RVinePDF()
# define 5-dimensional R-vine tree structure matrix Matrix <- c( 5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1 ) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c( 0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0 ) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c( 0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0 ) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix( Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5") ) # compute the CDF at (0.1, 0.2, 0.3, 0.4, 0.5) RVineCDF(c(0.1, 0.2, 0.3, 0.4, 0.5), RVM)
# define 5-dimensional R-vine tree structure matrix Matrix <- c( 5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1 ) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c( 0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0 ) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c( 0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0 ) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix( Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5") ) # compute the CDF at (0.1, 0.2, 0.3, 0.4, 0.5) RVineCDF(c(0.1, 0.2, 0.3, 0.4, 0.5), RVM)
This function performs a Clarke test between two d-dimensional R-vine copula
models as specified by their RVineMatrix()
objects.
RVineClarkeTest(data, RVM1, RVM2)
RVineClarkeTest(data, RVM1, RVM2)
data |
An N x d data matrix (with uniform margins). |
RVM1 , RVM2
|
|
The test proposed by Clarke (2007) allows to compare non-nested models. For
this let and
be two competing vine copulas in terms of
their densities and with estimated parameter sets
and
. The null hypothesis of
statistical indistinguishability of the two models is
where
for observations
.
Since under statistical equivalence of the two models the log likelihood
ratios of the single observations are uniformly distributed around zero and
in expectation of the log likelihood ratios greater than zero,
the test statistic
where is the indicator function,
is distributed Binomial with parameters
and
, and
critical values can easily be obtained. Model 1 is interpreted as
statistically equivalent to model 2 if
is not significantly
different from the expected value
.
Like AIC and BIC, the Clarke test statistic may be corrected for the number of parameters used in the models. There are two possible corrections; the Akaike and the Schwarz corrections, which correspond to the penalty terms in the AIC and the BIC, respectively.
statistic , statistic.Akaike , statistic.Schwarz
|
Test statistics without correction, with Akaike correction and with Schwarz correction. |
p.value , p.value.Akaike , p.value.Schwarz
|
P-values of tests without correction, with Akaike correction and with Schwarz correction. |
Jeffrey Dissmann, Eike Brechmann
Clarke, K. A. (2007). A Simple Distribution-Free Test for Nonnested Model Selection. Political Analysis, 15, 347-363.
RVineVuongTest()
, RVineAIC()
,
RVineBIC()
# vine structure selection time-consuming (~ 20 sec) # load data set data(daxreturns) # select the R-vine structure, families and parameters RVM <- RVineStructureSelect(daxreturns[,1:5], c(1:6)) RVM$Matrix RVM$par RVM$par2 # select the C-vine structure, families and parameters CVM <- RVineStructureSelect(daxreturns[,1:5], c(1:6), type = "CVine") CVM$Matrix CVM$par CVM$par2 # compare the two models based on the data clarke <- RVineClarkeTest(daxreturns[,1:5], RVM, CVM) clarke$statistic clarke$statistic.Schwarz clarke$p.value clarke$p.value.Schwarz
# vine structure selection time-consuming (~ 20 sec) # load data set data(daxreturns) # select the R-vine structure, families and parameters RVM <- RVineStructureSelect(daxreturns[,1:5], c(1:6)) RVM$Matrix RVM$par RVM$par2 # select the C-vine structure, families and parameters CVM <- RVineStructureSelect(daxreturns[,1:5], c(1:6), type = "CVine") CVM$Matrix CVM$par CVM$par2 # compare the two models based on the data clarke <- RVineClarkeTest(daxreturns[,1:5], RVM, CVM) clarke$statistic clarke$statistic.Schwarz clarke$p.value clarke$p.value.Schwarz
This function fits a R-vine copula model to a d-dimensional copula data set.
Pair-copula families are selected using BiCopSelect()
and
estimated sequentially.
RVineCopSelect( data, familyset = NA, Matrix, selectioncrit = "AIC", indeptest = FALSE, level = 0.05, trunclevel = NA, weights = NA, rotations = TRUE, se = FALSE, presel = TRUE, method = "mle", cores = 1 )
RVineCopSelect( data, familyset = NA, Matrix, selectioncrit = "AIC", indeptest = FALSE, level = 0.05, trunclevel = NA, weights = NA, rotations = TRUE, se = FALSE, presel = TRUE, method = "mle", cores = 1 )
data |
N x d data matrix (with uniform margins). |
familyset |
integer vector of pair-copula families to select from.
The vector has to include at least one
pair-copula family that allows for positive and one that allows for negative
dependence. Not listed copula families might be included to better handle
limit cases. If |
Matrix |
lower or upper triangular d x d matrix that defines the R-vine tree structure. |
selectioncrit |
Character indicating the criterion for pair-copula
selection. Possible choices: |
indeptest |
Logical; whether a hypothesis test for the independence of
|
level |
numeric; significance level of the independence test (default:
|
trunclevel |
integer; level of truncation. |
weights |
Numerical; weights for each observation (optional). |
rotations |
logical; if |
se |
Logical; whether standard errors are estimated (default: |
presel |
Logical; whether to exclude families before fitting based on symmetry properties of the data. Makes the selection about 30\ (on average), but may yield slightly worse results in few special cases. |
method |
indicates the estimation method: either maximum
likelihood estimation ( |
cores |
integer; if |
R-vine copula models with unknown structure can be specified using
RVineStructureSelect()
.
An RVineMatrix()
object with the selected families
(RVM$family
) as well as sequentially
estimated parameters stored in RVM$par
and RVM$par2
. The object
is augmented by the following information about the fit:
se , se2
|
standard errors for the parameter estimates (if
|
nobs |
number of observations, |
logLik , pair.logLik
|
log likelihood (overall and pairwise) |
AIC , pair.AIC
|
Aikaike's Informaton Criterion (overall and pairwise), |
BIC , pair.BIC
|
Bayesian's Informaton Criterion (overall and pairwise), |
emptau |
matrix of empirical values of Kendall's tau, |
p.value.indeptest |
matrix of p-values of the independence test. |
#'
For a comprehensive summary of the vine copula model, use
summary(object)
; to see all its contents, use str(object)
.
Eike Brechmann, Thomas Nagler
Brechmann, E. C., C. Czado, and K. Aas (2012). Truncated regular vines in high dimensions with applications to financial data. Canadian Journal of Statistics 40 (1), 68-85.
Dissmann, J. F., E. C. Brechmann, C. Czado, and D. Kurowicka (2013). Selecting and estimating regular vine copulae and application to financial returns. Computational Statistics & Data Analysis, 59 (1), 52-69.
RVineMatrix()
,
BiCop()
,
BiCopSelect()
,
plot.RVineMatrix()
,
contour.RVineMatrix()
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) ## define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) ## simulate a sample of size 500 from the R-vine copula model set.seed(123) simdata <- RVineSim(500, RVM) ## determine the pair-copula families and parameters RVM1 <- RVineCopSelect(simdata, familyset = c(1, 3, 4, 5 ,6), Matrix) ## see the object's content or a summary str(RVM1) summary(RVM1) ## inspect the fitted model using plots ## Not run: plot(RVM1) # tree structure contour(RVM1) # contour plots of all pair-copulas
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) ## define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) ## simulate a sample of size 500 from the R-vine copula model set.seed(123) simdata <- RVineSim(500, RVM) ## determine the pair-copula families and parameters RVM1 <- RVineCopSelect(simdata, familyset = c(1, 3, 4, 5 ,6), Matrix) ## see the object's content or a summary str(RVM1) summary(RVM1) ## inspect the fitted model using plots ## Not run: plot(RVM1) # tree structure contour(RVM1) # contour plots of all pair-copulas
Correlations to partial correlations and vice versa for R-vines with independence, Gaussian and t-copulas.
RVineCor2pcor(RVM, corMat) RVinePcor2cor(RVM)
RVineCor2pcor(RVM, corMat) RVinePcor2cor(RVM)
RVM |
|
corMat |
correlation matrix |
RVM |
RVineMatrix with transformed partial correlations (for
|
cor |
correlation matrix (for |
The behavior of RVinePcor2ccor
differs from older versions (<=
1.4). The RVM object is now normalized such that the order of the returned
correlation matrix conforms with the correlation matrix of the data. If
RVM$names
are non-default, the initial ordering of the variables
cannot be traced back and the matrix has to be interpreted as indicated by
the row- and column names.
## create RVineMatrix-object for Gaussian vine Matrix <- matrix(c(1, 3, 4, 2, 0, 3, 4, 2, 0, 0, 4, 2, 0, 0, 0, 2), 4, 4) family <- matrix(c(0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0), 4, 4) par <- matrix(c(0, 0.2, 0, 0.6, 0, 0, 0.2, 0.6, 0, 0, 0, 0.6, 0, 0, 0, 0), 4, 4) RVM <- RVineMatrix(Matrix, family, par) ## calculate correlation matrix corresponding to the R-Vine model newcor <- RVinePcor2cor(RVM) ## transform back to partial correlations RVineCor2pcor(RVM, newcor)$par ## check if they are equal all.equal(RVM$par, RVineCor2pcor(RVM, newcor)$par)
## create RVineMatrix-object for Gaussian vine Matrix <- matrix(c(1, 3, 4, 2, 0, 3, 4, 2, 0, 0, 4, 2, 0, 0, 0, 2), 4, 4) family <- matrix(c(0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0), 4, 4) par <- matrix(c(0, 0.2, 0, 0.6, 0, 0, 0.2, 0.6, 0, 0, 0, 0.6, 0, 0, 0, 0), 4, 4) RVM <- RVineMatrix(Matrix, family, par) ## calculate correlation matrix corresponding to the R-Vine model newcor <- RVinePcor2cor(RVM) ## transform back to partial correlations RVineCor2pcor(RVM, newcor)$par ## check if they are equal all.equal(RVM$par, RVineCor2pcor(RVM, newcor)$par)
This function performs a goodness-of-fit test for R-vine copula models. There are 15 different goodness-of-fit tests implemented, described in Schepsmeier (2013).
RVineGofTest( data, RVM, method = "White", statistic = "CvM", B = 200, alpha = 2 )
RVineGofTest( data, RVM, method = "White", statistic = "CvM", B = 200, alpha = 2 )
data |
An N x d data matrix (with uniform margins). |
RVM |
|
method |
A string indicating the goodness-of-fit method: |
statistic |
A string indicating the goodness-of-fit test statistic
type: |
B |
an integer for the number of bootstrap steps (default |
alpha |
an integer of the set |
method = "White"
:
This goodness-of fit test uses the information
matrix equality of White (1982) and was original investigated by Huang and
Prokhorov (2011) for copulas.
Schepsmeier (2012) enhanced their approach
to the vine copula case.
The main contribution is that under correct
model specification the Fisher Information can be equivalently calculated as
minus the expected Hessian matrix or as the expected outer product of the
score function.
The null hypothesis is
against the alternative
where
is the expected Hessian matrix and
is the expected outer product of the
score function.
For the calculation of the test statistic we use the
consistent maximum likelihood estimator and the sample
counter parts of
and
.
The correction of the
Covariance-Matrix in the test statistic for the uncertainty in the margins
is skipped. The implemented test assumes that there is no uncertainty in the
margins. The correction can be found in Huang and Prokhorov (2011) for
bivariate copulas and in Schepsmeier (2013) for vine copulas. It involves
multi-dimensional integrals.
method = "IR"
:
As the White test the information matrix ratio
test is based on the expected Hessian matrix
and the expected outer product of
the score function
.
against the alternative
The test statistic can then be calculated as
with
,
is the number of parameters, i.e. the length of
, and
is the trace of the matrix
For details see Schepsmeier (2013)
method = "Breymann"
, method = "Berg"
and method = "Berg2"
:
These tests are based on the multivariate probability integral
transform (PIT) applied in RVinePIT()
. The multivariate data
returned form the PIT are aggregated to univariate data by
different aggregation functions
in the sum
.
In Breymann et al. (2003) the weight function is suggested as
, while in
Berg and Bakken (2007) the weight function is either
(
method="Berg"
) or
(
method="Berg2"
).
Furthermore, the "Berg"
and
"Berg2"
test are based on the order statistics of the PIT returns.
See Berg and Bakken (2007) or Schepsmeier (2013) for details.
method = "ECP"
and method = "ECP2"
:
Both tests are test
for against
where C denotes the
(vine) copula distribution function and
is a class of parametric
(vine) copulas with
being the parameter space of
dimension p. They are based on the empirical copula process (ECP)
with
and
.
The ECP is utilized in a multivariate
Cramer-von Mises (CvM) or multivariate Kolmogorov-Smirnov (KS) based test
statistic. An extension of the ECP-test is the combination of the
multivariate PIT approach with the ECP. The general idea is that the
transformed data of a multivariate PIT should be "close" to the independence
copula Genest et al. (2009). Thus a distance of CvM or KS type between them
is considered. This approach is called ECP2. Again we refer to Schepsmeier
(2013) for details.
For method = "White"
:
White |
test statistic |
p.value |
p-value, either asymptotic for |
For method = "IR"
:
IR |
test statistic (raw version as stated above) |
p.value |
So far no p-value is returned nigher a asymptotic nor a bootstrapped one. How to calculated a bootstrapped p-value is explained in Schepsmeier (2013). Be aware, that the test statistics than have to be adjusted with the empirical variance. |
For method = "Breymann"
, method = "Berg"
and method = "Berg2"
:
CvM , KS , AD
|
test statistic according to
the choice of |
p.value |
p-value, either asymptotic
for |
For method = "ECP"
and method = "ECP2"
:
CvM , KS
|
test statistic according to the
choice of |
p.value |
bootstrapped p-value |
Warning: The code for all the p-values are not yet approved since some of them are
moved from R-code to C-code. If you need p-values the best way is to write your own
algorithm as suggested in Schepsmeier (2013) to get bootstrapped p-values.
Ulf Schepsmeier
Berg, D. and H. Bakken (2007) A copula goodness-of-fit approach based on the conditional probability integral transformation. https://www.danielberg.no/publications/Btest.pdf
Breymann, W., A. Dias and P. Embrechts (2003) Dependence structures for multivariate high-frequency data in finance. Quantitative Finance 3, 1-14
Genest, C., B. Remillard, and D. Beaudoin (2009) Goodness-of-fit tests for copulas: a review and power study. Insur. Math. Econ. 44, 199-213.
Huang, w. and A. Prokhorov (2011). A goodness-of-fit test for copulas. to appear in Econometric Reviews
Schepsmeier, U. (2013) A goodness-of-fit test for regular vine copula models. Preprint https://arxiv.org/abs/1306.0818
Schepsmeier, U. (2015) Efficient information based goodness-of-fit tests for vine copula models with fixed margins. Journal of Multivariate Analysis 138, 34-52.
White, H. (1982) Maximum likelihood estimation of misspecified models, Econometrica, 50, 1-26.
## time-consuming example # load data set data(daxreturns) # select the R-vine structure, families and parameters RVM <- RVineStructureSelect(daxreturns[,1:5], c(1:6)) # White test with asymptotic p-value RVineGofTest(daxreturns[,1:5], RVM, B = 0) # ECP2 test with Cramer-von-Mises test statistic and a bootstrap # with 200 replications for the calculation of the p-value RVineGofTest(daxreturns[,1:5], RVM, method = "ECP2", statistic = "CvM", B = 200)
## time-consuming example # load data set data(daxreturns) # select the R-vine structure, families and parameters RVM <- RVineStructureSelect(daxreturns[,1:5], c(1:6)) # White test with asymptotic p-value RVineGofTest(daxreturns[,1:5], RVM, B = 0) # ECP2 test with Cramer-von-Mises test statistic and a bootstrap # with 200 replications for the calculation of the p-value RVineGofTest(daxreturns[,1:5], RVM, method = "ECP2", statistic = "CvM", B = 200)
This function calculates the gradient of the log-likelihood of a d-dimensional R-vine copula model with respect to the copula parameter and evaluates it on a given copula data set.
RVineGrad( data, RVM, par = RVM$par, par2 = RVM$par2, start.V = NA, posParams = (RVM$family > 0) )
RVineGrad( data, RVM, par = RVM$par, par2 = RVM$par2, start.V = NA, posParams = (RVM$family > 0) )
data |
An N x d data matrix (with uniform margins). |
RVM |
An |
par |
A d x d matrix with the pair-copula parameters (optional;
default: |
par2 |
A d x d matrix with the second parameters of pair-copula
families with two parameters (optional; default: |
start.V |
Transformations (h-functions and log-likelihoods of each
pair-copula) of previous calculations (see output; default: |
posParams |
A d x d matrix indicating which copula has to be considered
in the gradient (default: |
The ordering of the gradient is due to the ordering of the R-vine matrix.
The gradient starts at the lower right corner of the R-vine matrix and goes
column by column to the left and up, i.e. the first entry of the gradient is
the last entry of the second last column of the par
-matrix followed
by the last entry of the third last column and the second last entry of this
column. If there is a copula family with two parameters, i.e. the t-copula,
the derivative with respect to the second parameter is at the end of the
gradient vector in order of their occurrence.
gradient The calculated gradient of the log-likelihood value
of the R-vine copula model. (three matrices: direct
, indirect
and value
).
The gradient for R-vine copula models with two parameter Archimedean copulas, i.e. BB1, BB6, BB7, BB8 and their rotated versions can not yet be calculated. The derivatives of these bivariate copulas are more complicated.
Ulf Schepsmeier, Jakob Stoeber
Dissmann, J. F., E. C. Brechmann, C. Czado, and D. Kurowicka (2013). Selecting and estimating regular vine copulae and application to financial returns. Computational Statistics & Data Analysis, 59 (1), 52-69.
Schepsmeier, U. and J. Stoeber (2014) Derivatives and Fisher information of bivariate copulas. Statistical Papers, 55(2), 525-542. online first: https://link.springer.com/article/10.1007/s00362-013-0498-x.
Web supplement: Derivatives and Fisher Information of bivariate copulas. https://mediatum.ub.tum.de/node?id=1119201
Stoeber, J. and U. Schepsmeier (2013). Estimating standard errors in regular vine copula models. Computational Statistics, 28 (6), 2679-2707 https://link.springer.com/article/10.1007/s00180-013-0423-8#.
BiCopDeriv()
,
BiCopDeriv2()
,
BiCopHfuncDeriv()
,
BiCopHfuncDeriv2()
, RVineMatrix()
,
RVineMLE()
,
RVineHessian()
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # simulate a sample of size 300 from the R-vine copula model set.seed(123) simdata <- RVineSim(300, RVM) # compute the gradient of the first row of the data out2 <- RVineGrad(simdata[1,], RVM) out2$gradient
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # simulate a sample of size 300 from the R-vine copula model set.seed(123) simdata <- RVineSim(300, RVM) # compute the gradient of the first row of the data out2 <- RVineGrad(simdata[1,], RVM) out2$gradient
This function calculates the Hessian matrix of the log-likelihood of a d-dimensional R-vine copula model with respect to the copula parameter and evaluates it on a given copula data set.
RVineHessian(data, RVM)
RVineHessian(data, RVM)
data |
An N x d data matrix (with uniform margins). |
RVM |
An |
hessian |
The calculated Hessian matrix of the log-likelihood value of the R-vine copula model. |
der |
The product of the gradient vector with its transposed version. |
The Hessian matrix is not available for R-vine copula models with two parameter Archimedean copulas, i.e. BB1, BB6, BB7, BB8 and their rotated versions.
Ulf Schepsmeier, Jakob Stoeber
Dissmann, J. F., E. C. Brechmann, C. Czado, and D. Kurowicka (2013). Selecting and estimating regular vine copulae and application to financial returns. Computational Statistics & Data Analysis, 59 (1), 52-69.
Schepsmeier, U. and J. Stoeber (2014) Derivatives and Fisher information of bivariate copulas. Statistical Papers, 55(2), 525-542. online first: https://link.springer.com/article/10.1007/s00362-013-0498-x.
Web supplement: Derivatives and Fisher Information of bivariate copulas. https://mediatum.ub.tum.de/node?id=1119201
Stoeber, J. and U. Schepsmeier (2013). Estimating standard errors in regular vine copula models. Computational Statistics, 28 (6), 2679-2707 https://link.springer.com/article/10.1007/s00180-013-0423-8#.
BiCopDeriv()
,
BiCopDeriv2()
,
BiCopHfuncDeriv()
,
BiCopHfuncDeriv2()
, RVineMatrix()
,
RVineMLE()
,
RVineGrad()
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # simulate a sample of size 300 from the R-vine copula model set.seed(123) simdata <- RVineSim(300, RVM) # compute the Hessian matrix of the first row of the data out2 <- RVineHessian(simdata[1,], RVM) out2$hessian
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # simulate a sample of size 300 from the R-vine copula model set.seed(123) simdata <- RVineSim(300, RVM) # compute the Hessian matrix of the first row of the data out2 <- RVineHessian(simdata[1,], RVM) out2$hessian
This function calculates the log-likelihood of a d-dimensional R-vine copula model for a given copula data set.
RVineLogLik( data, RVM, par = RVM$par, par2 = RVM$par2, separate = FALSE, verbose = TRUE, check.pars = TRUE, calculate.V = TRUE )
RVineLogLik( data, RVM, par = RVM$par, par2 = RVM$par2, separate = FALSE, verbose = TRUE, check.pars = TRUE, calculate.V = TRUE )
data |
An N x d data matrix (with uniform margins). |
RVM |
An |
par |
A d x d matrix with the pair-copula parameters (optional;
default: |
par2 |
A d x d matrix with the second parameters of pair-copula
families with two parameters (optional; default: |
separate |
Logical; whether log-likelihoods are returned point wisely
(default: |
verbose |
In case something goes wrong, additional output will be plotted. |
check.pars |
logical; default is |
calculate.V |
logical; whether V matrices should be calculated. Default
is |
For observations
the log-likelihood of a
-dimensional R-vine copula with
trees and corresponding edge sets
is given by
where . Further
denotes a bivariate copula density associated to an
edge
and with parameter(s)
.
Conditional distribution functions such as
are
obtained recursively using the relationship
where
is a bivariate copula
distribution function with parameter(s)
and
denotes a vector with the
-th
component
removed. The notation of h-functions is introduced for
convenience. For more details see Dissmann et al. (2013).
loglik |
The calculated log-likelihood value of the R-vine copula model. |
V |
The stored transformations (h-functions and
log-likelihoods of each pair-copula) which may be used for posterior updates
(three matrices: |
Ulf Schepsmeier, Jeffrey Dissmann, Jakob Stoeber
Dissmann, J. F., E. C. Brechmann, C. Czado, and D. Kurowicka (2013). Selecting and estimating regular vine copulae and application to financial returns. Computational Statistics & Data Analysis, 59 (1), 52-69.
BiCopHfunc()
, RVineMatrix()
,
RVineMLE()
, RVineAIC()
, RVineBIC()
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # simulate a sample of size 300 from the R-vine copula model set.seed(123) simdata <- RVineSim(300, RVM) # compute the log-likelihood ll <- RVineLogLik(simdata, RVM, separate = FALSE) ll$loglik # compute the pointwise log-likelihoods ll <- RVineLogLik(simdata, RVM, separate = TRUE) ll$loglik
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # simulate a sample of size 300 from the R-vine copula model set.seed(123) simdata <- RVineSim(300, RVM) # compute the log-likelihood ll <- RVineLogLik(simdata, RVM, separate = FALSE) ll$loglik # compute the pointwise log-likelihoods ll <- RVineLogLik(simdata, RVM, separate = TRUE) ll$loglik
This function creates an RVineMatrix()
object which encodes an
R-vine copula model. It contains the matrix identifying the R-vine tree
structure, the matrix identifying the copula families utilized and two
matrices for corresponding parameter values.
RVineMatrix( Matrix, family = array(0, dim = dim(Matrix)), par = array(NA, dim = dim(Matrix)), par2 = array(NA, dim = dim(Matrix)), names = NULL, check.pars = TRUE )
RVineMatrix( Matrix, family = array(0, dim = dim(Matrix)), par = array(NA, dim = dim(Matrix)), par2 = array(NA, dim = dim(Matrix)), names = NULL, check.pars = TRUE )
Matrix |
Lower (or upper) triangular d x d matrix that defines the R-vine tree structure. |
family |
Lower (or upper) triangular d x d matrix with zero diagonal
entries that assigns the pair-copula families to each (conditional) pair
defined by |
par |
Lower (or upper) triangular d x d matrix with zero diagonal
entries that assigns the (first) pair-copula parameter to each (conditional)
pair defined by |
par2 |
Lower (or upper) triangular d x d matrix with zero diagonal
entries that assigns the second parameter for pair-copula families with two
parameters to each (conditional) pair defined by |
names |
A vector of names for the d variables; default: |
check.pars |
logical; default is |
An object of class RVineMatrix()
, i.e., a list with the
following components:
Matrix |
R-vine tree structure matrix. |
family |
pair-copula family matrix with values as above. |
par |
pair-copula parameter matrix. |
par2 |
second pair-copula parameter matrix with parameters necessary for pair-copula families with two parameters. |
names |
variable names (defaults to |
MaxMat , CondDistr
|
additional matrices required internally for evaluating the density etc., |
type |
the type of the vine copula structure; possible types are:
|
tau |
Kendall's tau matrix, |
taildep |
matrices of lower and upper tail dependence coefficients, |
beta |
Blomqvist's beta matrix. |
Objects of this class are also returned by the RVineSeqEst()
,
RVineCopSelect()
, and RVineStructureSelect()
functions. In this case, further information about the fit is added.
For a comprehensive summary of the vine copula model, use
summary(object)
; to see all its contents, use str(object)
.
The RVineMatrix()
function automatically checks if the given
matrix is a valid R-vine matrix (see RVineMatrixCheck()
).
Although the function allows upper triangular matrices as its input, it will
always store them as lower triangular matrices.
Jeffrey Dissmann, Thomas Nagler
Dissmann, J. F., E. C. Brechmann, C. Czado, and D. Kurowicka (2013). Selecting and estimating regular vine copulae and application to financial returns. Computational Statistics & Data Analysis, 59 (1), 52-69.
RVineMatrixCheck()
,
RVineSeqEst()
,
RVineCopSelect()
,
RVineStructureSelect()
,
RVineSim()
,
C2RVine()
,
D2RVine()
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) ## define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) ## see the object's content or a summary str(RVM) summary(RVM) ## inspect the model using plots ## Not run: plot(RVM) # tree structure contour(RVM) # contour plots of all pair-copulas ## simulate from the vine copula model plot(RVineSim(500, RVM))
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) ## define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) ## see the object's content or a summary str(RVM) summary(RVM) ## inspect the model using plots ## Not run: plot(RVM) # tree structure contour(RVM) # contour plots of all pair-copulas ## simulate from the vine copula model plot(RVineSim(500, RVM))
The given matrix is tested to be a valid R-vine matrix.
RVineMatrixCheck(M)
RVineMatrixCheck(M)
M |
A |
code |
|
The matrix M do not have to be given in natural order or the diagonal
in order d:1. The test checks if it can be done in order to be a valid
R-vine matrix.
If a function in this package needs the natural order the
RVineMatrix
object is automatically "normalized".
The function
RVineMatrix()
automatically checks if the given R-vine matrix is
valid.
Harry Joe
Joe H, Cooke RM and Kurowicka D (2011). Regular vines: generation algorithm and number of equivalence classes. In Dependence Modeling: Vine Copula Handbook, pp 219–231. World Scientific, Singapore.
A1 <- matrix(c(6, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 3, 4, 4, 0, 0, 0, 4, 3, 3, 3, 0, 0, 1, 1, 2, 2, 2, 0, 2, 2, 1, 1, 1, 1), 6, 6, byrow = TRUE) b1 <- RVineMatrixCheck(A1) print(b1) # improper vine matrix, code=-1 A2 <- matrix(c(6, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 4, 4, 4, 0, 0, 0, 1, 3, 3, 3, 0, 0, 3, 1, 2, 2, 2, 0, 2, 2, 1, 1, 1,1 ), 6, 6, byrow = TRUE) b2 <- RVineMatrixCheck(A2) print(b2) # improper vine matrix, code=-2 A3 <- matrix(c(6, 0, 0, 0, 0, 0, 3, 5, 0, 0, 0, 0, 3, 4, 4, 0, 0, 0, 4, 3, 3, 3, 0, 0, 1, 1, 2, 2, 2, 0, 2, 2, 1, 1, 1, 1), 6, 6, byrow = TRUE) b3 <- RVineMatrixCheck(A3) print(b3)
A1 <- matrix(c(6, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 3, 4, 4, 0, 0, 0, 4, 3, 3, 3, 0, 0, 1, 1, 2, 2, 2, 0, 2, 2, 1, 1, 1, 1), 6, 6, byrow = TRUE) b1 <- RVineMatrixCheck(A1) print(b1) # improper vine matrix, code=-1 A2 <- matrix(c(6, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 4, 4, 4, 0, 0, 0, 1, 3, 3, 3, 0, 0, 3, 1, 2, 2, 2, 0, 2, 2, 1, 1, 1,1 ), 6, 6, byrow = TRUE) b2 <- RVineMatrixCheck(A2) print(b2) # improper vine matrix, code=-2 A3 <- matrix(c(6, 0, 0, 0, 0, 0, 3, 5, 0, 0, 0, 0, 3, 4, 4, 0, 0, 0, 4, 3, 3, 3, 0, 0, 1, 1, 2, 2, 2, 0, 2, 2, 1, 1, 1, 1), 6, 6, byrow = TRUE) b3 <- RVineMatrixCheck(A3) print(b3)
An RVineMatrix()
is permuted to achieve a natural ordering (i.e.
diag(RVM$Matrix) == d:1
)
RVineMatrixNormalize(RVM)
RVineMatrixNormalize(RVM)
RVM |
|
RVM |
An |
Matrix <- matrix(c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1), 5, 5) family <- matrix(1,5,5) par <- matrix(c(0, 0.2, 0.9, 0.5, 0.8, 0, 0, 0.1, 0.6, 0.9, 0, 0, 0, 0.7, 0.5, 0, 0, 0, 0, 0.8, 0, 0, 0, 0, 0), 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix, family, par) # normalise the RVine RVineMatrixNormalize(RVM)
Matrix <- matrix(c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1), 5, 5) family <- matrix(1,5,5) par <- matrix(c(0, 0.2, 0.9, 0.5, 0.8, 0, 0, 0.1, 0.6, 0.9, 0, 0, 0, 0.7, 0.5, 0, 0, 0, 0, 0.8, 0, 0, 0, 0, 0), 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix, family, par) # normalise the RVine RVineMatrixNormalize(RVM)
Sample R-Vine matrices based on the algorithm of Joe et al. (2011).
RVineMatrixSample(d, size = 1, naturalOrder = FALSE)
RVineMatrixSample(d, size = 1, naturalOrder = FALSE)
d |
Dimension of the R-Vine matrices. |
size |
Number of matrices to sample. |
naturalOrder |
Should the matrices be in the natural order
(default: |
A list of length size
with each element containing one
R-Vine matrix.
For some reason, our implementation of Joe et al.'s algorithm always returns a star in the first tree. To fix this, we sample a vine matrix of dimension d + 1 and remove the first tree afterwards
Thibault Vatter
Joe H, Cooke RM and Kurowicka D (2011). Regular vines: generation algorithm and number of equivalence classes. In Dependence Modeling: Vine Copula Handbook, pp 219–231. World Scientific, Singapore.
RVineMatrix()
, RVineMatrixCheck()
# Matrix and sample sizes d <- 10 size <- 5 # Sample R-vine matrices RVM <- RVineMatrixSample(d, size) sapply(RVM, RVineMatrixCheck) # Sample R-vine matrices in the natural order RVM <- RVineMatrixSample(d, size, naturalOrder = TRUE) sapply(RVM, RVineMatrixCheck)
# Matrix and sample sizes d <- 10 size <- 5 # Sample R-vine matrices RVM <- RVineMatrixSample(d, size) sapply(RVM, RVineMatrixCheck) # Sample R-vine matrices in the natural order RVM <- RVineMatrixSample(d, size, naturalOrder = TRUE) sapply(RVM, RVineMatrixCheck)
This function calculates the maximum likelihood estimate (MLE) of the R-vine copula model parameters using sequential estimates as initial values (if not provided).
RVineMLE( data, RVM, start = RVM$par, start2 = RVM$par2, maxit = 200, max.df = 30, max.BB = list(BB1 = c(5, 6), BB6 = c(6, 6), BB7 = c(5, 6), BB8 = c(6, 1)), grad = FALSE, hessian = FALSE, se = FALSE, ... )
RVineMLE( data, RVM, start = RVM$par, start2 = RVM$par2, maxit = 200, max.df = 30, max.BB = list(BB1 = c(5, 6), BB6 = c(6, 6), BB7 = c(5, 6), BB8 = c(6, 1)), grad = FALSE, hessian = FALSE, se = FALSE, ... )
data |
An N x d data matrix (with uniform margins). |
RVM |
An |
start |
Lower triangular d x d matrix with zero diagonal entries with
starting values for the pair-copula parameters (optional; otherwise they are
calculated via |
start2 |
Lower triangular d x d matrix with zero diagonal entries with
starting values for the second parameters of pair-copula families with two
parameters (optional; otherwise they are calculated via
|
maxit |
The maximum number of iteration steps (optional; default:
|
max.df |
Numeric; upper bound for the estimation of the degrees of
freedom parameter of the t-copula (default: |
max.BB |
List; upper bounds for the estimation of the two parameters
(in absolute values) of the BB1, BB6, BB7 and BB8 copulas |
grad |
If RVM$family only contains one parameter copula families or the
t-copula the analytical gradient can be used for maximization of the
log-likelihood (see |
hessian |
Logical; whether the Hessian matrix of parameter estimates is
estimated (default: |
se |
Logical; whether standard errors of parameter estimates are
estimated on the basis of the Hessian matrix (see above; default: |
... |
Further arguments for |
RVM |
|
value |
Optimized log-likelihood value corresponding to the estimated pair-copula parameters. |
convergence |
An integer code indicating
either successful convergence ( |
message |
A character
string giving any additional information returned by |
counts |
A two-element integer vector giving the number
of calls to |
hessian |
If |
RVineMLE
uses the L-BFGS-B method for optimization.
If the
analytical gradient is used for maximization, computations may be up to 10
times faster than using finite differences.
Ulf Schepsmeier, Jeffrey Dissmann
Dissmann, J. F., E. C. Brechmann, C. Czado, and D. Kurowicka (2013). Selecting and estimating regular vine copulae and application to financial returns. Computational Statistics & Data Analysis, 59 (1), 52-69.
Stoeber, J. and U. Schepsmeier (2013). Estimating standard errors in regular vine copula models. Computational Statistics, 1-29 https://link.springer.com/article/10.1007/s00180-013-0423-8#.
RVineSeqEst()
,
RVineStructureSelect()
,
RVineMatrix()
,
RVineGrad()
,
RVineHessian()
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # simulate a sample of size 300 from the R-vine copula model set.seed(123) simdata <- RVineSim(300, RVM) # compute the MLE mle <- RVineMLE(simdata, RVM, grad = TRUE, trace = 0) # compare parameters round(mle$RVM$par - RVM$par, 2)
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # simulate a sample of size 300 from the R-vine copula model set.seed(123) simdata <- RVineSim(300, RVM) # compute the MLE mle <- RVineMLE(simdata, RVM, grad = TRUE, trace = 0) # compare parameters round(mle$RVM$par - RVM$par, 2)
This function computes the values of Blomqvist's beta corresponding to the parameters of an R-vine copula model.
RVinePar2Beta(RVM, check.pars = TRUE)
RVinePar2Beta(RVM, check.pars = TRUE)
RVM |
An |
check.pars |
logical; default is |
Matrix with the same structure as the family and parameter matrices
of the RVineMatrix()
object RVM
where the entries are
values of Blomqvist's beta corresponding to the families and parameters of
the R-vine copula model given by RVM
.
Ulf Schepsmeier
RVineMatrix()
, BiCopPar2Beta()
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # compute the Blomqvist's beta values BlomBeta <- RVinePar2Beta(RVM)
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # compute the Blomqvist's beta values BlomBeta <- RVinePar2Beta(RVM)
This function computes the values of Kendall's tau corresponding to the parameters of an R-vine copula model.
RVinePar2Tau(RVM, check.pars = TRUE)
RVinePar2Tau(RVM, check.pars = TRUE)
RVM |
An |
check.pars |
logical; default is |
Matrix with the same structure as the family and parameter matrices
of the RVineMatrix()
object RVM
where the entries are
values of Kendall's tau corresponding to the families and parameters of the
R-vine copula model given by RVM
.
Jeffrey Dissmann
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # compute the Kendall's tau values tau <- RVinePar2Tau(RVM)
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # compute the Kendall's tau values tau <- RVinePar2Tau(RVM)
This function calculates the probability density function of a d-dimensional R-vine copula.
RVinePDF(newdata, RVM, verbose = TRUE)
RVinePDF(newdata, RVM, verbose = TRUE)
newdata |
An N x d data matrix that specifies where the density shall be evaluated. |
RVM |
An |
verbose |
In case something goes wrong, additional output will be plotted. |
The density of a -dimensional R-vine copula with
trees and
corresponding edge sets
is given by
where
.
Further
denotes a bivariate copula density
associated to an edge
and with parameter(s)
.
Conditional distribution functions such as
are obtained
recursively using the relationship
where
is a bivariate copula
distribution function with parameter(s)
and
denotes a vector with the
-th
component
removed. The notation of h-functions is introduced for
convenience. For more details see Dissmann et al. (2013).
The function is actually just a wrapper to RVineLogLik()
.
Thomas Nagler
Dissmann, J. F., E. C. Brechmann, C. Czado, and D. Kurowicka (2013). Selecting and estimating regular vine copulae and application to financial returns. Computational Statistics & Data Analysis, 59 (1), 52-69.
BiCopHfunc()
, RVineMatrix()
,
RVineMLE()
, RVineAIC()
, RVineBIC()
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # compute the density at (0.1, 0.2, 0.3, 0.4, 0.5) RVinePDF(c(0.1, 0.2, 0.3, 0.4, 0.5), RVM)
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # compute the density at (0.1, 0.2, 0.3, 0.4, 0.5) RVinePDF(c(0.1, 0.2, 0.3, 0.4, 0.5), RVM)
This function applies the probability integral transformation (PIT) for R-vine copula models to given copula data.
RVinePIT(data, RVM)
RVinePIT(data, RVM)
data |
An N x d data matrix (with uniform margins). |
RVM |
|
The multivariate probability integral transformation (PIT) of Rosenblatt
(1952) transforms the copula data with a given
multivariate copula C into independent data in
, where d is the
dimension of the data set.
Let denote copula data of dimension d. Further
let C be the joint cdf of
. Then Rosenblatt's
transformation of u, denoted as
, is defined as
where is the
conditional copula of
given
. The data vector
is now
i.i.d. with
. The algorithm for the R-vine PIT is
given in the appendix of Schepsmeier (2015).
An N
x d matrix of PIT data from the given R-vine copula
model.
Ulf Schepsmeier
Rosenblatt, M. (1952). Remarks on a Multivariate Transformation. The Annals of Mathematical Statistics 23 (3), 470-472.
Schepsmeier, U. (2015) Efficient information based goodness-of-fit tests for vine copula models with fixed margins. Journal of Multivariate Analysis 138, 34-52.
# load data set data(daxreturns) # select the R-vine structure, families and parameters RVM <- RVineStructureSelect(daxreturns[,1:3], c(1:6)) # PIT data pit <- RVinePIT(daxreturns[,1:3], RVM) par(mfrow = c(1,2)) plot(daxreturns[,1], daxreturns[,2]) # correlated data plot(pit[,1], pit[,2]) # i.i.d. data cor(pit, method = "kendall")
# load data set data(daxreturns) # select the R-vine structure, families and parameters RVM <- RVineStructureSelect(daxreturns[,1:3], c(1:6)) # PIT data pit <- RVinePIT(daxreturns[,1:3], RVM) par(mfrow = c(1,2)) plot(daxreturns[,1], daxreturns[,2]) # correlated data plot(pit[,1], pit[,2]) # i.i.d. data cor(pit, method = "kendall")
This function sequentially estimates the pair-copula parameters of a
d-dimensional R-vine copula model as specified by the corresponding
RVineMatrix()
object.
RVineSeqEst( data, RVM, method = "mle", se = FALSE, max.df = 30, max.BB = list(BB1 = c(5, 6), BB6 = c(6, 6), BB7 = c(5, 6), BB8 = c(6, 1)), progress = FALSE, weights = NA, cores = 1 )
RVineSeqEst( data, RVM, method = "mle", se = FALSE, max.df = 30, max.BB = list(BB1 = c(5, 6), BB6 = c(6, 6), BB7 = c(5, 6), BB8 = c(6, 1)), progress = FALSE, weights = NA, cores = 1 )
data |
An N x d data matrix (with uniform margins). |
RVM |
An |
method |
indicates the estimation method: either maximum
likelihood estimation ( |
se |
Logical; whether standard errors are estimated (default: |
max.df |
Numeric; upper bound for the estimation of the degrees of
freedom parameter of the t-copula (default: |
max.BB |
List; upper bounds for the estimation of the two parameters
(in absolute values) of the BB1, BB6, BB7 and BB8 copulas |
progress |
Logical; whether the pairwise estimation progress is printed
(default: |
weights |
Numerical; weights for each observation (optional). |
cores |
integer; if |
The pair-copula parameter estimation is performed tree-wise, i.e., for each
R-vine tree the results from the previous tree(s) are used to calculate the
new copula parameters using BiCopEst()
.
An RVineMatrix()
object with the sequentially
estimated parameters stored in RVM$par
and RVM$par2
. The object
is augmented by the following information about the fit:
se , se2
|
standard errors for the parameter estimates (if
|
nobs |
number of observations, |
logLik , pair.logLik
|
log likelihood (overall and pairwise) |
AIC , pair.AIC
|
Aikaike's Informaton Criterion (overall and pairwise), |
BIC , pair.BIC
|
Bayesian's Informaton Criterion (overall and pairwise), |
emptau |
matrix of empirical values of Kendall's tau, |
p.value.indeptest |
matrix of p-values of the independence test. |
For a comprehensive summary of the fitted model, use
summary(object)
; to see all its contents, use str(object)
.
Ulf Schepsmeier, Jeffrey Dissmann, Thomas Nagler
RVineMatrix()
,
BiCop()
,
BiCopEst()
,
plot.RVineMatrix()
,
contour.RVineMatrix()
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # simulate a sample of size 300 from the R-vine copula model set.seed(123) simdata <- RVineSim(300, RVM) # sequential estimation summary(RVineSeqEst(simdata, RVM, method = "itau", se = TRUE)) summary(RVineSeqEst(simdata, RVM, method = "mle", se = TRUE))
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # simulate a sample of size 300 from the R-vine copula model set.seed(123) simdata <- RVineSim(300, RVM) # sequential estimation summary(RVineSeqEst(simdata, RVM, method = "itau", se = TRUE)) summary(RVineSeqEst(simdata, RVM, method = "mle", se = TRUE))
This function simulates from a given R-vine copula model.
RVineSim(N, RVM, U = NULL)
RVineSim(N, RVM, U = NULL)
N |
Number of d-dimensional observations to simulate. |
RVM |
An |
U |
If not |
An N
x d matrix of data simulated from the given R-vine
copula model.
Jeffrey Dissmann
Dissmann, J. F., E. C. Brechmann, C. Czado, and D. Kurowicka (2013). Selecting and estimating regular vine copulae and application to financial returns. Computational Statistics & Data Analysis, 59 (1), 52-69.
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # simulate a sample of size 300 from the R-vine copula model set.seed(123) simdata <- RVineSim(300, RVM)
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # simulate a sample of size 300 from the R-vine copula model set.seed(123) simdata <- RVineSim(300, RVM)
This function calculates the standard errors of a d-dimensional R-vine copula model given the Hessian matrix.
RVineStdError(hessian, RVM)
RVineStdError(hessian, RVM)
hessian |
The Hessian matrix of the given R-vine. |
RVM |
An |
se |
The calculated standard errors for the first parameter
matrix. The entries are ordered with respect to the ordering of the
|
se2 |
The calculated standard errors for the second parameter matrix. |
The negative Hessian matrix should be positive semidefinite. Otherwise
NAs will be returned in some entries and the non-NA entries may be wrong. If
the negative Hessian matrix is negative definite, then one could try a near
positive matrix. The package Matrix
provides a function called
nearPD
to estimate a matrix which is positive definite and close to
the given matrix.
Ulf Schepsmeier, Jakob Stoeber
Dissmann, J. F., E. C. Brechmann, C. Czado, and D. Kurowicka (2013). Selecting and estimating regular vine copulae and application to financial returns. Computational Statistics & Data Analysis, 59 (1), 52-69.
Schepsmeier, U. and J. Stoeber (2014) Derivatives and Fisher information of bivariate copulas. Statistical Papers, 55(2), 525-542. online first: https://link.springer.com/article/10.1007/s00362-013-0498-x.
Web supplement: Derivatives and Fisher Information of bivariate copulas. https://mediatum.ub.tum.de/node?id=1119201
Stoeber, J. and U. Schepsmeier (2013). Estimating standard errors in regular vine copula models. Computational Statistics, 28 (6), 2679-2707 https://link.springer.com/article/10.1007/s00180-013-0423-8#.
BiCopDeriv()
,
BiCopDeriv2()
,
BiCopHfuncDeriv()
,
BiCopHfuncDeriv2()
, RVineMatrix()
,
RVineHessian()
,
RVineGrad()
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # simulate a sample of size 300 from the R-vine copula model set.seed(123) simdata <- RVineSim(300, RVM) # compute the Hessian matrix of the first row of the data out2 <- RVineHessian(simdata,RVM) # get the standard errors RVineStdError(out2$hessian, RVM)
# define 5-dimensional R-vine tree structure matrix Matrix <- c(5, 2, 3, 1, 4, 0, 2, 3, 4, 1, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 1) Matrix <- matrix(Matrix, 5, 5) # define R-vine pair-copula family matrix family <- c(0, 1, 3, 4, 4, 0, 0, 3, 4, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0) family <- matrix(family, 5, 5) # define R-vine pair-copula parameter matrix par <- c(0, 0.2, 0.9, 1.5, 3.9, 0, 0, 1.1, 1.6, 0.9, 0, 0, 0, 1.9, 0.5, 0, 0, 0, 0, 4.8, 0, 0, 0, 0, 0) par <- matrix(par, 5, 5) # define second R-vine pair-copula parameter matrix par2 <- matrix(0, 5, 5) # define RVineMatrix object RVM <- RVineMatrix(Matrix = Matrix, family = family, par = par, par2 = par2, names = c("V1", "V2", "V3", "V4", "V5")) # simulate a sample of size 300 from the R-vine copula model set.seed(123) simdata <- RVineSim(300, RVM) # compute the Hessian matrix of the first row of the data out2 <- RVineHessian(simdata,RVM) # get the standard errors RVineStdError(out2$hessian, RVM)
This function fits either an R- or a C-vine copula model to a d-dimensional
copula data set. Tree structures are determined and appropriate pair-copula
families are selected using BiCopSelect()
and estimated
sequentially (forward selection of trees).
RVineStructureSelect( data, familyset = NA, type = 0, selectioncrit = "AIC", indeptest = FALSE, level = 0.05, trunclevel = NA, progress = FALSE, weights = NA, treecrit = "tau", rotations = TRUE, se = FALSE, presel = TRUE, method = "mle", cores = 1 )
RVineStructureSelect( data, familyset = NA, type = 0, selectioncrit = "AIC", indeptest = FALSE, level = 0.05, trunclevel = NA, progress = FALSE, weights = NA, treecrit = "tau", rotations = TRUE, se = FALSE, presel = TRUE, method = "mle", cores = 1 )
data |
An N x d data matrix (with uniform margins). |
familyset |
An integer vector of pair-copula families to select from.
The vector has to include at least one
pair-copula family that allows for positive and one that allows for negative
dependence. Not listed copula families might be included to better handle
limit cases. If |
type |
Type of the vine model to be specified: |
selectioncrit |
Character indicating the criterion for pair-copula
selection. Possible choices: |
indeptest |
logical; whether a hypothesis test for the independence of
|
level |
numeric; significance level of the independence test
(default: |
trunclevel |
integer; level of truncation. |
progress |
logical; whether the tree-wise specification progress is
printed (default: |
weights |
numeric; weights for each observation (optional). |
treecrit |
edge weight for Dissman's structure selection algorithm, see Details. |
rotations |
If |
se |
Logical; whether standard errors are estimated (default: |
presel |
Logical; whether to exclude families before fitting based on symmetry properties of the data. Makes the selection about 30\ (on average), but may yield slightly worse results in few special cases. |
method |
indicates the estimation method: either maximum
likelihood estimation ( |
cores |
integer; if |
R-vine trees are selected using maximum spanning trees w.r.t. some edge
weights. The most commonly used edge weight is the absolute value of the
empirical Kendall's tau, say . Then, the following
optimization problem is solved for each tree:
where a spanning tree is a tree on all nodes. The setting of the first tree selection step is always a complete graph. For subsequent trees, the setting depends on the R-vine construction principles, in particular on the proximity condition.
Some commonly used edge weights are implemented:
"tau" |
absolute value of empirical Kendall's tau. |
"rho" |
absolute value of empirical Spearman's rho. |
"AIC" |
Akaike information (multiplied by -1). |
"BIC" |
Bayesian information criterion (multiplied by -1). |
"cAIC"
|
corrected Akaike information criterion (multiplied by -1). |
If the data contain NAs, the edge weights in "tau"
and "rho"
are
multiplied by the square root of the proportion of complete observations. This
penalizes pairs where less observations are used.
The criteria "AIC"
, "BIC"
, and "cAIC"
require estimation and
model selection for all possible pairs. This is computationally expensive and
much slower than "tau"
or "rho"
.
The user can also specify a custom function to calculate the edge weights.
The function has to be of type function(u1, u2, weights) ...
and must
return a numeric value. The weights argument must exist, but does not has to
be used. For example, "tau"
(without using weights) can be implemented
as follows:function(u1, u2, weights)
abs(cor(u1, u2, method = "kendall", use = "complete.obs"))
The root nodes of C-vine trees are determined similarly by identifying the node with strongest dependencies to all other nodes. That is we take the node with maximum column sum in the empirical Kendall's tau matrix.
Note that a possible way to determine the order of the nodes in the D-vine
is to identify a shortest Hamiltonian path in terms of weights
. This can be established for example using the package
TSP. Example code is shown below.
An RVineMatrix()
object with the selected structure
(RVM$Matrix
) and families (RVM$family
) as well as sequentially
estimated parameters stored in RVM$par
and RVM$par2
. The object
is augmented by the following information about the fit:
se , se2
|
standard errors for the parameter estimates; note that these are only approximate since they do not account for the sequential nature of the estimation, |
nobs |
number of observations, |
logLik , pair.logLik
|
log likelihood (overall and pairwise) |
AIC , pair.AIC
|
Aikaike's Informaton Criterion (overall and pairwise), |
BIC , pair.BIC
|
Bayesian's Informaton Criterion (overall and pairwise), |
emptau |
matrix of empirical values of Kendall's tau, |
p.value.indeptest |
matrix of p-values of the independence test. |
For a comprehensive summary of the vine copula model, use
summary(object)
; to see all its contents, use str(object)
.
Jeffrey Dissmann, Eike Brechmann, Ulf Schepsmeier, Thomas Nagler
Brechmann, E. C., C. Czado, and K. Aas (2012). Truncated regular vines in high dimensions with applications to financial data. Canadian Journal of Statistics 40 (1), 68-85.
Dissmann, J. F., E. C. Brechmann, C. Czado, and D. Kurowicka (2013). Selecting and estimating regular vine copulae and application to financial returns. Computational Statistics & Data Analysis, 59 (1), 52-69.
RVineMatrix()
,
BiCop()
,
RVineCopSelect()
,
plot.RVineMatrix()
,
contour.RVineMatrix()
# load data set data(daxreturns) # select the R-vine structure, families and parameters # using only the first 4 variables and the first 250 observations # we allow for the copula families: Gauss, t, Clayton, Gumbel, Frank and Joe daxreturns <- daxreturns[1:250, 1:4] RVM <- RVineStructureSelect(daxreturns, c(1:6), progress = TRUE) ## see the object's content or a summary str(RVM) summary(RVM) ## inspect the fitted model using plots ## Not run: plot(RVM) # tree structure contour(RVM) # contour plots of all pair-copulas ## estimate a C-vine copula model with only Clayton, Gumbel and Frank copulas CVM <- RVineStructureSelect(daxreturns, c(3,4,5), "CVine") ## determine the order of the nodes in a D-vine using the package TSP library(TSP) d <- dim(daxreturns)[2] M <- 1 - abs(TauMatrix(daxreturns)) hamilton <- insert_dummy(TSP(M), label = "cut") sol <- solve_TSP(hamilton, method = "repetitive_nn") order <- cut_tour(sol, "cut") DVM <- D2RVine(order, family = rep(0,d*(d-1)/2), par = rep(0, d*(d-1)/2)) RVineCopSelect(daxreturns, c(1:6), DVM$Matrix)
# load data set data(daxreturns) # select the R-vine structure, families and parameters # using only the first 4 variables and the first 250 observations # we allow for the copula families: Gauss, t, Clayton, Gumbel, Frank and Joe daxreturns <- daxreturns[1:250, 1:4] RVM <- RVineStructureSelect(daxreturns, c(1:6), progress = TRUE) ## see the object's content or a summary str(RVM) summary(RVM) ## inspect the fitted model using plots ## Not run: plot(RVM) # tree structure contour(RVM) # contour plots of all pair-copulas ## estimate a C-vine copula model with only Clayton, Gumbel and Frank copulas CVM <- RVineStructureSelect(daxreturns, c(3,4,5), "CVine") ## determine the order of the nodes in a D-vine using the package TSP library(TSP) d <- dim(daxreturns)[2] M <- 1 - abs(TauMatrix(daxreturns)) hamilton <- insert_dummy(TSP(M), label = "cut") sol <- solve_TSP(hamilton, method = "repetitive_nn") order <- cut_tour(sol, "cut") DVM <- D2RVine(order, family = rep(0,d*(d-1)/2), par = rep(0, d*(d-1)/2)) RVineCopSelect(daxreturns, c(1:6), DVM$Matrix)
Function is deprecated since VineCopula 2.0
. Use
plot.RVineMatrix()
instead.
RVineTreePlot( x, tree = "ALL", type = 0, edge.labels = NULL, legend.pos = "bottomleft", interactive = FALSE, ... )
RVineTreePlot( x, tree = "ALL", type = 0, edge.labels = NULL, legend.pos = "bottomleft", interactive = FALSE, ... )
x |
|
tree |
|
type |
integer; specifies how to make use of variable names: |
edge.labels |
character; either a vector of edge labels or one of the
following: |
legend.pos |
the |
interactive |
logical; if TRUE, the user is asked to adjust the positioning of vertices with his mouse. |
... |
Arguments passed to
|
Thomas Nagler
This function performs a Vuong test between two d-dimensional R-vine copula
models as specified by their RVineMatrix()
objects.
RVineVuongTest(data, RVM1, RVM2)
RVineVuongTest(data, RVM1, RVM2)
data |
An N x d data matrix (with uniform margins). |
RVM1 , RVM2
|
|
The likelihood-ratio based test proposed by Vuong (1989) can be used for
comparing non-nested models. For this let and
be two
competing vine copulas in terms of their densities and with estimated
parameter sets
and
. We then compute the
standardized sum,
, of the log differences of their pointwise
likelihoods
for observations
, i.e.,
Vuong
(1989) shows that is asymptotically standard normal. According to
the null-hypothesis
we
hence prefer vine model 1 to vine model 2 at level if
where denotes the inverse of the
standard normal distribution function. If
we choose model 2. If, however,
, no decision among the models is possible.
Like AIC and BIC, the Vuong test statistic may be corrected for the number of parameters used in the models. There are two possible corrections; the Akaike and the Schwarz corrections, which correspond to the penalty terms in the AIC and the BIC, respectively.
statistic , statistic.Akaike , statistic.Schwarz
|
Test statistics without correction, with Akaike correction and with Schwarz correction. |
p.value , p.value.Akaike , p.value.Schwarz
|
P-values of tests without correction, with Akaike correction and with Schwarz correction. |
Jeffrey Dissmann, Eike Brechmann
Vuong, Q. H. (1989). Ratio tests for model selection and non-nested hypotheses. Econometrica 57 (2), 307-333.
RVineClarkeTest()
, RVineAIC()
,
RVineBIC()
# vine structure selection time-consuming (~ 20 sec) # load data set data(daxreturns) # select the R-vine structure, families and parameters RVM <- RVineStructureSelect(daxreturns[,1:5], c(1:6)) # select the C-vine structure, families and parameters CVM <- RVineStructureSelect(daxreturns[,1:5], c(1:6), type = "CVine") # compare the two models based on the data vuong <- RVineVuongTest(daxreturns[,1:5], RVM, CVM) vuong$statistic vuong$statistic.Schwarz vuong$p.value vuong$p.value.Schwarz
# vine structure selection time-consuming (~ 20 sec) # load data set data(daxreturns) # select the R-vine structure, families and parameters RVM <- RVineStructureSelect(daxreturns[,1:5], c(1:6)) # select the C-vine structure, families and parameters CVM <- RVineStructureSelect(daxreturns[,1:5], c(1:6), type = "CVine") # compare the two models based on the data vuong <- RVineVuongTest(daxreturns[,1:5], RVM, CVM) vuong$statistic vuong$statistic.Schwarz vuong$p.value vuong$p.value.Schwarz
This function computes the empirical Kendall's tau using the algorithm by Knight (1966).
TauMatrix(data, weights = NA)
TauMatrix(data, weights = NA)
data |
An N x d data matrix. |
weights |
Numerical; weights for each observation (optional). |
Matrix of the empirical Kendall's taus.
Ulf Schepsmeier
Knight, W. R. (1966). A computer method for calculating Kendall's tau with ungrouped data. Journal of the American Statistical Association 61 (314), 436-439.
BiCopTau2Par()
, BiCopPar2Tau()
,
BiCopEst()
data(daxreturns) Data <- as.matrix(daxreturns) # compute the empirical Kendall's taus TauMatrix(Data)
data(daxreturns) Data <- as.matrix(daxreturns) # compute the empirical Kendall's taus TauMatrix(Data)
This functionality is deprecated in 'VineCopula'. Use the package 'VC2copula' instead.
copulaFromFamilyIndex(family, par, par2 = 0) surClaytonCopula(param = c(1, 1)) r90ClaytonCopula(param = c(1, 1)) r270ClaytonCopula(param = c(1, 1)) surGumbelCopula(param = c(1, 1)) r90GumbelCopula(param = c(1, 1)) r270GumbelCopula(param = c(1, 1)) joeBiCopula(param = c(1, 1)) surJoeBiCopula(param = c(1, 1)) r90JoeBiCopula(param = c(1, 1)) r270JoeBiCopula(param = c(1, 1)) BB1Copula(param = c(1, 1)) surBB1Copula(param = c(1, 1)) r90BB1Copula(param = c(1, 1)) r270BB1Copula(param = c(1, 1)) BB6Copula(param = c(1, 1)) surBB6Copula(param = c(1, 1)) r90BB6Copula(param = c(1, 1)) r270BB6Copula(param = c(1, 1)) BB7Copula(param = c(1, 1)) surBB7Copula(param = c(1, 1)) r90BB7Copula(param = c(1, 1)) r270BB7Copula(param = c(1, 1)) BB8Copula(param = c(1, 1)) surBB8Copula(param = c(1, 1)) r90BB8Copula(param = c(1, 1)) r270BB8Copula(param = c(1, 1)) tawnT1Copula(param = c(1, 1)) surTawnT1Copula(param = c(1, 1)) r90TawnT1Copula(param = c(1, 1)) r270TawnT1Copula(param = c(1, 1)) tawnT2Copula(param = c(1, 1)) surTawnT2Copula(param = c(1, 1)) r90TawnT2Copula(param = c(1, 1)) r270TawnT2Copula(param = c(1, 1)) vineCopula(RVM, type = "CVine")
copulaFromFamilyIndex(family, par, par2 = 0) surClaytonCopula(param = c(1, 1)) r90ClaytonCopula(param = c(1, 1)) r270ClaytonCopula(param = c(1, 1)) surGumbelCopula(param = c(1, 1)) r90GumbelCopula(param = c(1, 1)) r270GumbelCopula(param = c(1, 1)) joeBiCopula(param = c(1, 1)) surJoeBiCopula(param = c(1, 1)) r90JoeBiCopula(param = c(1, 1)) r270JoeBiCopula(param = c(1, 1)) BB1Copula(param = c(1, 1)) surBB1Copula(param = c(1, 1)) r90BB1Copula(param = c(1, 1)) r270BB1Copula(param = c(1, 1)) BB6Copula(param = c(1, 1)) surBB6Copula(param = c(1, 1)) r90BB6Copula(param = c(1, 1)) r270BB6Copula(param = c(1, 1)) BB7Copula(param = c(1, 1)) surBB7Copula(param = c(1, 1)) r90BB7Copula(param = c(1, 1)) r270BB7Copula(param = c(1, 1)) BB8Copula(param = c(1, 1)) surBB8Copula(param = c(1, 1)) r90BB8Copula(param = c(1, 1)) r270BB8Copula(param = c(1, 1)) tawnT1Copula(param = c(1, 1)) surTawnT1Copula(param = c(1, 1)) r90TawnT1Copula(param = c(1, 1)) r270TawnT1Copula(param = c(1, 1)) tawnT2Copula(param = c(1, 1)) surTawnT2Copula(param = c(1, 1)) r90TawnT2Copula(param = c(1, 1)) r270TawnT2Copula(param = c(1, 1)) vineCopula(RVM, type = "CVine")
family |
.. |
par |
... |
par2 |
... |
param |
... |
RVM |
... |
type |
... |