EXPERIMENTAL---Perform a simulation on a bivariate empirical copula to produce the random variates \(U\) and \(V\) and return an R data.frame
of them. The method is more broadly known as conditional simulation method. This function is an empirical parallel to simCOP
that is used for parametric copulas. If circumstances require conditional simulation of \(V{\mid}U\), then function EMPIRsimv
, which produces a vector of \(V\) from a fixed \(u\), should be used.
For the usual situation in which an individual \(u\) during the simulation loops is not a value aligned on the grid, then the bounding conditional quantile functions are solved for each of the \(n\) simulations and the following interpolation is made by $$v = \frac{v_1/w_1 + v_2/w_2}{1/w_1 + 1/w_2}\mbox{,}$$ which states that that the weighted mean is computed. The values \(v_1\) and \(v_2\) are ordinates of the conditional quantile function for the respective grid lines to the left and right of the \(u\) value. The values \(w_1\) \(=\) \(u - u^\mathrm{left}_\mathrm{grid}\) and \(w_2\) \(=\) \(u^\mathrm{right}_\mathrm{grid} - u\).
EMPIRsim(n=100, empgrid=NULL, kumaraswamy=FALSE, na.rm=TRUE, keept=FALSE,
graphics=TRUE, ploton=TRUE, points=TRUE, snv=FALSE,
infsnv.rm=TRUE, trapinfsnv=.Machine$double.eps, ...)
An R
data.frame
of the simulated values is returned.
A sample size, default is 100;
Gridded empirical copula from EMPIRgrid
;
A logical to trigger Kumaraswamy distribution smoothing of the conditional quantile function that is passed to EMPIRgridderinv
. The Kumaraswamy distribution is a distribution having support \([0,1]\) with an explicit quantile function and takes the place of a Beta distribution (see lmomco function quakur()
for more details);
A logical to toggle the removal of NA
entries on the returned data.frame
;
Keep the \(t\) uniform random variable for the simulation as the last column in the returned data.frame
;
A logical that will disable graphics by setting ploton
and points
to FALSE
and overriding whatever their settings were;
A logical to toggle on the plot;
A logical to actually draw the simulations by the points()
function in R;
A logical to convert the \(\{u,v\}\) to standard normal scores (variates) both for the optional graphics and the returned data.frame
. Joe (2014) advocates extensively for use of normal scores, which is in contrast to Nelsen (2006) who does not;
A logical that will quietly strip out any occurrences of \(u = \{0,1\}\) or \(v = \{0,1\}\) from the simulations because these are infinity in magnitude when converted to standard normal variates is to occur. Thus, this logical only impacts logic flow when snv
is TRUE
. The infsnv.rm
is mutually exclusive from trapinfsnv
;
If TRUE
and presumably small, the numerical value of this argument (\(\eta\)) is used to replace \(u = \{0,1\}\) and \(v = \{0,1\}\) with \(u(0) = v(0) = \eta\) or \(u(1) = v(1) = 1 - \eta\) as appropriate when conversion to standard normal variates is to occur. The setting of trapinfsnv
only is used if snv
is TRUE
and infsnv.rm
is FALSE
; and
Additional arguments to pass to the points()
function in R.
W.H. Asquith
EMPIRgrid
, EMPIRgridderinv
, EMPIRsimv