50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

copBasic (version 2.1.5)

simCOPmicro: Simulate V from U through a Copula by Numerical Derivative Method

Description

Perform bivariate simulation of random but coupled variables V from U through a copula (Nelsen, 2006, p. 32) by inversion of the numerical derivatives of the copula (derCOPinv, derCOPinv2). The method is more broadly known as conditional simulation method. An elaborate implementation is available in simCOP, which unlike simCOPmicro, has provisions (default) for graphical support. The simCOPmicro function is intended to be a minimalist version for copula simulation, and such a version is useful for pedagogic purposes including conditional distributions, conditional quantile functions, and copula reflection (see Note and COP). An extended educational discussion of simulation using the conditional method is available in the Note section of derCOPinv.

Some definitions are needed. The copula of (1U,1V) is the survival copula (surCOP) and is defined as C^(u,v)=u+v1+C(1u,1v), whereas, following the notation of Joe (2014, pp. 271--272), the copula of (1U,V) is defined as C´(u,v)=vC(1u,v), and the copula of (U,1V) is defined as C`(u,v)=uC(u,1v).

Careful consideration of the nomenclature is necessary as confusion with the occurrences of 1u and 1v easily conflate meaning. The nomenclature for the survival copula is more elaborately shown under surCOP. The difficulty is that the bivariate arguments to the survival copula are exceedance probabilities.

For simulation, again following the nomenclature of Joe (2014, p. 272), the conditional distribution functions (numerical derivatives; derCOP C2|1(v|u) and derCOP2 C1|2(u|v)) can be written in terms of C(u|v)=C2|1(v|u) as Missing argument for \mathbf Missing argument for \mathbf Missing argument for \mathbf where the respective "surv", "acute", and "grave" are inverses (conditional quantile functions; inverses of numerical derivatives; derCOPinv C2|1(1)(v|u) and derCOPinv2 C1|2(1)(u|v)) are Missing argument for \mathbf Missing argument for \mathbf Missing argument for \mathbf where t is a uniformly distributed variable.

To clarify the seemingly clunky nomenclature---Joe (2014) does not provide “names” for Missing argument for \mathbf or Missing argument for \mathbf---the following guidance is informative: (1) "surv" or Missing argument for \mathbf is a reflection of U and V on the horizontal and vertical axes, respectively (2) "acute" or Missing argument for \mathbf is a reflection of U on the horizontal axis, and (3) "grave" or Missing argument for \mathbf is a reflection of V on the verical axis. The names "acute" and "grave" match those used in the Rd-format math typesetting instructions.

Usage

simCOPmicro(u, cop=NULL, para=NULL,
               reflect=c("cop", "surv", "acute", "grave",
                           "1",    "2",     "3",     "4"), ...)
simCOPv(u, cop=NULL, para=NULL,
               reflect=c("cop", "surv", "acute", "grave",
                           "1",    "2",     "3",     "4"), ...)

Arguments

u

Nonexceedance probability u in the X direction. The runif() function in R can be used to drive conditional simulation using the simCOPmicro function (see Examples);

cop

A copula function;

para

Vector of parameters, if needed, to pass to the copula;

reflect

The reflection of the copula (see above) and the default "cop" or "1" is the usual copula definition. The numbered values correspond, respectively, to the named values; and

...

Additional arguments to pass should they be needed.

Value

Simulated value(s) of nonexceedance probability v are returned based on the nonexceedance probabilities u in argument u.

References

Joe, H., 2014, Dependence modeling with copulas: Boca Raton, CRC Press, 462 p.

Nelsen, R.B., 2006, An introduction to copulas: New York, Springer, 269 p.

See Also

simCOP

Examples

Run this code
# NOT RUN {
simCOPmicro(runif(1), cop=W  ) # Frechet lower bound copula
simCOPmicro(runif(1), cop=P  ) # Independence copula
simCOPmicro(runif(1), cop=M  ) # Frechet upper bound copula
simCOPmicro(runif(1), cop=PSP) # The PSP copula

# }
# NOT RUN {
# Now let us get more complicated and mix two Plackett copulas together using the
# composite2COP as a "compositor." The parameter argument becomes more complex, but is
# passed as shown into composite2COP.
para <- list(cop1=PLACKETTcop,cop2=PLACKETTcop, alpha=0.3,beta=0.5, para1=0.1,para2=50)
simCOPmicro(runif(5), cop=composite2COP, para=para) #
# }
# NOT RUN {
# }
# NOT RUN {
# Now let us implement "our" own version of features of simCOP() but using
# the micro version to manually create just the simulation vector of V.
U <- runif(1500)
UV <- data.frame(U, simCOPmicro(U, cop=N4212cop, para=4))
plot(UV, xlab="PROBABILITY IN U", ylab="PROBABILITY IN V", pch=3, col=2) #
# }

Run the code above in your browser using DataLab