derCOP2 {copBasic} | R Documentation |
Numerical Derivative of a Copula for U with respect to V
Description
Compute the numerical partial derivative of a copula, which is a conditional distribution function, according to Nelsen (2006, pp. 13, 40–41) with respect to :
or
which is to read as the probability that given that
and corresponds to the
derdir="left"
mode of the function. For derdir="right"
, the following results
and for derdir="center"
(the usual method of computing a derivative), the following results
The “with respect to ” versions are under
derCOP
.
Copula derivatives ( or say
derCOP
) are non-decreasing functions meaning that if , then
is a non-decreasing function in
, thus
is non-negative, which means
Usage
derCOP2(cop=NULL, u, v, delv=.Machine$double.eps^0.50,
derdir=c("left", "right", "center"), ...)
Arguments
cop |
A copula function; |
u |
Nonexceedance probability |
v |
Nonexceedance probability |
delv |
The |
derdir |
The direction of the derivative as described above. Default is |
... |
Additional arguments to pass such as the parameters often described in |
Value
Value(s) for the partial derivative are returned.
Note
A known caveat of the current implementation of the copula derivative is that there is a chance that the will span a singularity or discontinuous (or nearly so) portion of a copula should it have a property of singularity (or nearly so). The
delv
is chosen small so the chance is mitigated to be a small change and certainly seems to work throughout the examples herein. It is not decided whether a derivative from the positive side (dir="left"
), when failing should switch over to a computation from the negative side (dir="right"
). The distinction is important for the computation of the inverse of the derivative derCOPinv2
because the solution finder needs a sign reversal to work.
Author(s)
W.H. Asquith
References
Nelsen, R.B., 2006, An introduction to copulas: New York, Springer, 269 p.
See Also
Examples
derCOP2(cop=W, 0.4, 0.6); derCOP2(cop=P, 0.4, 0.6); derCOP2(cop=M, 0.4, 0.6)
lft <- derCOP2(cop=P, 0.4, 0.6, derdir="left" )
rgt <- derCOP2(cop=P, 0.4, 0.6, derdir="right" )
cnt <- derCOP2(cop=P, 0.4, 0.6, derdir="center")
cat(c(lft, rgt, cnt,"\n"))
# stopifnot(all.equal(lft, rgt), all.equal(lft, cnt))
# Let us contrive a singularity though this NOT A COPULA in the function "afunc".
"afunc" <- function(u,v, ...) return(ifelse(u <= 0.5, sqrt(u^2+v^2), P(u,v,...)))
lft <- derCOP2(cop=afunc, 0.67, 0.5, derdir="left" )
rgt <- derCOP2(cop=afunc, 0.67, 0.5, derdir="right" )
cnt <- derCOP2(cop=afunc, 0.67, 0.5, derdir="center")
cat(c(lft,rgt,cnt,"\n")) # For this example, all are correct (see derCOP examples)