
Perform bivariate simulation of random but coupled variables 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 surCOP
) and is defined as
Careful consideration of the nomenclature is necessary as confusion with the occurrences of 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
derCOP2
"surv"
, "acute"
, and "grave"
are inverses (conditional quantile functions; inverses of numerical derivatives; derCOPinv
derCOPinv2
To clarify the seemingly clunky nomenclature---Joe (2014) does not provide “names” for "surv"
or "acute"
or "grave"
or "acute"
and "grave"
match those used in the Rd-format math typesetting instructions.
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"), ...)
Nonexceedance probability runif()
function in R can be used to drive conditional simulation using the simCOPmicro
function (see Examples);
A copula function;
Vector of parameters, if needed, to pass to the copula;
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.
Simulated value(s) of nonexceedance probability u
.
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.
# 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