R/BiCopHfuncDeriv2.R
BiCopHfuncDeriv2.Rd
This function evaluates the second derivative of a given conditional parametric bivariate copula (h-function) with respect to its parameter(s) and/or its arguments.
BiCopHfuncDeriv2(
u1,
u2,
family,
par,
par2 = 0,
deriv = "par",
obj = NULL,
check.pars = TRUE
)
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 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'') 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)
numeric; single number or vector of size length(u1)
;
copula parameter.
integer; single number or vector of size length(u1)
;
second parameter for the t-Copula; default is par2 = 0
, should be an
positive integer for the Students's t copula family = 2
.
Derivative argument "par"
= second derivative with respect to
the first parameter (default)"par2"
= second derivative with respect to
the second parameter (only available for the t-copula) "u2"
= second derivative with respect to
the second argument u2
"par1par2"
= second derivative with respect to
the first and second parameter (only available for the t-copula) "par1u2"
= second derivative with respect to
the first parameter and the second argument "par2u2"
= second derivative with respect to the second parameter
and the second argument (only available for the t-copula)
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 second-order conditional bivariate copula derivative
of the copula family
with parameter(s) par
, par2
with respect to deriv
evaluated at u1
and u2
.
If the family and parameter specification is stored in a BiCop()
object obj
, the alternative version
BiCopHfuncDeriv2(u1, u2, obj, deriv = "par")
can be used.
Schepsmeier, U. and J. Stoeber (2014). Derivatives and Fisher
information of bivariate copulas. Statistical Papers, 55 (2), 525-542.
https://link.springer.com/article/10.1007/s00362-013-0498-x.
## simulate from a bivariate Student-t copula
set.seed(123)
cop <- BiCop(family = 2, par = -0.7, par2 = 4)
simdata <- BiCopSim(100, cop)
## second derivative of the conditional bivariate t-copula
## with respect to the first parameter
u1 <- simdata[,1]
u2 <- simdata[,2]
BiCopHfuncDeriv2(u1, u2, cop, deriv = "par")
#> [1] 1.684670085 1.445009072 -2.394632254 0.982319498 -0.191463014
#> [6] 0.660424888 0.971719208 2.440708983 0.214286898 0.735750053
#> [11] 0.865859546 -0.826942333 1.371145360 0.840860772 -0.776475632
#> [16] 0.008169539 1.150068878 -0.680998756 -1.634456821 -1.263989302
#> [21] -1.053239868 -1.135876455 -0.347449083 -0.904761438 1.937043020
#> [26] -0.780754028 -2.103406988 -1.626156073 1.152225034 0.164024046
#> [31] -1.515278923 -1.415894639 0.498752417 0.717053922 0.390384267
#> [36] 1.210797867 1.396122934 -1.520793273 0.552033413 -0.665179440
#> [41] 0.637576307 1.639953393 -0.963797893 0.006389292 -1.892352512
#> [46] 0.145683737 0.814594480 -1.104411804 -1.968056324 -0.010296275
#> [51] -1.028464408 0.195577283 1.145021627 0.910886652 -1.122746697
#> [56] -0.345564403 2.498135976 -1.907495873 0.061917278 -0.511336603
#> [61] -1.022735637 -1.203236461 -0.410064338 -0.088728755 0.533887346
#> [66] 0.721896034 1.340647857 1.194188493 0.800877461 0.581664953
#> [71] -1.071688265 -0.068227240 -1.389045448 -0.099737516 1.224448034
#> [76] 0.820782305 -1.417771175 -0.992658620 -1.622962530 -1.474726157
#> [81] -1.078873722 -0.570379523 -0.173455058 -1.614146320 -1.445734562
#> [86] -1.728832154 0.806776801 1.166384415 -0.153542873 1.020935552
#> [91] -0.569062496 -1.330198030 0.140860267 -0.194946931 0.045410090
#> [96] -1.286555025 0.474808114 0.718238125 0.985394505 -0.428647857
## estimate a Student-t copula for the simulated data
cop <- BiCopEst(u1, u2, family = 2)
## and evaluate the derivative of the conditional copula
## w.r.t. the second argument u2
BiCopHfuncDeriv2(u1, u2, cop, deriv = "u2")
#> [1] 3.6804067 -0.7689591 -546.2427458 -1.7753555 -0.5376870
#> [6] -40.2486651 -2.6000245 83.9006421 0.7824081 0.8735943
#> [11] -3.9165914 -0.4304624 -2.2060138 -0.9712828 1.7545863
#> [16] -0.2570602 -2.0714937 47.8458348 -6.5611891 2.1651901
#> [21] 5.8160920 1.5737490 1.2067824 4.2801871 5.0373857
#> [26] 18.1839777 -13.7328026 0.5702948 24.6636973 -19.7344966
#> [31] -0.9175689 1.9495009 -7.0195978 -1.8495088 -6.1955126
#> [36] -3.3205444 -235.4306035 1.4216690 1.3931585 1.7178143
#> [41] 5.5380198 -0.2032016 8.3320801 -0.2110902 -42.7264285
#> [46] 16.0566221 2.0317966 1.9937195 -11.6912382 0.4111560
#> [51] -0.7876488 -1.8724216 -1.5927369 -7.5474007 1.8406191
#> [56] -57.8832126 465.5573090 -4.0717211 -1.7857176 -0.8468740
#> [61] -1.7472930 2.1395192 0.1429259 0.7623111 16.1019173
#> [66] -1.7703424 -2.2350047 -0.9425511 -2.1128965 -122.0992576
#> [71] 2.7097746 1.9718369 -17.4871714 1.0457833 5.8769918
#> [76] -7.6414720 1.9291341 6.2310307 0.3409169 1.6421899
#> [81] 0.5994465 -1.9659926 2.0526910 -5.2473112 1.7672025
#> [86] -0.5800653 -2.6701584 -2.4332835 1.7713090 -6.5459479
#> [91] -12.9850109 -3.5315516 -1.2703370 4.1082368 -0.4988247
#> [96] 2.7557713 -34.9362417 -23.6304023 0.7004355 9.7279802