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

  • PDF / 14,014,922 Bytes
  • 34 Pages / 439.37 x 666.142 pts Page_size
  • 92 Downloads / 218 Views

DOWNLOAD

REPORT


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

· Taizhong Hu1

Received: 8 November 2018 / Revised: 21 January 2019 / Accepted: 9 July 2019 © School of Mathematical Sciences, University of Science and Technology of China and Springer-Verlag GmbH Germany, part of Springer Nature 2019

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 E and then tests the hypothesis H0∗ : E ∼ C⊥ by using Anderson–Darling statistic, where C⊥ 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, Hfunctions 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

B

Zhenfei Yuan [email protected] Taizhong Hu [email protected]

1

Department of Statistics and Finance, School of Management, University of Science and Technology of China, Hefei 230026, Anhui, China

123

Z. Yuan, T. Hu

Mathematics Subject Classification 62E17 · 62H20

1 Introduction Copulas have numerous applications in many fields such as quantitative finance, risk management, reliability analysis, biostatistics, social statistics and engineering. The known families of bivariate copulas in the literature have provided models with a broad range of dependence patterns and have been stu