vine copula

of 85 /85
Package ‘VineCopula’ February 15, 2013 Type Package Title Statistical inference of vine copulas Version 1.1-1 Date 2013-02-07 Author Ulf Schepsmeier, Jakob Stoeber, Eike Christian Brechmann Maintainer Ulf Schepsmeier <[email protected]> Depends R (>= 2.11.0), MASS, mvtnorm, igraph0 Suggests CDVine, TSP Description This package provides functions for statistical inference of vine copulas. It contains tools for bivariate exploratory data analysis, bivariate copula selection and (vine) tree construction. Models can be estimated either sequentially or by joint maximum likelihood estimation. Sampling algorithms and plotting methods are also included. Data is assumed to lie in the unit hypercube (so-called copula data). For C- and D-vines links to the package CDVine are provided. License GPL (>= 2) LazyLoad yes Repository CRAN Date/Publication 2013-02-07 17:24:28 NeedsCompilation yes 1

Author: oloyedewole3741

Post on 12-Nov-2014

178 views

Category:

Documents


4 download

Embed Size (px)

DESCRIPTION

vine copular

TRANSCRIPT

Package VineCopulaFebruary 15, 2013Type PackageTitle Statistical inference of vine copulasVersion 1.1-1Date 2013-02-07Author Ulf Schepsmeier, Jakob Stoeber, Eike Christian BrechmannMaintainer Ulf Schepsmeier Depends R (>= 2.11.0), MASS, mvtnorm, igraph0Suggests CDVine, TSPDescription This package provides functions for statistical inferenceof vine copulas. It contains tools for bivariate exploratorydata analysis, bivariate copula selection and (vine) treeconstruction. Models can be estimated either sequentially or byjoint maximum likelihood estimation. Sampling algorithms andplotting methods are also included. Data is assumed to lie inthe unit hypercube (so-called copula data). For C- and D-vineslinks to the package CDVine are provided.License GPL (>= 2)LazyLoad yesRepository CRANDate/Publication 2013-02-07 17:24:28NeedsCompilation yes12 R topics documented:R topics documented:VineCopula-package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3BiCopCDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5BiCopChiPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7BiCopDeriv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9BiCopDeriv2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11BiCopEst . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12BiCopGofTest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15BiCopHfunc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18BiCopHfuncDeriv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20BiCopHfuncDeriv2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22BiCopIndTest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23BiCopKPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25BiCopLambda . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26BiCopMetaContour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29BiCopName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32BiCopPar2TailDep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33BiCopPar2Tau . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36BiCopPDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38BiCopSelect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40BiCopSim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43BiCopTau2Par . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44BiCopVuongClarke . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46C2RVine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48D2RVine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50daxreturns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52RVineAIC/BIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53RVineClarkeTest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54RVineCopSelect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56RVineGrad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59RVineHessian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61RVineLogLik . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63RVineMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65RVineMLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68RVinePar2Tau . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70RVineSeqEst . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71RVineSim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73RVineStdError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74RVineStructureSelect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76RVineTreePlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79RVineVuongTest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81TauMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83Index 85VineCopula-package 3VineCopula-package Statistical inference of vine copulasDescriptionThis package provides functions for statistical inference of vine copulas. It contains tools for bivari-ate exploratory data analysis, bivariate copula selection and (vine) tree construction. Models can beestimated either sequentially or by joint maximum likelihood estimation. Sampling algorithms andplotting methods are also included. Data is assumed to lie in the unit hypercube (so-called copuladata). For C- and D-vines links to the package CDVine are provided.DetailsPackage: VineCopulaType: PackageVersion: 1.1-1Date: 2013-02-07License: GPL (>=2)Depends: R ( 2.11.0), MASS, mvtnorm, igraph0Suggests: CDVine, TSPLazyLoad: yesRemarkThe 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 inCDVine for the bivariate case (BiCop-functions).Bivariate copula familiesIn this package several bivariate copula families are included for bivariate analysis as well asfor multivariate analysis using vine copulas. It provides functionality of elliptical (Gaussian andStudent-t) as well as Archimedean (Clayton, Gumbel, Frank, Joe, BB1, BB6, BB7 and BB8) cop-ulas to cover a large bandwidth of possible dependence structures. For the Archimedean copulafamilies rotated versions are included to cover negative dependence too. The two parameter BB1,BB6, BB7 and BB8 copulas are however numerically instable for large parameters, in particular,if BB6, BB7 and BB8 copulas are close to the Joe copula which is a boundary case of these threecopula families. In general, the user should be careful with extreme parameter choices.The following table shows the parameter ranges of bivariate copula families with parameters parand par2:Copula family par par2Gaussian (1, 1) -Student t (1, 1) (2, )4 VineCopula-package(Survival) Clayton (0, ) -(Survival) Gumbel [1, ) -Frank R\{0} -(Survival) Joe (1, ) -Rotated Clayton (90 and 270 degrees) (, 0) -Rotated Gumbel (90 and 270 degrees) (, 1] -Rotated Joe (90 and 270 degrees) (, 1) -(Survival) Clayton-Gumbel (BB1) (0, ) [1, )(Survival) Joe-Gumbel (BB6) [1, ) [1, )(Survival) Joe-Clayton (BB7) [1, ) (0, )(Survival) Joe-Frank (BB8) [1, ) (0, 1]Rotated Clayton-Gumbel (90 and 270 degrees) (, 0) (, 1]Rotated Joe-Gumbel (90 and 270 degrees) (, 1] (, 1]Rotated Joe-Clayton (90 and 270 degrees) (, 1] (, 0)Rotated Joe-Frank (90 and 270 degrees) (, 1] [1, 0)R-vine copula modelsThe specication of an R-vine is done in matrix notation, introduced by Dissmann et al. (2013).One matrix contains the R-vine tree structure, one the copula families utilized and two matricescorresponding parameter values. These four matrices are stored in an RVineMatrix object createdby the function RVineMatrix. Each matrix is a d x d lower triangular matrix. Since C- and D-vinesare special cases, boundary cases, of R-vines one can write each C- or D-vine in R-vine notation.The transformation of notation to or from an R-vine can be done via C2RVine, D2RVine, R2CVineand R2DVine, which provide an interface to the package CDVine. For more details see the docu-mentation of the functions.AcknowledgmentWe acknowledge substantial contributions by our working group at Technische Universitaet Muenchen,in particular by Carlos Almeida and Aleksey Min. In addition, we like to thank Shing (Eric) Fu,Feng Zhu, Guang (Jack) Yang, and Harry Joe for providing their implementation of the method byKnight (1966) for efciently computing the empirical Kendalls tau. We are especially grateful toHarry Joe for his contributions to the implementation of the bivariate Archimedean copulas.Author(s)Ulf Schepsmeier, Jakob Stoeber, Eike Christian Brechmann ReferencesAas, K., C. Czado, A. Frigessi, and H. Bakken (2009). Pair-copula constructions of multiple de-pendence. Insurance: Mathematics and Economics 44 (2), 182-198.Bedford, T. and R. M. Cooke (2001). Probability density decomposition for conditionally dependentrandom variables modeled by vines. Annals of Mathematics and Articial intelligence 32, 245-268.Bedford, T. and R. M. Cooke (2002). Vines - a new graphical model for dependent random vari-ables. Annals of Statistics 30, 1031-1068.BiCopCDF 5Brechmann, E. C., C. Czado, and K. Aas (2012). Truncated regular vines in high dimensions withapplications to nancial data. Canadian Journal of Statistics 40 (1), 68-85.Brechmann, E. C. and C. Czado (2011). Risk management with high-dimensional vine copulas: Ananalysis of the Euro Stoxx 50. Submitted for publication. http://mediatum.ub.tum.de/node?id=179276.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. http://www.jstatsoft.org/v52/i3/.Czado, C., U. Schepsmeier, and A. Min (2012). Maximum likelihood estimation of mixed C-vineswith application to exchange rates. Statistical Modelling, 12(3), 229-255.Dissmann, J. F., E. C. Brechmann, C. Czado, and D. Kurowicka (2013). Selecting and estimatingregular vine copulae and application to nancial returns. Computational Statistics & Data Analysis,59 (1), 52-69.Joe, H. (1996). Families of m-variate distributions with given margins and m(m-1)/2 bivariatedependence parameters. In L. Rueschendorf, B. Schweizer, and M. D. Taylor (Eds.), Distributionswith xed 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 Kendalls 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 DependenceModelling. Chichester: John Wiley.Kurowicka, D. and H. Joe (Eds.) (2011). Dependence Modeling: Vine Copula Handbook. Singa-pore: World Scientic Publishing Co.Schepsmeier, U. and J. Stoeber (2012). Derivatives and Fisher information of bivariate copulas.Submitted for publication. http://mediatum.ub.tum.de/node?id=116541.Stoeber, J. and U. Schepsmeier (2012). Is there signicant time-variation in multivariate copulas?Submitted for publication. http://arxiv.org/abs/125.4841.BiCopCDF Distribution function of a bivariate copulaDescriptionThis function evaluates the cumulative distribution function (CDF) of a given parametric bivariatecopula.UsageBiCopCDF(u1, u2, family, par, par2=)6 BiCopCDFArgumentsu1,u2 Numeric vectors of equal length with values in [0,1].family An integer dening the bivariate copula family: = independence copula1 = Gaussian copula3 = Clayton copula4 = Gumbel copula5 = Frank copula6 = Joe copula7 = BB1 copula8 = BB6 copula9 = BB7 copula1 = BB8 copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)17 = rotated BB1 copula (180 degrees; survival BB1)18 = rotated BB6 copula (180 degrees; survival BB6)19 = rotated BB7 copula (180 degrees; survival BB7)2 = rotated BB8 copula (180 degrees; survival BB8)23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)26 = rotated Joe copula (90 degrees)27 = rotated BB1 copula (90 degrees)28 = rotated BB6 copula (90 degrees)29 = rotated BB7 copula (90 degrees)3 = rotated BB8 copula (90 degrees)33 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)37 = rotated BB1 copula (270 degrees)38 = rotated BB6 copula (270 degrees)39 = rotated BB7 copula (270 degrees)4 = rotated BB8 copula (270 degrees)par Copula parameter.par2 Second parameter for bivariate copulas with two parameters (t, BB1, BB6, BB7,BB8; default: par2 = ). par2 should be an positive integer for the Studentsst copula family=2.ValueA numeric vector of the bivariate copula distribution function evaluated at u1 and u2.NoteThe calculation of the cumulative distribution function (CDF) of the Students t copula (family=2)is not implemented any more since the calculation was wrong for non-integer degrees-of-freedom.BiCopChiPlot 7Author(s)Eike BrechmannSee AlsoBiCopPDF, BiCopHfunc, BiCopSimExamples# simulate from a bivariate Claytonsimdata = BiCopSim(3,3,3.4)# evaluate the distribution function of the bivariate t-copulau1 = simdata[,1]u2 = simdata[,2]BiCopCDF(u1,u2,3,3.4)BiCopChiPlot Chi-plot for bivariate copula dataDescriptionThis function creates a chi-plot of given bivariate copula data.UsageBiCopChiPlot(u1, u2, PLOT=TRUE, mode="NULL", ...)Argumentsu1,u2 Data vectors of equal length with values in [0,1].PLOT Logical; whether the results are plotted. If PLOT = FALSE, the values lambda,chi and control.bounds are returned (see below; default: PLOT = TRUE).mode Character; whether a general, lower or upper chi-plot is calculated. Possiblevalues are mode = "NULL", "upper" and "lower"."NULL" = general chi-plot (default)"upper" = upper chi-plot"lower" = lower chi-plot... Additional plot arguments.8 BiCopChiPlotDetailsFor observations ui,j, i = 1, ..., N, j = 1, 2, the chi-plot is based on the following two quantities:the chi-statisticsi =FU1U2(ui,1, ui,2) FU1(ui,1) FU2(ui,2)_ FU1(ui,1)(1 FU1(ui,1)) FU2(ui,2)(1 FU2(ui,2)),and the lambda-statisticsi = 4sgn_ FU1(ui,1), FU2(ui,2)_ max_ FU1(ui,1)2, FU2(ui,2)2_,where FU1, FU2 and FU1U2 are the empirical distribution functions of the uniform random variablesU1 and U2 and of (U1, U2), respectively. Further, FU1 = FU1 0.5 and FU2 = FU2 0.5.These quantities only depend on the ranks of the data and are scaled to the interval [0, 1]. imeasures a distance of a data point (ui,1, ui,2) to the center of the bivariate data set, while icorresponds to a correlation coefcient between dichotomized values of U1 and U2. Under inde-pendence it holds that i N(0, 1N) and i U[1, 1] asymptotically, i.e., values of i close tozero indicate independencecorresponding to FU1U2 = FU1FU2.When plotting these quantities, the pairs of (i, i) will tend to be located above zero for positivelydependent margins and vice versa for negatively dependent margins. Control bounds around zeroindicate whether there is signicant dependence present.If mode = "lower" or "upper", the above quantities are calculated only for those ui,1s and ui,2swhich are smaller/larger than the respective means of u1= (u1,1, ..., uN,1) and u2= (u1,2, ..., uN,2).Valuelambda Lambda-statistics (x-axis).chi Chi-statistics (y-axis).control.bounds A2-dimensional vector of bounds ((1.54/n, 1.54/n), where n is the lengthof u1 and where the chosen values correspond to an approximate signicancelevel of 10%.Author(s)Natalia Belgorodski, Ulf SchepsmeierReferencesAbberger, 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 modelingbut were afraid to ask. Journal of Hydrologic Engineering, 12 (4), 347-368.See AlsoBiCopMetaContour, BiCopKPlot, BiCopLambdaBiCopDeriv 9Examples# chi-plots for bivariate Gaussian copula datan = 5tau = .5# simulate copula datafam = 1theta = BiCopTau2Par(fam,tau)dat = BiCopSim(n,fam,theta)# create chi-plotsdev.new(width=16,height=5)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")BiCopDeriv Derivatives of a bivariate copula densityDescriptionThis function evaluates the derivative of a given parametric bivariate copula density with respect toits parameter(s) or one of its arguments.UsageBiCopDeriv(u1, u2, family, par, par2=, deriv="par", log=FALSE)Argumentsu1,u2 Numeric vectors of equal length with values in [0,1].family An integer dening the bivariate copula family: = independence copula1 = Gaussian copula2 = Student t copula (t-copula)3 = Clayton copula4 = Gumbel copula5 = Frank copula6 = Joe copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)10 BiCopDeriv26 = rotated Joe copula (90 degrees)33 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)par Copula parameter.par2 Second parameter for bivariate t-copula; default: par2 = .deriv Derivative argument"par" = derivative with respect to the rst parameter (default)"par2" = derivative with respect to the second parameter (only available for thet-copula)"u1" = derivative with respect to the rst argument u1"u2" = derivative with respect to the second argument u2log Logical; if TRUE than the derivative of the log-likelihood is returned (default:log = FALSE; only available for the derivatives with respect to the parameter(s)(deriv = "par" or deriv = "par2")).ValueA numeric vector of the bivariate copula derivative with respect to deriv evaluated at u1 and u2with parameter(s) par and par2.Author(s)Ulf SchepsmeierReferencesSchepsmeier, U. and J. Stoeber (2012). Derivatives and Fisher information of bivariate copulas.Submitted for publication. http://mediatum.ub.tum.de/node?id=116541.See AlsoRVineGrad, RVineHessian, BiCopDeriv2, BiCopHfuncDerivExamples# simulate from a bivariate t-copulasimdata = BiCopSim(3,2,-.7,par2=4)# derivative of the bivariate t-copula with respect to the first parameteru1 = simdata[,1]u2 = simdata[,2]BiCopDeriv(u1,u2,2,-.7,par2=4, deriv="par")BiCopDeriv2 11BiCopDeriv2 Second derivatives of a bivariate copula densityDescriptionThis function evaluates the second derivative of a given parametric bivariate copula density withrespect to its parameter(s) and/or its arguments.UsageBiCopDeriv2(u1, u2, family, par, par2=, deriv="par")Argumentsu1,u2 Numeric vectors of equal length with values in [0,1].family An integer dening the bivariate copula family: = independence copula1 = Gaussian copula2 = Student t copula (t-copula)3 = Clayton copula4 = Gumbel copula5 = Frank copula6 = Joe copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)26 = rotated Joe copula (90 degrees)33 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)par Copula parameter.par2 Second parameter for bivariate t-copula; default: par2 = .deriv Derivative argument"par" = second derivative with respect to the rst parameter (default)"par2" = second derivative with respect to the second parameter (only availablefor the t-copula)"u1" = second derivative with respect to the rst argument u1"u2" = second derivative with respect to the second argument u2"par1par2" = second derivative with respect to the rst and second parameter(only available for the t-copula)"par1u1" = second derivative with respect to the rst parameter and the rstargument"par2u1" = second derivative with respect to the second parameter and the rst12 BiCopEstargument (only available for the t-copula)"par1u2" = second derivative with respect to the rst parameter and the secondargument"par2u2" = second derivative with respect to the second parameter and the sec-ond argument (only available for the t-copula)ValueA numeric vector of the second bivariate copula derivative with respect to deriv evaluated at u1and u2 with parameter(s) par and par2.Author(s)Ulf Schepsmeier, Jakob StoeberReferencesSchepsmeier, U. and J. Stoeber (2012). Derivatives and Fisher information of bivariate copulas.Submitted for publication. http://mediatum.ub.tum.de/node?id=116541.See AlsoRVineGrad, RVineHessian, BiCopDeriv, BiCopHfuncDerivExamples# simulate from a bivariate t-copulasimdata = BiCopSim(3,2,-.7,par2=4)# second derivative of the bivariate t-copula with respect to the first parameteru1 = simdata[,1]u2 = simdata[,2]BiCopDeriv2(u1,u2,2,-.7,par2=4, deriv="par")BiCopEst Parameter estimation for bivariate copula data using inversion ofKendalls tau or maximum likelihood estimationDescriptionThis function estimates the parameter(s) for a bivariate copula using either inversion of empiricalKendalls tau for single parameter copula families or maximum likelihood estimation for one andtwo parameter copula families supported in this package.UsageBiCopEst(u1, u2, family, method="mle", se=FALSE, max.df=3,max.BB=list(BB1=c(5,6),BB6=c(6,6),BB7=c(5,6),BB8=c(6,1)),weights=NA)BiCopEst 13Argumentsu1,u2 Data vectors of equal length with values in [0,1].family An integer dening the bivariate copula family: = independence copula1 = Gaussian copula2 = Student t copula (t-copula)3 = Clayton copula4 = Gumbel copula5 = Frank copula6 = Joe copula7 = BB1 copula8 = BB6 copula9 = BB7 copula1 = BB8 copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)17 = rotated BB1 copula (180 degrees; survival BB1)18 = rotated BB6 copula (180 degrees; survival BB6)19 = rotated BB7 copula (180 degrees; survival BB7)2 = rotated BB8 copula (180 degrees; survival BB8)23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)26 = rotated Joe copula (90 degrees)27 = rotated BB1 copula (90 degrees)28 = rotated BB6 copula (90 degrees)29 = rotated BB7 copula (90 degrees)3 = rotated BB8 copula (90 degrees)33 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)37 = rotated BB1 copula (270 degrees)38 = rotated BB6 copula (270 degrees)39 = rotated BB7 copula (270 degrees)4 = rotated BB8 copula (270 degrees)method Character indicating the estimation method: either maximum likelihood estima-tion (method = "mle"; default) or inversion of Kendalls tau (method = "itau").For method = "itau" only one parameter bivariate copula families can be used(family = 1,3,4,5,6,13,14,16,23,24,26,33,34 or 36).se Logical; whether standard error(s) of parameter estimates is/are estimated (de-fault: se = FALSE).max.df Numeric; upper bound for the estimation of the degrees of freedom parameterof the t-copula (default: max.df = 3).max.BB List; upper bounds for the estimation of the two parameters (in absolute values)of the BB1, BB6, BB7 and BB8 copulas(default: max.BB = list(BB1=c(5,6),BB6=c(6,6),BB7=c(5,6),BB8=c(6,1))).weights Numerical; weights for each observation (opitional).14 BiCopEstDetailsIf method = "itau", the function computes the empirical Kendalls tau of the given copula dataand exploits the one-to-one relationship of copula parameter and Kendalls tau which is availablefor many one parameter bivariate copula families (see BiCopPar2Tau and BiCopTau2Par). Theinversion of Kendalls tau is however not available for all bivariate copula families (see above). If atwo parameter copula family is chosen and method = "itau", a warning message is returned andthe MLE is calculated.For method = "mle" copula parameters are estimated by maximum likelihood using starting valuesobtained by method = "itau". If no starting values are available by inversion of Kendalls tau,starting values have to be provided given expert knowledge and the boundaries max.df and max.BBrespectively. Note: The MLE is performed via numerical maximazation using the L_BFGS-Bmethod. For the Gaussian, the t- and the one-parametric Archimedean copulas we can use thegradients, but for the BB copulas we have to use nite differences for the L_BFGS-B method.A warning message is returned if the estimate of the degrees of freedom parameter of the t-copulais larger than max.df. For high degrees of freedom the t-copula is almost indistinguishable from theGaussian and it is advised to use the Gaussian copula in this case. As a rule of thumb max.df = 3typically is a good choice. Moreover, standard errors of the degrees of freedom parameter estimatecannot be estimated in this case.Valuepar, par2 Estimated copula parameter(s).se,se2 Standard error(s) of the parameter estimate(s) (if se = TRUE).Author(s)Ulf Schepsmeier, Eike Brechmann, Jakob Stoeber, Carlos AlmeidaReferencesJoe, H. (1997). Multivariate Models and Dependence Concepts. Chapman and Hall, London.See AlsoBiCopPar2Tau, BiCopTau2Par RVineSeqEst, BiCopSelectExamples## Example 1: bivariate Gaussian copuladat = BiCopSim(5,1,.7)u1 = dat[,1]v1 = dat[,2]# empirical Kendalls tautau1 = cor(u1,v1,method="kendall")# inversion of empirical Kendalls tauBiCopTau2Par(1,tau1)BiCopEst(u1,v1,family=1,method="itau")$parBiCopGofTest 15# maximum likelihood estimate for comparisonBiCopEst(u1,v1,family=1,method="mle")$par## Example 2: bivariate Clayton and survival Gumbel copulas# simulate from a Clayton copuladat = BiCopSim(5,3,2.5)u2 = dat[,1]v2 = dat[,2]# empirical Kendalls tautau2 = cor(u2,v2,method="kendall")# inversion of empirical Kendalls tau for the Clayton copulaBiCopTau2Par(3,tau2)BiCopEst(u2,v2,family=3,method="itau",se=TRUE)# inversion of empirical Kendalls tau for the survival Gumbel copulaBiCopTau2Par(14,tau2)BiCopEst(u2,v2,family=14,method="itau",se=TRUE)# maximum likelihood estimates for comparisonBiCopEst(u2,v2,family=3,method="mle",se=TRUE)BiCopEst(u2,v2,family=14,method="mle",se=TRUE)BiCopGofTest Goodness-of-t test for bivariate copulasDescriptionThis function performs a goodness-of-t test for bivariate copulas, either based on Whites infor-mation matrix equality (White 1982) as introduced by Wanling and Prokhorov (2011) or based onKendalls process. It computes the test statistics and p-values.UsageBiCopGofTest(u1, u2, family, par=, par2=, method="white", max.df=3, B=1,level=.5)Argumentsu1,u2 Numeric vectors of equal length with values in [0,1].family An integer dening the bivariate copula family: = independence copula1 = Gaussian copula2 = Student t copula (t-copula) (only for method = "white"; see details)3 = Clayton copula16 BiCopGofTest4 = Gumbel copula5 = Frank copula6 = Joe copula (only for method = "kendall")7 = BB1 copula (only for method = "kendall")8 = BB6 copula (only for method = "kendall")9 = BB7 copula (only for method = "kendall")1 = BB8 copula (only for method ="kendall")13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)17 = rotated BB1 copula (180 degrees; survival BB1; only for method = "kendall")18 = rotated BB6 copula (180 degrees; survival BB6; only for method = "kendall")19 = rotated BB7 copula (180 degrees; survival BB7; only for method = "kendall")2 = rotated BB8 copula (180 degrees; survival BB8; only for method = "kendall")23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)26 = rotated Joe copula (90 degrees)27 = rotated BB1 copula (90 degrees; only for method = "kendall")28 = rotated BB6 copula (90 degrees; only for method = "kendall")29 = rotated BB7 copula (90 degrees; only for method = "kendall")3 = rotated BB8 copula (90 degrees; only for method = "kendall")33 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)37 = rotated BB1 copula (270 degrees; only for method = "kendall")38 = rotated BB6 copula (270 degrees; only for method = "kendall")39 = rotated BB7 copula (270 degrees; only for method = "kendall")4 = rotated BB8 copula (270 degrees; only for method = "kendall")par Copula parameter (optional).par2 Second parameter for bivariate t-copula (optional); default: par2 = .max.df Numeric; upper bound for the estimation of the degrees of freedom parameterof the t-copula (default: max.df = 3).method A string indicating the goodness-of-t method:"white" = goodness-of-t test based on Whites information matrix equality(default)"kendall" = goodness-of-t test based on Kendalls processB Integer; number of bootstrap samples (default: B = 1). For B = only thethe test statistics are returned.WARNING: If B is chosen too large, computations will take very long.level Numeric; signicance level of the goodness-of-t test (default: level = .5).Detailsmethod="white":This goodness-of t test uses the information matrix equality of White (1982) and was investigatedby Wanling and Prokhorov (2011). The main contribution is that under correct model specicationBiCopGofTest 17the Fisher Information can be equivalently calculated as minus the expected Hessian matrix or asthe expected outer product of the score function. The null hypothesis isH0 : H() +C() = 0against the alternativeH0 : H() +C() = 0,where H() is the expected Hessian matrix and C() is the expected outer product of the scorefunction. For the calculation of the test statistic we use the consistent maximum likelihood estima-tor and the sample counter parts of H() and C(). The correction of the covariance-matrix inthe test staistic for the uncertainty in the margins is skipped. The implemented tests assumes thatwhere is no uncertainty in the margins. The correction can be found in Wanling and Prokhorov(2011). It involves two-dimensional integrals.WARNING: For the t-copula the test may be instable. The results for the t-copula therefore have totreated carefully.method = "kendall":This copula goodness-of-t test is based on Kendalls process as investigated by Genest and Rivest(1993) and Wang and Wells (2000). For rotated copulas the input arguments are transformed andthe goodness-of-t procedure for the corresponding non-rotated copula is used.ValueFor 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-t test using the Cramer-von Misesstatistic (if B > ).p.value.KS Bootstrapped p-value of the goodness-of-t test using the Kolmogorov-Smirnovstatistic (if B > ).statistic.CvM The observed Cramer-von Mises test statistic.statistic.KS The observed Kolmogorov-Smirnov test statistic.Author(s)Ulf Schepsmeier, Huang Wanling, Jiying Luo, Eike BrechmannReferencesGenest, C. and L.-P. Rivest (1993). Statistical inference procedures for bivariate Archimedeancopulas. Journal of the American Statistical Association, 88 (423), 1034-1043.Luo J. (2011). Stepwise estimation of D-vines with arbitrary specied copula pairs and EDA tools.Diploma thesis, Technische Universitaet Muenchen.http://mediatum.ub.tum.de/?id=179291.18 BiCopHfuncWang, W. and M. T. Wells (2000). Model selection and semiparametric inference for bivariatefailure-time data. Journal of the American Statistical Association, 95 (449), 62-72.Wanling, H. and A. Prokhorov (2011). Agoodness-of-t test for copulas. Submitted for publication.White, H. (1982) Maximum likelihood estimation of misspecied models, Econometrica, 50, 1-26.See AlsoBiCopDeriv2, BiCopDeriv, BiCopIndTest, BiCopVuongClarkeExamples# simulate from a bivariate Clayton copulasimdata = BiCopSim(3,3,2)u1 = simdata[,1]u2 = simdata[,2]# perform Whites goodness-of-fit test for the true copulaBiCopGofTest(u1,u2,family=3)# perform Kendalls goodness-of-fit test for the Frank copulaBiCopGofTest(u1,u2,family=5)## Not run:# perform Kendalls goodness-of-fit test for the true copulagof = BiCopGofTest(u1,u2,family=3,method="kendall")gof$p.value.CvMgof$p.value.KS# perform Kendalls goodness-of-fit test for the Frank copulagof = BiCopGofTest(u1,u2,family=5,method="kendall")gof$p.value.CvMgof$p.value.KS## End(Not run)BiCopHfunc Conditional distribution function (h-function) of a bivariate copulaDescriptionThis function evaluates the conditional distribution function (h-function) of a given parametric bi-variate copula.UsageBiCopHfunc(u1, u2, family, par, par2=)BiCopHfunc 19Argumentsu1,u2 Numeric vectors of equal length with values in [0,1].family An integer dening the bivariate copula family: = independence copula1 = Gaussian copula2 = Student t copula (t-copula)3 = Clayton copula4 = Gumbel copula5 = Frank copula6 = Joe copula7 = BB1 copula8 = BB6 copula9 = BB7 copula1 = BB8 copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)17 = rotated BB1 copula (180 degrees; survival BB1)18 = rotated BB6 copula (180 degrees; survival BB6)19 = rotated BB7 copula (180 degrees; survival BB7)2 = rotated BB8 copula (180 degrees; survival BB8)23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)26 = rotated Joe copula (90 degrees)27 = rotated BB1 copula (90 degrees)28 = rotated BB6 copula (90 degrees)29 = rotated BB7 copula (90 degrees)3 = rotated BB8 copula (90 degrees)33 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)37 = rotated BB1 copula (270 degrees)38 = rotated BB6 copula (270 degrees)39 = rotated BB7 copula (270 degrees)4 = rotated BB8 copula (270 degrees)par Copula parameter.par2 Second parameter for bivariate copulas with two parameters (t, BB1, BB6, BB7,BB8; default: par2 = ).DetailsThe h-function is dened as the conditional distribution function of a bivariate copula, i.e.,h(u|v, ) := F(u|v) = C(u, v)v ,where C is a bivariate copula distribution function with parameter(s) . For more details see Aas etal. (2009).20 BiCopHfuncDerivValuehfunc1 Numeric vector of the conditional distribution function (h-function) evaluated atu2 given u1, i.e., h(u2|u1, ).hfunc2 Numeric vector of the conditional distribution function (h-function) evaluated atu1 given u2, i.e., h(u1|u2, ).Author(s)Ulf SchepsmeierReferencesAas, K., C. Czado, A. Frigessi, and H. Bakken (2009). Pair-copula constructions of multiple de-pendence. Insurance: Mathematics and Economics 44 (2), 182-198.See AlsoBiCopPDF, BiCopCDF, RVineLogLik, RVineSeqEstExamples# load data setdata(daxreturns)# h-functions of the Gaussian copulah1 = BiCopHfunc(daxreturns[,2],daxreturns[,1],1,.5)BiCopHfuncDeriv Derivatives of the h-function of a bivariate copulaDescriptionThis function evaluates the derivative of a given conditional parametric bivariate copula (h-function)with respect to its parameter(s) or one of its arguments.UsageBiCopHfuncDeriv(u1, u2, family, par, par2=, deriv="par")Argumentsu1,u2 Numeric vectors of equal length with values in [0,1].family An integer dening the bivariate copula family: = independence copula1 = Gaussian copula2 = Student t copula (t-copula)3 = Clayton copulaBiCopHfuncDeriv 214 = Gumbel copula5 = Frank copula6 = Joe copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)26 = rotated Joe copula (90 degrees)33 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)par Copula parameter.par2 Second parameter for bivariate t-copula; default: par2 = .deriv Derivative argument"par" = derivative with respect to the rst parameter (default)"par2" = derivative with respect to the second parameter (only available for thet-copula)"u2" = derivative with respect to the second argument u2ValueA numeric vector of the conditional bivariate copula derivative with respect to deriv evaluated atu1 and u2 with parameter(s) par and par2.Author(s)Ulf SchepsmeierReferencesSchepsmeier, U. and J. Stoeber (2012). Derivatives and Fisher information of bivariate copulas.Submitted for publication. http://mediatum.ub.tum.de/node?id=116541.See AlsoRVineGrad, RVineHessian, BiCopDeriv2, BiCopDeriv2, BiCopHfuncDerivExamples# simulate from a bivariate t-copulasimdata = BiCopSim(3,2,-.7,par2=4)# derivative of the conditional bivariate t-copula# with respect to the first parameteru1 = simdata[,1]u2 = simdata[,2]BiCopHfuncDeriv(u1,u2,2,-.7,par2=4, deriv="par")22 BiCopHfuncDeriv2BiCopHfuncDeriv2 Second derivatives of the h-function of a bivariate copulaDescriptionThis function evaluates the second derivative of a given conditional parametric bivariate copula(h-function) with respect to its parameter(s) and/or its arguments.UsageBiCopHfuncDeriv2(u1, u2, family, par, par2=, deriv="par")Argumentsu1,u2 Numeric vectors of equal length with values in [0,1].family An integer dening the bivariate copula family: = independence copula1 = Gaussian copula2 = Student t copula (t-copula)3 = Clayton copula4 = Gumbel copula5 = Frank copula6 = Joe copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)26 = rotated Joe copula (90 degrees)33 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)par Copula parameter.par2 Second parameter for bivariate t-copula; default: par2 = .deriv Derivative argument"par" = second derivative with respect to the rst parameter (default)"par2" = second derivative with respect to the second parameter (only availablefor the t-copula)"u2" = second derivative with respect to the second argument u2"par1par2" = second derivative with respect to the rst and second parameter(only available for the t-copula)"par1u2" = second derivative with respect to the rst parameter and the secondargument"par2u2" = second derivative with respect to the second parameter and the sec-ond argument (only available for the t-copula)BiCopIndTest 23ValueA numeric vector of the second conditional bivariate copula derivative with respect to deriv eval-uated at u1 and u2 with parameter(s) par and par2.Author(s)Ulf Schepsmeier, Jakob StoeberReferencesSchepsmeier, U. and J. Stoeber (2012). Derivatives and Fisher information of bivariate copulas.Submitted for publication. http://mediatum.ub.tum.de/node?id=116541.See AlsoRVineGrad, RVineHessian, BiCopDeriv, BiCopDeriv2, BiCopHfuncDerivExamples# simulate from a bivariate t-copulasimdata = BiCopSim(3,2,-.7,par2=4)# second derivative of the conditional bivariate t-copula# with respect to the first parameteru1 = simdata[,1]u2 = simdata[,2]BiCopHfuncDeriv2(u1,u2,2,-.7,par2=4, deriv="par")BiCopIndTest Independence test for bivariate copula dataDescriptionThis function returns the p-value of a bivariate asymptotic independence test based on Kendallstau.UsageBiCopIndTest(u1, u2)Argumentsu1,u2 Data vectors of equal length with values in [0,1].24 BiCopIndTestDetailsThe test exploits the asymptotic normality of the test statisticstatistic := T =9N(N 1)2(2N + 5) | |,where N is the number of observations (length of u1) and the empirical Kendalls tau of thedata vectors u1 and u2. The p-value of the null hypothesis of bivariate independence hence isasymptoticallyp.value = 2 (1 (T)) ,where is the standard normal distribution function.Valuestatistic Test statistic of the independence test.p.value P-value of the independence test.Author(s)Jeffrey DissmannReferencesGenest, C. and A. C. Favre (2007). Everything you always wanted to know about copula modelingbut were afraid to ask. Journal of Hydrologic Engineering, 12 (4), 347-368.See AlsoBiCopGofTest, BiCopPar2Tau, BiCopTau2Par, BiCopSelect,RVineCopSelect, RVineStructureSelectExamples## Example 1: Gaussian copula with large dependence parameterpar1 = .7fam1 = 1dat1 = BiCopSim(5,fam1,par1)# perform the asymptotic independence testBiCopIndTest(dat1[,1],dat1[,2])## Example 2: Gaussian copula with small dependence parameterpar2 = .1fam2 = 1dat2 = BiCopSim(5,fam2,par2)# perform the asymptotic independence testBiCopIndTest(dat2[,1],dat2[,2])BiCopKPlot 25BiCopKPlot Kendalls plot (K-plot) for bivariate copula dataDescriptionThis function creates a Kendalls plot (K-plot) of given bivariate copula data.UsageBiCopKPlot(u1, u2, PLOT=TRUE, ...)Argumentsu1,u2 Data vectors of equal length with values in [0,1].PLOT Logical; whether the results are plotted. If PLOT = FALSE, the values W.in andHi.sort are returned (see below; default: PLOT = TRUE).... Additional plot arguments.DetailsFor observations ui,j, i = 1, ..., N, j = 1, 2, the K-plot considers two quantities: First, the orderedvalues of the empirical bivariate distribution function Hi := FU1U2(ui,1, ui,2) and, second, Wi:N,which are the expected values of the order statistics from a random sample of size N of the randomvariable W = C(U1, U2) under the null hypothesis of independence between U1 and U2. Wi:N canbe calculated as followsWi:n = N_N 1i 1_ 1_0k0()(K0())i1(1 K0())Nid,whereK0() = log(),and k0() 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 ap-proximately on the diagonal y = x, then U1 and U2 are approximately independent. Any deviationfrom the diagonal line points towards dependence. In case of positive dependence, the points ofthe K-plot should be located above the diagonal line, and vice versa for negative dependence. Thelarger the deviation from the diagonal, the stronger is the degree of dependency. There is a perfectpositive dependence if points (Wi:N, Hi) lie on the curve K0() located above the main diagonal.If points (Wi:N, Hi) however lie on the x-axis, this indicates a perfect negative dependence betweenU1 and U2.ValueW.in W-statistics (x-axis).Hi.sort H-statistics (y-axis).26 BiCopLambdaAuthor(s)Natalia Belgorodski, Ulf SchepsmeierReferencesGenest, C. and A. C. Favre (2007). Everything you always wanted to know about copula modelingbut were afraid to ask. Journal of Hydrologic Engineering, 12 (4), 347-368.See AlsoBiCopMetaContour, BiCopChiPlot, BiCopLambda, BiCopGofTestExamples# Gaussian and Clayton copulasn = 5tau = .5# simulate from Gaussian copulafam1 = 1theta1 = BiCopTau2Par(fam1,tau)dat1 = BiCopSim(n,fam1,theta1)# simulate from Clayton copulafam2 = 3theta2 = BiCopTau2Par(fam2,tau)dat2 = BiCopSim(n,fam2,theta2)# create K-plotsdev.new(width=1,height=5)par(mfrow=c(1,2))BiCopKPlot(dat1[,1],dat1[,2],main="Gaussian copula")BiCopKPlot(dat2[,1],dat2[,2],main="Clayton copula")BiCopLambda Lambda-function (plot) for bivariate copula dataDescriptionThis function plots the lambda-function of given bivariate copula data.UsageBiCopLambda(u1=NULL, u2=NULL, family="emp", par=, par2=,PLOT=TRUE, ...)BiCopLambda 27Argumentsu1,u2 Data vectors of equal length with values in [0,1] (default: u1 and u2 = NULL).family An integer dening the bivariate copula family or indicating the empirical lambda-function:"emp" = empirical lambda-function (default)1 = Gaussian copula; the theoretical lambda-function is simulated (no closedformula available)2 = Student t copula (t-copula); the theoretical lambda-function is simulated (noclosed formula available)3 = Clayton copula4 = Gumbel copula5 = Frank copula6 = Joe copula7 = BB1 copula8 = BB6 copula9 = BB7 copula1 = BB8 copulapar Copula parameter; if the empirical lambda-function is chosen, par = NULL or (default).par2 Second copula parameter for t-, BB1, BB6, BB7 and BB8 copulas (default:par2 = ).PLOT Logical; whether the results are plotted. If PLOT = FALSE, the valuesempLambda and/or theoLambda are returned (see below; default: PLOT = TRUE).... Additional plot arguments.ValueempLambda If the empirical lambda-function is chosen and PLOT=FALSE, a vector of theempirical lambdas is returned.theoLambda If the theoretical lambda-function is chosen and PLOT=FALSE, a vector of thetheoretical lambdas is returned.NoteThe -function is characteristic for each bivariate copula family and dened by Kendalls distribu-tion function K:(v, ) := v K(v, )withK(v, ) := P(C(U1, U2) v), v [0, 1].For Archimedean copulas one has the following closed form expression in terms of the generatorfunction of the copula C:(v, ) = (v)

(v),where

is the derivative of . For more details see Genest and Rivest (1993) or Schepsmeier(2010).28 BiCopLambdaFor the bivariate Gaussian and t-copula no closed form expression for the theoretical -functionexists. Therefore it is simulated based on samples of size 1000. For all other implemented copulafamilies there are closed form expressions available.The plot of the theoretical -function also shows the limits of the -function corresponding toKendalls tau = 0 and Kendalls tau = 1 ( = 0).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 forsurvival copulas u1 and u2 to 1-u1 and 1-u2, respectively. Then -functions for the correspondingnon-rotated copula families can be considered.Author(s)Ulf SchepsmeierReferencesGenest, C. and L.-P. Rivest (1993). Statistical inference procedures for bivariate Archimedeancopulas. Journal of the American Statistical Association, 88 (423), 1034-1043.Schepsmeier, U. (2010). Maximum likelihood estimation of C-vine pair-copula constructions basedon bivariate copulas from different families. Diploma thesis, Technische Universitaet Muenchen.http://mediatum.ub.tum.de/?id=179296.See AlsoBiCopMetaContour, BiCopKPlot, BiCopChiPlotExamples# Clayton and rotated Clayton copulasn = 1tau = .5# simulate from Clayton copulafam = 3theta = BiCopTau2Par(fam,tau)dat = BiCopSim(n,fam,theta)# create lambda-function plotsdev.new(width=16,height=5)par(mfrow=c(1,3))BiCopLambda(dat[,1],dat[,2]) # empirical lambda-functionBiCopLambda(family=fam,par=theta) # theoretical lambda-functionBiCopLambda(dat[,1],dat[,2],family=fam,par=theta) # both# simulate from rotated Clayton copula (9 degrees)fam = 23theta = BiCopTau2Par(fam,-tau)dat = BiCopSim(n,fam,theta)# rotate the data to standard Clayton copula dataBiCopMetaContour 29rot_dat = 1-dat[,1]dev.new(width=16,height=5)par(mfrow=c(1,3))BiCopLambda(rot_dat,dat[,2]) # empirical lambda-functionBiCopLambda(family=3,par=-theta) # theoretical lambda-functionBiCopLambda(rot_dat,dat[,2],family=3,par=-theta) # bothBiCopMetaContour Contour plot of bivariate meta distribution with different margins andcopula (theoretical and empirical)DescriptionThis function plots a bivariate contour plot corresponding to a bivariate meta distribution with differ-ent margins and specied bivariate copula and parameter values or creates corresponding empiricalcontour plots based on bivariate copula data.UsageBiCopMetaContour(u1=NULL, u2=NULL, bw=1, size=1,levels=c(.1,.5,.1,.15,.2),family="emp", par=, par2=, PLOT=TRUE,margins="norm", margins.par=, xylim=NA, ...)Argumentsu1,u2 Data vectors of equal length with values in [0,1] (default: u1 and u2 = NULL).bw Bandwidth (smoothing factor; default: bw = 1).size Number of grid points; default: size = 1.levels Vector of contour levels. For Gaussian, Student t or exponential margins thedefault value (levels = c(.1,.5,.1,.15,.2)) typically is a goodchoice. For uniform margins we recommendlevels = c(.1,.3,.5,.7,.9,1.1,1.3,1.5)and for Gamma marginslevels = c(.5,.1,.3,.5,.7,.9).family An integer dening the bivariate copula family or indicating an empirical con-tour plot:"emp" = empirical contour plot (default; margins can be specied by margins) = independence copula1 = Gaussian copula2 = Student t copula (t-copula)3 = Clayton copula4 = Gumbel copula5 = Frank copula30 BiCopMetaContour6 = Joe copula7 = BB1 copula8 = BB6 copula9 = BB7 copula1 = BB8 copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)17 = rotated BB1 copula (180 degrees; survival BB1)18 = rotated BB6 copula (180 degrees; survival BB6)19 = rotated BB7 copula (180 degrees; survival BB7)2 = rotated BB8 copula (180 degrees; survival BB8)23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)26 = rotated Joe copula (90 degrees)27 = rotated BB1 copula (90 degrees)28 = rotated BB6 copula (90 degrees)29 = rotated BB7 copula (90 degrees)3 = rotated BB8 copula (90 degrees)33 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)37 = rotated BB1 copula (270 degrees)38 = rotated BB6 copula (270 degrees)39 = rotated BB7 copula (270 degrees)4 = rotated BB8 copula (270 degrees)par Copula parameter; if empirical contour plot, par = NULL or (default).par2 Second copula parameter for t-, BB1, BB6, BB7 and BB8 copulas (default:par2 = ).PLOT Logical; whether the results are plotted. If PLOT = FALSE, the values x, y and zare returned (see below; default: PLOT = TRUE).margins Character; margins for the bivariate copula contour plot. Possible margins are:"norm" = standard normal margins (default)"t" = Student t margins with degrees of freedom as specied by margins.par"gamma" = Gamma margins with shape and scale as specied by margins.par"exp" = Exponential margins with rate as specied by margins.par"unif" = uniform marginsmargins.par Parameter(s) of the distribution of the margins if necessary (default: margins.par = ),i.e., a positive real number for the degrees of freedom of Student t margins (seedt), a 2-dimensional vector of positive real numbers for the shape and scaleparameters of Gamma margins (see dgamma), a positive real number for the rate parameter of exponential margins (seedexp).xylim A 2-dimensional vector of the x- and y-limits. By default (xylim = NA) stan-dard limits for the selected margins are used.BiCopMetaContour 31... Additional plot arguments.Valuex A vector of length size with the x-values of the kernel density estimator withGaussian kernel if the empirical contour plot is chosen and a sequence of valuesin xylim if the theoretical contour plot is chosen.y A vector of length size with the y-values of the kernel density estimator withGaussian kernel if the empirical contour plot is chosen and a sequence of valuesin xylim if the theoretical contour plot is chosen.z A matrix of dimension size with the values of the density of the meta distribu-tion with chosen margins (see margins and margins.par) evaluated at the gridpoints given by x and y.NoteThe combination family = (independence copula) and margins = "unif" (uniform margins)is not possible because all z-values are equal.Author(s)Ulf Schepsmeier, Alexander BauerSee AlsoBiCopChiPlot, BiCopKPlot, BiCopLambdaExamples## Example 1: contour plot of meta Gaussian copula distribution## with Gaussian marginstau = .5fam = 1theta = BiCopTau2Par(fam,tau)BiCopMetaContour(u1=NULL,u2=NULL,bw=1,size=1,levels=c(.1,.5,.1,.15,.2),family=fam,par=theta,main="tau=.5")## Example 2: empirical contour plot with standard normal marginsdat = BiCopSim(N=1,fam,theta)BiCopMetaContour(dat[,1],dat[,2],bw=2,size=1,levels=c(.1,.5,.1,.15,.2),par=,family="emp",main="N=1")# empirical contour plot with exponential marginsBiCopMetaContour(dat[,1],dat[,2],bw=2,size=1,levels=c(.1,.5,.1,.15,.2),par=,family="emp",main="n=5",margins="exp",margins.par=1)32 BiCopNameBiCopName Bivariate copula family namesDescriptionThis function transforms the bivariate copula family number into its character expression and viceversa.UsageBiCopName(family, short=TRUE)Argumentsfamily Bivariate copula family, either its number or its character expression (see tablebelow).No. Short name Long name "I" "Independence"1 "N" "Gaussian"2 "t" "t"3 "C" "Clayton"4 "G" "Gumbel"5 "F" "Frank"6 "J" "Joe"7 "BB1" "Clayton-Gumbel"8 "BB6" "Joe-Gumbel"9 "BB7" "Joe-Clayton"1 "BB8" "Frank-Joe"13 "SC" "Survival Clayton"14 "SG" "Survival Gumbel"16 "SJ" "Survival Joe"17 "SBB1" "Survival Clayton-Gumbel"18 "SBB6" "Survival Joe-Gumbel"19 "SBB7" "Survival Joe-Clayton"2 "SBB8" "Survival Joe-Frank"23 "C9" "Rotated Clayton 9 degrees"24 "G9" "Rotated Gumbel 9 degrees"26 "J9" "Rotated Joe 9 degrees"27 "BB1_9" "Rotated Clayton-Gumbel 9 degrees"28 "BB6_9" "Rotated Joe-Gumbel 9 degrees"29 "BB7_9" "Rotated Joe-Clayton 9 degrees"3 "BB8_9" "Rotated Frank-Joe 9 degrees"33 "C27" "Rotated Clayton 27 degrees"34 "G27" "Rotated Gumbel 27 degrees"36 "J27" "Rotated Joe 27 degrees"37 "BB1_27" "Rotated Clayton-Gumbel 27 degrees"BiCopPar2TailDep 3338 "BB6_27" "Rotated Joe-Gumbel 27 degrees"39 "BB7_27" "Rotated Joe-Clayton 27 degrees"4 "BB8_27" "Rotated Frank-Joe 27 degrees"short Logical; if the number of a bivariate copula family is used and short = TRUE(default), a short version of the corresponding character expression is returned,otherwise the long version.ValueThe transformed bivariate copula family (see table above).Author(s)Ulf SchepsmeierSee AlsoRVineTreePlotExamples# family as numberfamily = 1BiCopName(family,short=TRUE) # short versionBiCopName(family,short=FALSE) # long version# family as character expression (short version)family = "C"BiCopName(family) # as number# long versionfamily = "Clayton"BiCopName(family) # as numberBiCopPar2TailDep Tail dependence coefcients of a bivariate copulaDescriptionThis function computes the theoretical tail dependence coefcients of a bivariate copula for givenparameter values.UsageBiCopPar2TailDep(family, par, par2=)34 BiCopPar2TailDepArgumentsfamily An integer dening the bivariate copula family: = independence copula1 = Gaussian copula2 = Student t copula (t-copula)3 = Clayton copula4 = Gumbel copula5 = Frank copula6 = Joe copula7 = BB1 copula8 = BB6 copula9 = BB7 copula1 = BB8 copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)17 = rotated BB1 copula (180 degrees; survival BB1)18 = rotated BB6 copula (180 degrees; survival BB6)19 = rotated BB7 copula (180 degrees; survival BB7)2 = rotated BB8 copula (180 degrees; survival BB8)23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)26 = rotated Joe copula (90 degrees)27 = rotated BB1 copula (90 degrees)28 = rotated BB6 copula (90 degrees)29 = rotated BB7 copula (90 degrees)3 = rotated BB8 copula (90 degrees)33 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)37 = rotated BB1 copula (270 degrees)38 = rotated BB6 copula (270 degrees)39 = rotated BB7 copula (270 degrees)4 = rotated BB8 copula (270 degrees)par Copula parameter.par2 Second parameter for the two parameter t-, BB1, BB6, BB7 and BB8 copulas(default: par2 = ).Valuelower Lower tail dependence coefcient of the given bivariate copula family C:L = limu0C(u, u)uupper Upper tail dependence coefcient of the given bivariate copula family C:U = limu11 2u +C(u, u)1 uBiCopPar2TailDep 35Lower and upper tail dependence coefcients for bivariate copula families and parameters ( forone parameter families and the rst 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 dependence1 - -2 2t+1_ + 1_11+_ 2t+1_ + 1_11+_3 21/-4 - 2 21/5 - -6 - 2 21/7 21/()2 21/8 - 2 21/()9 21/2 21/1 - 2 21/if = 1 otherwise 013 - 21/14 2 21/-16 2 21/-17 2 21/21/()18 2 21/()-19 2 21/21/2 2 21/if = 1 otherwise 0 -23, 33 - -24, 34 - -26, 36 - -27, 37 - -28, 38 - -29, 39 - -3, 4 - -Author(s)Eike BrechmannReferencesJoe, H. (1997). Multivariate Models and Dependence Concepts. Chapman and Hall, London.See AlsoBiCopPar2TauExamples## Example 1: Gaussian copulaBiCopPar2TailDep(1,.7)## Example 2: t copula36 BiCopPar2TauBiCopPar2TailDep(2,.7,4)BiCopPar2Tau Kendalls tau value of a bivariate copulaDescriptionThis function computes the theoretical Kendalls tau value of a bivariate copula for given parametervalues.UsageBiCopPar2Tau(family, par, par2=)Argumentsfamily An integer dening the bivariate copula family: = independence copula1 = Gaussian copula2 = Student t copula (t-copula)3 = Clayton copula4 = Gumbel copula5 = Frank copula6 = Joe copula7 = BB1 copula8 = BB6 copula9 = BB7 copula1 = BB8 copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)17 = rotated BB1 copula (180 degrees; survival BB1)18 = rotated BB6 copula (180 degrees; survival BB6)19 = rotated BB7 copula (180 degrees; survival BB7)2 = rotated BB8 copula (180 degrees; survival BB8)23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)26 = rotated Joe copula (90 degrees)27 = rotated BB1 copula (90 degrees)28 = rotated BB6 copula (90 degrees)29 = rotated BB7 copula (90 degrees)3 = rotated BB8 copula (90 degrees)33 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)37 = rotated BB1 copula (270 degrees)38 = rotated BB6 copula (270 degrees)BiCopPar2Tau 3739 = rotated BB7 copula (270 degrees)4 = rotated BB8 copula (270 degrees)par Copula parameter.par2 Second parameter for the two parameter BB1, BB6, BB7 and BB8 copulas (de-fault: par2 = ). Note that the degrees of freedom parameter of the t-copuladoes not need to be set, because the theoretical Kendalls tau value of the t-copula is independent of this choice.ValueTheoretical value of Kendalls tau corresponding to the bivariate copula family and parameter(s) (for one parameter families and the rst parameter of the t-copula, and for the two parameterBB1, BB6, BB7 and BB8 copulas).No. Kendalls tau1, 2 2 arcsin()3, 13 +24, 14 1 15 1 4 + 4D1()with D1() =_0x/exp(x)1dx (Debye function)6, 16 1 + 42_10 xlog(x)(1 x)2(1)/dx7, 17 1 2(+2)8, 18 1 + 4_10 log((1 t)+ 1)(1 t (1 t)+ (1 t)t)/()dt9, 19 1 + 4_10 ((1 (1 t)))/((1 t)1(1 (1 t))1)dt1, 2 1 + 4_10 log_((1 t)1)/((1 )1)_(1 t (1 t)+ (1 t)t)/()dt23, 33 224, 34 1 126, 36 1 42_10 xlog(x)(1 x)2(1+)/dx27, 37 1 2(2)28, 38 1 4_10 log((1 t)+ 1)(1 t (1 t)+ (1 t)t)/()dt29, 39 1 4_10 ((1 (1 t)))/((1 t)1(1 (1 t))1)dt3, 4 1 4_10 log_((1 +t)1)/((1 +)1)_(1 +t (1 +t)(1 +t)t)/()dtAuthor(s)Ulf SchepsmeierReferencesJoe, 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-vineswith application to exchange rates. Statistical Modelling, 12(3), 229-255.38 BiCopPDFSee AlsoBiCopTau2ParExamples## Example 1: Gaussian copulatt1 = BiCopPar2Tau(1,.7)# transform backBiCopTau2Par(1,tt1)## Example 2: Clayton copulaBiCopPar2Tau(3,1.3)BiCopPDF Density of a bivariate copulaDescriptionThis function evaluates the probability density function (PDF) of a given parametric bivariate cop-ula.UsageBiCopPDF(u1, u2, family, par, par2=)Argumentsu1,u2 Numeric vectors of equal length with values in [0,1].family An integer dening the bivariate copula family: = independence copula1 = Gaussian copula2 = Student t copula (t-copula)3 = Clayton copula4 = Gumbel copula5 = Frank copula6 = Joe copula7 = BB1 copula8 = BB6 copula9 = BB7 copula1 = BB8 copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)17 = rotated BB1 copula (180 degrees; survival BB1)18 = rotated BB6 copula (180 degrees; survival BB6)BiCopPDF 3919 = rotated BB7 copula (180 degrees; survival BB7)2 = rotated BB8 copula (180 degrees; survival BB8)23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)26 = rotated Joe copula (90 degrees)27 = rotated BB1 copula (90 degrees)28 = rotated BB6 copula (90 degrees)29 = rotated BB7 copula (90 degrees)3 = rotated BB8 copula (90 degrees)33 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)37 = rotated BB1 copula (270 degrees)38 = rotated BB6 copula (270 degrees)39 = rotated BB7 copula (270 degrees)4 = rotated BB8 copula (270 degrees)par Copula parameter.par2 Second parameter for bivariate copulas with two parameters (t, BB1, BB6, BB7,BB8; default: par2 = ).ValueA numeric vector of the bivariate copula density evaluated at u1 and u2.Author(s)Eike BrechmannSee AlsoBiCopCDF, BiCopHfunc, BiCopSimExamples# simulate from a bivariate t-copulasimdata = BiCopSim(3,2,-.7,par2=4)# evaluate the density of the bivariate t-copulau1 = simdata[,1]u2 = simdata[,2]BiCopPDF(u1,u2,2,-.7,par2=4)40 BiCopSelectBiCopSelect Selection and maximum likelihood estimation of bivariate copula fam-iliesDescriptionThis function selects an appropriate bivariate copula family for given bivariate copula data using oneof a range of methods. The corresponding parameter estimates are obtained by maximum likelihoodestimation.UsageBiCopSelect(u1, u2, familyset=NA, selectioncrit="AIC",indeptest=FALSE, level=.5, weights=NA)Argumentsu1,u2 Data vectors of equal length with values in [0,1].familyset Vector of bivariate copula families to select from (the independence copulaMUST NOT be specied in this vector, otherwise it will be selected). The vectorhas to include at least one bivariate copula family that allows for positive andone that allows for negative dependence. If familyset = NA (default), selectionamong all possible families is performed. Coding of bivariate copula families:1 = Gaussian copula2 = Student t copula (t-copula)3 = Clayton copula4 = Gumbel copula5 = Frank copula6 = Joe copula7 = BB1 copula8 = BB6 copula9 = BB7 copula1 = BB8 copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)17 = rotated BB1 copula (180 degrees; survival BB1)18 = rotated BB6 copula (180 degrees; survival BB6)19 = rotated BB7 copula (180 degrees; survival BB7)2 = rotated BB8 copula (180 degrees; survival BB8)23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)26 = rotated Joe copula (90 degrees)27 = rotated BB1 copula (90 degrees)28 = rotated BB6 copula (90 degrees)29 = rotated BB7 copula (90 degrees)3 = rotated BB8 copula (90 degrees)BiCopSelect 4133 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)37 = rotated BB1 copula (270 degrees)38 = rotated BB6 copula (270 degrees)39 = rotated BB7 copula (270 degrees)4 = rotated BB8 copula (270 degrees)selectioncrit Character indicating the criterion for bivariate copula selection. Possible choices:selectioncrit = "AIC" (default) or "BIC".indeptest Logical; whether a hypothesis test for the independence of u1 and u2 is per-formed before bivariate copula selection (default: indeptest = FALSE; seeBiCopIndTest). The independence copula is chosen if the null hypothesis ofindependence cannot be rejected.level Numeric; signicance level of the independence test (default: level = .5).weights Numerical; weights for each observation (opitional).DetailsCopulas can be selected according to the Akaike and Bayesian Information Criteria (AIC and BIC,respectively). First all available copulas are tted using maximum likelihood estimation. Then thecriteria 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) andthe family with the minimum value is chosen. For observations ui,j, i = 1, ..., N, j = 1, 2, theAIC of a bivariate copula family c with parameter(s) is dened asAIC := 2N

i=1ln[c(ui,1, ui,2|)] + 2k,where k = 1 for one parameter copulas and k = 2 for the two parameter t-, BB1, BB6, BB7 andBB8 copulas. Similarly, the BIC is given byBIC := 2N

i=1ln[c(ui,1, ui,2|)] + ln(N)k.Evidently, if the BIC is chosen, the penalty for two parameter families is stronger than when usingthe AIC.Additionally a test for independence can be performed beforehand.Valuefamily The selected bivariate copula family.par, par2 The estimated bivariate copula parameter(s).p.value.indeptestP-value of the independence test if performed.42 BiCopSelectNoteWhen the bivariate t-copula is considered and the degrees of freedom are estimated to be larger than30, then the bivariate Gaussian copula is taken into account instead. Similarly, when BB1 (Clayton-Gumbel), BB6 (Joe-Gumbel), BB7 (Joe-Clayton) or BB8 (Joe-Frank) copulas are considered andthe parameters are estimated to be very close to one of their boundary cases, the respective oneparameter copula is taken into account instead.Author(s)Eike Brechmann, Jeffrey DissmannReferencesAkaike, 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 InformationTheory Budapest, Akademiai Kiado, pp. 267-281.Brechmann, E. C. (2010). Truncated and simplied regular vines and their applications. Diplomathesis, Technische Universitaet Muenchen.http://mediatum.ub.tum.de/?id=179285.Manner, H. (2007). Estimation and model selection of copulas with an application to exchangerates. METEOR research memorandum 07/056, Maastricht University.Schwarz, G. E. (1978). Estimating the dimension of a model. Annals of Statistics 6 (2), 461-464.See AlsoRVineStructureSelect, RVineCopSelect, BiCopIndTestExamples## Example 1: Gaussian copula with large dependence parameterpar1 = .7fam1 = 1dat1 = BiCopSim(5,fam1,par1)# select the bivariate copula family and estimate the parameter(s)cop1 = BiCopSelect(dat1[,1],dat1[,2],familyset=c(1:1),indeptest=FALSE,level=.5)cop1$familycop1$parcop1$par2## Example 2: Gaussian copula with small dependence parameterpar2 = .1fam2 = 1dat2 = BiCopSim(5,fam2,par2)# select the bivariate copula family and estimate the parameter(s)cop2 = BiCopSelect(dat2[,1],dat2[,2],familyset=c(1:1),indeptest=TRUE,level=.5)BiCopSim 43cop2$familycop2$parcop2$par2## Example 3: empirical datadata(daxreturns)cop3 = BiCopSelect(daxreturns[,1],daxreturns[,4],familyset=c(1:1,13,14,16,23,24,26))cop3$familycop3$parcop3$par2BiCopSim Simulation from a bivariate copulaDescriptionThis function simulates from a given parametric bivariate copula.UsageBiCopSim(N, family, par, par2=)ArgumentsN Number of bivariate observations simulated.family An integer dening the bivariate copula family: = independence copula1 = Gaussian copula2 = Student t copula (t-copula)3 = Clayton copula4 = Gumbel copula5 = Frank copula6 = Joe copula7 = BB1 copula8 = BB6 copula9 = BB7 copula1 = BB8 copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)17 = rotated BB1 copula (180 degrees; survival BB1)18 = rotated BB6 copula (180 degrees; survival BB6)19 = rotated BB7 copula (180 degrees; survival BB7)2 = rotated BB8 copula (180 degrees; survival BB8)23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)44 BiCopTau2Par26 = rotated Joe copula (90 degrees)27 = rotated BB1 copula (90 degrees)28 = rotated BB6 copula (90 degrees)29 = rotated BB7 copula (90 degrees)3 = rotated BB8 copula (90 degrees)33 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)37 = rotated BB1 copula (270 degrees)38 = rotated BB6 copula (270 degrees)39 = rotated BB7 copula (270 degrees)4 = rotated BB8 copula (270 degrees)par Copula parameter.par2 Second parameter for bivariate copulas with two parameters (t, BB1,BB6, BB7,BB8; default: par2 = ).ValueAn N x 2 matrix of data simulated from the bivariate copula.Author(s)Ulf SchepsmeierSee AlsoBiCopCDF, BiCopPDF, RVineSimExamples# simulate from a bivariate t-copulasimdata = BiCopSim(3,2,-.7,par2=4)BiCopTau2Par Parameter of a bivariate copula for a given Kendalls tau valueDescriptionThis function computes the parameter of a one parameter bivariate copula for a given value ofKendalls tau.UsageBiCopTau2Par(family, tau)BiCopTau2Par 45Argumentstau Kendalls tau value (numeric in [-1,1]).family An integer dening the bivariate copula family: = independence copula1 = Gaussian copula3 = Clayton copula4 = Gumbel copula5 = Frank copula6 = Joe copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)26 = rotated Joe copula (90 degrees)33 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)Note that two parameter bivariate copula families cannot be used.ValueParameter corresponding to the bivariate copula family and the value of Kendalls tau ().No. Parameter1, 2 sin( 2)3, 13 max(0, 2 1 )4, 14 max(1, 11 )5 no closed form expression (numerical inversion)6, 16 no closed form expression (numerical inversion)23, 33 max(0, 2 1+ )24, 34 min(1, 11+ )26, 36 no closed form expression (numerical inversion)Author(s)Jakob Stoeber, Eike BrechmannReferencesJoe, 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-vineswith application to exchange rates. Statistical Modelling, 12(3), 229-255.See AlsoBiCopTau2Par46 BiCopVuongClarkeExamples## Example 1: Gaussian copulatt1 = BiCopTau2Par(1,.5)# transform backBiCopPar2Tau(1,tt1)## Example 2: Clayton copulaBiCopTau2Par(3,.4)BiCopVuongClarke Scoring goodness-of-t test based on Vuong and Clarke tests for bi-variate copula dataDescriptionBased on the Vuong and Clarke tests this function computes a goodness-of-t score for each bivari-ate copula family under consideration. For each possible pair of copula families the Vuong and theClarke tests decides which of the two families ts the given data best and assigns a scorepro orcontra a copula familyaccording to this decision.UsageBiCopVuongClarke(u1, u2, familyset=NA,correction=FALSE, level=.5)Argumentsu1,u2 Data vectors of equal length with values in [0,1].familyset An integer vector of bivariate copula families under consideration, i.e., which arecompared in the goodness-of-t test. If familyset = NA (default), all possiblefamilies are compared. Possible families are: = independence copula1 = Gaussian copula2 = Student t copula (t-copula)3 = Clayton copula4 = Gumbel copula5 = Frank copula6 = Joe copula7 = BB1 copula8 = BB6 copula9 = BB7 copula1 = BB8 copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)BiCopVuongClarke 4717 = rotated BB1 copula (180 degrees; survival BB1)18 = rotated BB6 copula (180 degrees; survival BB6)19 = rotated BB7 copula (180 degrees; survival BB7)2 = rotated BB8 copula (180 degrees; survival BB8)23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)26 = rotated Joe copula (90 degrees)27 = rotated BB1 copula (90 degrees)28 = rotated BB6 copula (90 degrees)29 = rotated BB7 copula (90 degrees)3 = rotated BB8 copula (90 degrees)33 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)37 = rotated BB1 copula (270 degrees)38 = rotated BB6 copula (270 degrees)39 = rotated BB7 copula (270 degrees)4 = rotated BB8 copula (270 degrees)correction Correction for the number of parameters. Possible choices: correction = FALSE(no correction; default), "Akaike" and "Schwarz".level Numerical; signicance level of the tests (default: level = .5).DetailsThe Vuong as well as the Clarke test compare two models against each other and based on theirnull hypothesis, allow for a statistically signicant decision among the two models (see the doc-umentations of RVineVuongTest and RVineClarkeTest for descriptions of the two tests). In thegoodness-of-t test proposed by Belgorodski (2010) this is used for bivariate copula selection. Itcompares a model 0 to all other possible models under consideration. If model 0 is favored overanother model, a score of "+1" is assigned and similarly a score of "-1" if the other model is de-termined to be superior. No score is assigned, if the respective test cannot discriminate betweentwo models. Both tests can be corrected for the numbers of parameters used in the copulas. Ei-ther no correction (correction = FALSE), the Akaike correction (correction = "Akaike") orthe parsimonious Schwarz correction (correction = "Schwarz") can be used.The models compared here are bivariate parametric copulas and we would like to determine whichfamily ts the data better than the other families. E.g., if we would like to test the hypothesis that thebivariate Gaussian copula ts the data best, then we compare the Gaussian copula against all othercopulas under consideration. In doing so, we investigate the null hypothesis "The Gaussian copulats the data better than all other copulas under consideration", which corresponds to k 1 times thehypothesis "The Gaussian copula Cj ts the data better than copula Ci" for all i = 1, ..., k, i = j,where k is the number of bivariate copula families under consideration (length of familyset). Thisprocedure 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 copulafamily. If used as a goodness-of-t procedure, the family with the highest score should be selected.For more and detailed information about the goodness-of-t test see Belgorodski (2010).48 C2RVineValueA matrix with Vuong test scores in the rst and Clarke test scores in the second row. Column namescorrespond to bivariate copula families (see above).Author(s)Ulf Schepsmeier, Eike Brechmann, Natalia BelgorodskiReferencesBelgorodski, N. (2010) Selecting pair-copula families for regular vines with application to themultivariate analysis of European stock market indices Diploma thesis, Technische UniversitaetMuenchen. http://mediatum.ub.tum.de/?id=179284.Clarke, K. A. (2007). A Simple Distribution-Free Test for Nonnested Model Selection. PoliticalAnalysis, 15, 347-363.Vuong, Q. H. (1989). Ratio tests for model selection and non-nested hypotheses. Econometrica 57(2), 307-333.See AlsoBiCopGofTest, RVineVuongTest, RVineClarkeTest, BiCopSelectExamples## Not run:# simulate from a t-copuladat = BiCopSim(5,2,.7,5)# apply the test for families 1-1vcgof = BiCopVuongClarke(dat[,1],dat[,2],familyset=c(1:1))# display the Vuong test scoresvcgof[1,]## End(Not run)C2RVine Transform C-vine to R-vine structureDescriptionThis function transforms a C-vine structure from the package CDVine to the corresponding R-vinestructure.UsageC2RVine(order, family, par, par2=rep(,length(family)))C2RVine 49Argumentsorder 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 = independence copula1 = Gaussian copula2 = Student t copula (t-copula)3 = Clayton copula4 = Gumbel copula5 = Frank copula6 = Joe copula7 = BB1 copula8 = BB6 copula9 = BB7 copula1 = BB8 copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)17 = rotated BB1 copula (180 degrees; survival BB1)18 = rotated BB6 copula (180 degrees; survival BB6)19 = rotated BB7 copula (180 degrees; survival BB7)2 = rotated BB8 copula (180 degrees; survival BB8)23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)26 = rotated Joe copula (90 degrees)27 = rotated BB1 copula (90 degrees)28 = rotated BB6 copula (90 degrees)29 = rotated BB7 copula (90 degrees)3 = rotated BB8 copula (90 degrees)33 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)37 = rotated BB1 copula (270 degrees)38 = rotated BB6 copula (270 degrees)39 = rotated BB7 copula (270 degrees)4 = rotated BB8 copula (270 degrees)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:par2 = rep(,length(family))), necessary for the t-, BB1, BB6, BB7 andBB8 copulas.ValueAn RVineMatrix object.Author(s)Ulf Schepsmeier, Eike Brechmann50 D2RVineSee AlsoRVineMatrix, D2RVineExamples# simulate a sample of size 5 from a 4-dimensional C-vine# copula model with mixed pair-copulas# load package CDVinelibrary(CDVine)d = 4dd = d*(d-1)/2order = 1:dfamily = c(1,2,3,4,7,3)par = c(.5,.4,2,1.5,1.2,1.5)par2 = c(,5,,,2,)type = 1simdata = CDVineSim(5,family,par,par2,type)# determine log-likelihoodout = CDVineLogLik(simdata,family,par,par2,type)out$loglik# transform to R-vine matrix notationRVM = C2RVine(order,family,par,par2)# check that log-likelihood stays the sameout2 = RVineLogLik(simdata,RVM)out2$loglikD2RVine Transform D-vine to R-vine structureDescriptionThis function transforms a D-vine structure from the package CDVine to the corresponding R-vinestructure.UsageD2RVine(order, family, par, par2=rep(,length(family)))Argumentsorder 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 = independence copula1 = Gaussian copula2 = Student t copula (t-copula)D2RVine 513 = Clayton copula4 = Gumbel copula5 = Frank copula6 = Joe copula7 = BB1 copula8 = BB6 copula9 = BB7 copula1 = BB8 copula13 = rotated Clayton copula (180 degrees; survival Clayton)14 = rotated Gumbel copula (180 degrees; survival Gumbel)16 = rotated Joe copula (180 degrees; survival Joe)17 = rotated BB1 copula (180 degrees; survival BB1)18 = rotated BB6 copula (180 degrees; survival BB6)19 = rotated BB7 copula (180 degrees; survival BB7)2 = rotated BB8 copula (180 degrees; survival BB8)23 = rotated Clayton copula (90 degrees)24 = rotated Gumbel copula (90 degrees)26 = rotated Joe copula (90 degrees)27 = rotated BB1 copula (90 degrees)28 = rotated BB6 copula (90 degrees)29 = rotated BB7 copula (90 degrees)3 = rotated BB8 copula (90 degrees)33 = rotated Clayton copula (270 degrees)34 = rotated Gumbel copula (270 degrees)36 = rotated Joe copula (270 degrees)37 = rotated BB1 copula (270 degrees)38 = rotated BB6 copula (270 degrees)39 = rotated BB7 copula (270 degrees)4 = rotated BB8 copula (270 degrees)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:par2 = rep(,length(family))), necessary for the t-, BB1, BB6, BB7 andBB8 copulas.ValueAn RVineMatrix object.Author(s)Ulf SchepsmeierSee AlsoRVineMatrix, C2RVineExamples# simulate a sample of size 5 from a 4-dimensional D-vine52 daxreturns# copula model with mixed pair-copulas# load package CDVinelibrary(CDVine)d = 4dd = d*(d-1)/2order = 1:dfamily = c(1,2,3,4,7,3)par = c(.5,.4,2,1.5,1.2,1.5)par2 = c(,5,,,2,)type = 2simdata = CDVineSim(5,family,par,par2,type)# determine log-likelihoodout = CDVineLogLik(simdata,family,par,par2,type)out$loglik# transform to R-vine matrix notationRVM = D2RVine(order,family,par,par2)# check that log-likelihood stays the sameout2 = RVineLogLik(simdata,RVM)out2$loglikdaxreturns Major German StocksDescriptionThis data set contains transformed standardized residuals of daily log returns of 15 major Germanstocks represented in the index DAX observed from January 2005 to August 2009. Each time seriesis ltered using a GARCH(1,1) model with Student t innovations.FormatA data frame with 1158 observations on 15 variables. Column names correspond to ticker symbolsof the stocks.SourceYahoo! FinanceSee AlsoRVineStructureSelectRVineAIC/BIC 53Examples# load the data setdata(daxreturns)# compute the empirical Kendalls tau matrixTauMatrix(daxreturns)RVineAIC/BIC AIC and BIC of an R-vine copula modelDescriptionThese functions calculate the Akaike and Bayesian Information criteria of a d-dimensional R-vinecopula model for a given copula data set.UsageRVineAIC(data, RVM, par=RVM$par, par2=RVM$par2)RVineBIC(data, RVM, par=RVM$par, par2=RVM$par2)Argumentsdata An N x d data matrix (with uniform margins).RVM An RVineMatrix object including the structure and the pair-copula families andparameters.par Ad x d matrix with the pair-copula parameters (optional; default: par = RVM$par).par2 A d x d matrix with the second parameters of pair-copula families with twoparameters (optional; default: par2 = RVM$par2).DetailsIf k denotes the number of parameters of an R-vine copula model with log-likelihood lRV ine andparameter set , then the Akaike Information Criterion (AIC) by Akaike (1973) is dened asAIC := 2lRV ine (|u) + 2k,for observations u = (u

1, ..., u

N)

.Similarly, the Bayesian Information Criterion (BIC) by Schwarz (1978) is given byBIC := 2lRV ine (|u) + log(N)k.ValueAIC, BIC The computed AIC or BIC value, respectively.pair.AIC, pair.BICA d x d matrix of individual contributions to the AIC or BIC value for each pair-copula, respectively. Note: AIC = sum(pair.AIC) and similarly BIC = sum(pair.BIC).54 RVineClarkeTestAuthor(s)Eike BrechmannReferencesAkaike, 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 InformationTheory Budapest, Akademiai Kiado, pp. 267-281.Schwarz, G. E. (1978). Estimating the dimension of a model. Annals of Statistics 6 (2), 461-464.See AlsoRVineLogLik, RVineVuongTest, RVineClarkeTestExamples# define 5-dimensional R-vine tree structure matrixMatrix = c(5,2,3,1,4,,2,3,4,1,,,3,4,1,,,,4,1,,,,,1)Matrix = matrix(Matrix,5,5)# define R-vine pair-copula family matrixfamily = c(,1,3,4,4,,,3,4,1,,,,4,1,,,,,3,,,,,)family = matrix(family,5,5)# define R-vine pair-copula parameter matrixpar = c(,.2,.9,1.5,3.9,,,1.1,1.6,.9,,,,1.9,.5,,,,,4.8,,,,,)par = matrix(par,5,5)# define second R-vine pair-copula parameter matrixpar2 = matrix(,5,5)# define RVineMatrix objectRVM = RVineMatrix(Matrix=Matrix,family=family,par=par,par2=par2,names=c("V1","V2","V3","V4","V5"))# simulate a sample of size 3 from the R-vine copula modelsimdata = RVineSim(3,RVM)# compute AIC and BICRVineAIC(simdata,RVM)RVineBIC(simdata,RVM)RVineClarkeTest Clarke test comparing two R-vine copula modelsDescriptionThis function performs a Clarke test between two d-dimensional R-vine copula models as speciedby their RVineMatrix objects.RVineClarkeTest 55UsageRVineClarkeTest(data, RVM1, RVM2)Argumentsdata An N x d data matrix (with uniform margins).RVM1, RVM2 RVineMatrix objects of mo