pyvine: The Python Package for Regular Vine Copula Modeling, Sampling and Testing

Zhenfei Yuan , Taizhong Hu

Communications in Mathematics and Statistics ›› 2021, Vol. 9 ›› Issue (1) : 53 -86.

PDF
Communications in Mathematics and Statistics ›› 2021, Vol. 9 ›› Issue (1) : 53 -86. DOI: 10.1007/s40304-019-00195-2
Article

pyvine: The Python Package for Regular Vine Copula Modeling, Sampling and Testing

Author information +
History +
PDF

Abstract

Regular vine copula provides rich models for dependence structure modeling. It combines vine structures and families of bivariate copulas to construct a number of multivariate distributions that can model a wide range dependence patterns with different tail dependence for different pairs. Two special cases of regular vine copulas, C-vine and D-vine copulas, have been extensively investigated in the literature. We propose the Python package, pyvine, for modeling, sampling and testing a more generalized regular vine copula (R-vine for short). R-vine modeling algorithm searches for the R-vine structure which maximizes the vine tree dependence in a sequential way. The maximum likelihood estimation algorithm takes the sequential estimations as initial values and uses L-BFGS-B algorithm for the likelihood value optimization. R-vine sampling algorithm traverses all edges of the vine structure from the last tree in a recursive way and generates the marginal samples on each edge according to some nested conditions. Goodness-of-fit testing algorithm first generates Rosenblatt’s transformed data ${\varvec{E}}$ and then tests the hypothesis $H_0^*: {\varvec{E}} \sim C_{\perp }$ by using Anderson–Darling statistic, where $C_{\perp }$ is the independence copula. Bootstrap method is used to compute an adjusted p-value of the empirical distribution of replications of Anderson–Darling statistic. The computing of related functions of copulas such as cumulative distribution functions, H-functions and inverse H-functions often meets with the problem of overflow. We solve this problem by reinvestigating the following six families of bivariate copulas: Normal, Student t, Clayton, Gumbel, Frank and Joe’s copulas. Approximations of the above related functions of copulas are given when the overflow occurs in the computation. All these are implemented in a subpackage bvcopula, in which subroutines are written in Fortran and wrapped into Python and, hence, good performance is guaranteed.

Keywords

Regular vine copula / Dependence structure / Multivariate modeling / Multivariate sampling / Rosenblatt’s transformation / Anderson–Darling test / Bivariate copula / Python

Cite this article

Download citation ▾
Zhenfei Yuan, Taizhong Hu. pyvine: The Python Package for Regular Vine Copula Modeling, Sampling and Testing. Communications in Mathematics and Statistics, 2021, 9(1): 53-86 DOI:10.1007/s40304-019-00195-2

登录浏览全文

4963

注册一个新账户 忘记密码

References

[1]

Aas K, Czado C, Frigessi A, Bakken H. Pair-copula constructions of multiple dependence. Insur. Math. Econ.. 2009, 44 182-198

[2]

Acar E, Genest C, Nešlehová J. Beyond simplified pair-copula constructions. J. Multivar. Anal.. 2012, 110 74-90

[3]

Bedford T, Cooke RM. Probability density decomposition for conditionally dependent random variables modeled by vines. Ann. Math. Artif. Intell.. 2001, 32 245-268

[4]

Bedford T, Cooke RM. Vines—a new graphical model for dependent random variables. Ann Stat. 2002, 30 1031-1068

[5]

Brechmann EC, Schepsmeier U. Modeling dependence with C- and D-vine copulas: the R package CDvine. J. Stat. Softw. 2013, 52 1-27

[6]

Brent R. Algorithms for Minimization Without Derivatives. 1973 Englewood Cliffs: Prentice Hall

[7]

Breymann W, Dias A, Embrechts P. Dependence structures for multivariate high-frequency data in finance. Quant. Finance. 2003, 3 1-14

[8]

Chapeau-Blondeau F, Monir A. Numerical evaluation of the Lambert $W$ function and application to generation of generalized Gaussian noise with exponent $1/2$. IEEE Trans. Signal Process.. 2002, 50 2160-2165

[9]

Czado C, Schepsmeier U, Min A. Maximum likelihood estimation of mixed C-vines with application to exchange rates. Stat. Model.. 2012, 12 229-255

[10]

Daul S, De Giorgi E, Lindskog F, McNeil A. Using the grouped t-copula. Risk Mag.. 2003, 16 73-76

[11]

Dißmann J, Brechmann EC, Czado C, Kurowicka D. Selecting and estimating regular vine copulae and application to financial returns. Comput. Stat. Data Anal.. 2013, 59 52-69

[12]

Dobrić J, Schmid F. A goodness of fit test for copulas based on Rosenblatt’s transformation. Comput. Stat. Data Anal.. 2007, 51 4633-4642

[13]

Donnelly T. Algorithm 462: bivariate normal distribution. Commun. ACM. 1973, 16 638

[14]

Fang H, Fang K, Kotz S. The meta-elliptical distributions with given marginals. J. Multivar. Anal.. 2002, 82 1-16

[15]

Genz A. Numerical computation of rectangular bivariate and trivariate normal and t probabilities. Stat. Comput.. 2004, 14 151-160

[16]

Haff IH, Aas K, Frigessi A. On the simplified pair-copula construction—simply useful or too simplistic?. J. Multivar. Anal.. 2010, 101 1296-1310

[17]

Hagberg, A.A., Schult, D.A., Swart, P.J.: Exploring network structure, dynamics, and function using NetworkX. In: Proceedings of the 7th Python in Science Conference (SciPy2008), pp. 11–15. Pasadena, CA USA (2008)

[18]

Hofert, M., Kojadinovic, I., Maechler, M., Yan, J.: Copula: multivariate dependence with copulas. http://CRAN.R-project.org/package=copula (2012)

[19]

Hofert M, Maechler M. Nested Archimedean copulas meet R: the nacopula package. J. Stat. Softw.. 2011, 39 9 1-20

[20]

Hunter John D. Matplotlib: a 2D graphics environment. Comput. Sci. Eng.. 2007, 9 3 90-95

[21]

Joe H. Parametric families of multivariate distributions with given margins. J. Multivar. Anal.. 1993, 46 262-282

[22]

Joe, H.: Families of $m$-variate distributions with given margins and $m(m-1)/2$ bivariate dependence parameters. In: Distributions with Fixed Marginals and Related Topics, L. Rüschendorf, B. Schweizer and M.D. Taylor (eds.), vol. 28, pp. 120–141. Lecture Notes—Monograph Series, Institute of Mathematical Statistics, Hayward, CA (1996)

[23]

Joe H. Multivariate Models and Dependence Concepts. 1997 London: Chapmann & Hall

[24]

Jones, E., Oliphant, T., Peterson, P., et al.: SciPy: open source scientific tools for Python. http://www.scipy.org/ (2001)

[25]

Knight WR. A computer method for calculating Kendall’s tau with ungrouped data. J. Am. Stat. Assoc.. 1966, 61 314 436-439

[26]

Kojadinovic I, Yan J. Modeling multivariate distributions with continuous margins using the copula R package. J. Stat. Softw.. 2010, 34 9 1-20

[27]

Kurowicka, D., Cooke, R.M.: Distribution—free continuous bayesian belief nets. In: Fourth International Conference on Mathematical Methods in Reliability Methodology and Practice. Santa Fe, New Mexico (2004)

[28]

Lambda Foundry: pandas: Python data analysis library. http://pandas.pydata.org/ (2012)

[29]

Marsaglia G, Marsaglia J. Evaluating the Anderson–Darling distribution. J. Stat. Softw.. 2004, 9 1-5

[30]

Nápoles OM. Kurowicka D, Joe H. Chapter 9: Counting vines. Dependence Modeling. 2011 Singapore: World Scientific. 189-218

[31]

Peterson P. F2PY: a tool for connecting Fortran and Python programs. Int. J. Comput. Sci. Eng.. 2009, 4 4 296-305

[32]

Piessens R, Doncker-Kapenga ED, Überhuber CW. QUADPACK: A Subroutine Package for Automatic Integration. 1983 Berlin: Springer

[33]

Prim RC. Shortest connection networks and some generalizations. Bell Lab Tech. J.. 1957, 36 1389-1401

[34]

R Core Team: R: a Language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. http://www.R-project.org/ (2012)

[35]

Rosenblatt M. Remarks on a multivariate transformation. Ann. Math. Stat.. 1952, 23 470-472

[36]

Savu, C., Trede, M.: Hierarchical Archimedean copulas. In: International Conference on High Frequency Finance. Konstanz, Germany (2006)

[37]

Schepsmeier, U., Stoeber, J., Brechmann, E.C., Graeler, B., Nagler, T., Erhardt, T.: VineCopula: statistical inference of vine copulas. https://cran.r-project.org/web/packages/VineCopula/index.html (2018)

[38]

Whelan N. Sampling from Archimedean copulas. Quant. Finance. 2004, 4 339-352

[39]

Yan J. Enjoy the joy of copulas: with a package copula. J. Stat. Softw.. 2007, 21 4 1-21

[40]

Zhu C, Byrd RH, Lu P, Nocedal J. Algorithm 778: L-BFGS-B: Fortran subroutines for large-scale bound-constrained optimization. ACM Trans. Math. Softw.. 1997, 23 4 550-560

Funding

National Natural Science Foundation of China(11371340)

AI Summary AI Mindmap
PDF

314

Accesses

0

Citation

Detail

Sections
Recommended

AI思维导图

/