This function evaluates the probability density function (PDF) of a given parametric bivariate copula.
BiCopPDF(u1, u2, family, par, par2 = 0, obj = NULL, check.pars = TRUE)
numeric vectors of equal length with values in \([0,1]\).
integer; single number or vector of size length(u1)
;
defines the bivariate copula family: 0
= independence copula 1
= Gaussian copula 2
= Student t copula (t-copula) 3
= Clayton copula 4
= Gumbel copula 5
= Frank copula 6
= Joe copula 7
= BB1 copula 8
= BB6 copula 9
= BB7 copula 10
= BB8 copula 13
= rotated Clayton copula (180 degrees; survival Clayton'') \cr `14` = rotated Gumbel copula (180 degrees;
survival Gumbel'') 16
= rotated Joe copula (180 degrees; survival Joe'') \cr `17` = rotated BB1 copula (180 degrees;
survival BB1'')18
= rotated BB6 copula (180 degrees; survival BB6'')\cr `19` = rotated BB7 copula (180 degrees;
survival BB7'')20
= 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)
`30` = 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)
`40` = rotated BB8 copula (270 degrees)
`104` = Tawn type 1 copula
`114` = rotated Tawn type 1 copula (180 degrees)
`124` = rotated Tawn type 1 copula (90 degrees)
`134` = rotated Tawn type 1 copula (270 degrees)
`204` = Tawn type 2 copula
`214` = rotated Tawn type 2 copula (180 degrees)
`224` = rotated Tawn type 2 copula (90 degrees)
`234` = rotated Tawn type 2 copula (270 degrees)
numeric; single number or vector of size length(u1)
;
copula parameter.
numeric; single number or vector of size length(u1)
;
second parameter for bivariate copulas with two parameters (t, BB1, BB6,
BB7, BB8, Tawn type 1 and type 2; default: par2 = 0
). par2
should be an positive integer for the Students's t copula family = 2
.
BiCop
object containing the family and parameter
specification.
logical; default is TRUE
; if FALSE
, checks
for family/parameter-consistency are omitted (should only be used with
care).
A numeric vector of the bivariate copula density
of the copula family
with parameter(s) par
, par2
evaluated at u1
and u2
.
If the family and parameter specification is stored in a BiCop()
object obj
, the alternative version
BiCopPDF(u1, u2, obj)
can be used.
set.seed(123)
## simulate from a bivariate Student-t copula
cop <- BiCop(family = 2, par = -0.7, par2 = 4)
simdata <- BiCopSim(100, cop)
## evaluate the density of the bivariate t-copula
u1 <- simdata[,1]
u2 <- simdata[,2]
BiCopPDF(u1, u2, cop)
#> [1] 1.7476289 1.1253686 4.3948771 0.8726650 1.5970650 4.0665279 1.5506525
#> [8] 3.2518440 0.3420938 0.9234262 1.3371767 0.1861758 1.2740615 1.5294965
#> [15] 0.7933051 0.3425504 1.0041005 4.5411878 1.9548186 1.0939714 1.7351468
#> [22] 1.4652813 0.6291736 1.7040858 1.6721897 2.8457657 1.9823741 1.3391780
#> [29] 2.9373786 2.9111003 1.2189760 1.2631258 2.0330900 0.8448330 1.9772725
#> [36] 1.4537177 0.2037127 1.2349811 1.6541503 0.7310370 1.9794678 1.3927695
#> [43] 2.0050030 0.3565457 3.2173480 2.6788939 1.7049721 0.9617950 1.7285330
#> [50] 1.5889394 1.6010289 0.6209664 0.9527241 1.8776343 0.9331976 4.3537199
#> [57] 4.4719155 1.6133001 0.5482457 1.6166834 1.6775950 1.0495470 0.5241108
#> [64] 0.4516549 2.6485938 0.7553097 1.1889348 1.4670809 0.9331701 6.9320818
#> [71] 1.5214964 1.0149675 2.5753882 0.4790395 1.9758710 2.0281979 1.1984456
#> [78] 1.7362999 1.3836301 1.1894062 1.5046916 1.6979178 1.6588089 1.8752542
#> [85] 1.2693172 1.4344133 1.0769339 1.4666279 1.6416774 1.8108982 2.4709521
#> [92] 1.7982885 1.6135021 1.8222352 0.4068980 1.3195279 4.0104640 3.1903099
#> [99] 1.5967170 2.2580077
## select a bivariate copula for the simulated data
fit <- BiCopSelect(u1, u2)
summary(fit)
#> Family
#> ------
#> No: 5
#> Name: Frank
#>
#> Parameter(s)
#> ------------
#> par: -6.64
#>
#> Dependence measures
#> -------------------
#> Kendall's tau: -0.55 (empirical = -0.52, p value < 0.01)
#> Upper TD: 0
#> Lower TD: 0
#>
#> Fit statistics
#> --------------
#> logLik: 35.54
#> AIC: -69.08
#> BIC: -66.47
#>
## and evaluate its PDF
round(BiCopPDF(u1, u2, fit), 3)
#> [1] 1.832 1.090 4.311 0.719 1.792 3.616 1.658 3.277 0.163 1.108 1.486 0.125
#> [13] 1.236 1.679 0.588 0.477 0.849 4.070 2.039 0.971 1.839 1.559 0.493 1.800
#> [25] 1.788 3.064 2.168 1.330 2.795 2.779 1.294 1.220 2.113 0.712 2.070 1.487
#> [37] 0.991 1.177 1.822 0.518 2.080 1.405 2.157 0.946 3.040 2.608 1.847 0.791
#> [49] 1.986 1.788 1.734 0.536 0.837 2.115 0.759 3.578 4.262 1.718 0.410 1.793
#> [61] 1.807 0.911 0.738 0.285 2.585 0.551 1.108 1.562 0.841 4.668 1.608 2.687
#> [73] 2.549 0.272 2.062 2.108 1.120 1.898 1.393 1.108 1.625 1.856 1.833 1.963
#> [85] 1.230 1.463 1.101 1.535 1.821 1.937 2.457 1.898 1.802 1.955 0.337 1.302
#> [97] 4.257 3.082 1.734 2.298