Learn R Programming

copBasic (version 2.2.15)

wolfCOPsamc: Monte Carlo Integration of Schweizer--Wolff Sigma

Description

Perform Monte Carlo integration for the measure of dependence known as Schweizer--Wolff Sigma \(\sigma_\mathbf{C} \in (0,1)\) of an empirical copula (\(\mathbf{C}_n(u,v)\)). This function can be useful as the as.sample computation provided by wolfCOP scales very poorly as sample size increases. Please refer to wolfCOP for more details, including theory, about \(\sigma_\mathbf{C}\). Sample estimation can be made by

$$\hat\sigma_\mathbf{C} = 12\int\!\!\int_{\mathcal{I}^2} \bigl|\mathbf{C}_n(u,v) - uv\bigr|\,\mathrm{d}u\mathrm{d}v\mbox{,}$$

for which the integrals in the above formula are replaced with Monte Carlo integration provided by this function. Allowance is made internally to swap out \(\mathbf{C}_n(u,v)\) for a copula family \(\mathbf{C}(u,v)\), which means this function can be used for integration for families that might have numerical integration convergence problems in wolfCOP.

Usage

wolfCOPsamc(u=NULL, v=NULL, cop=EMPIRcop, para=NULL, para_has_paras=FALSE,
            tol=0.005, minit=10, maxit=100, subdivisions=200, large_n=5E3,
            includelmoms=FALSE, trace=FALSE, verbose=FALSE, ...)

Value

A list of the Monte Carlo integration results is returned containing

wolves

A vector of the \(\sigma_\mathbf{C}\) by iteration;

estimates

The minimum, mean (the formal estimate \(\hat\sigma_\mathbf{C}\)), maximum along with optional variance (computed from second L-moment), L-scale (second L-moment), L-skew, and L-kurtosis of the wolves;

estimates

Using logit-transformation of the wolves, the minimum, mean, maximum along with optional variance (computed from second L-moment), L-scale (second L-moment), L-skew, and L-kurtosis of the wolves;

its

Number of iterations before termination by maxits or upon reaching tol;

lastpctchg

The percent change on the last iteration.

Arguments

u

Optional nonexceedance probability \(u\) in the \(X\) direction. This argument can also by a two-column data frame from which the para argument to EMPIRcop when cop=EMPIRcop) is internally constructed;

v

Optional nonexceedance probability \(v\) in the \(Y\) direction from which the para argument to EMPIRcop when cop=EMPIRcop is internally constructed;

cop

The empirical copula, EMPIRcop, or a copula family;

para

Optional parameter content for the para argument to the specified copula in cop. For an empirical copula application (default), the para must be a two-column data frame, but if cop is set to a copula family, then this function can be used as an alternative \(\sigma_\mathbf{C}\) computation using Monte Carlo integration in lieu of numerical integration exclusive to wolfCOP (refer to Examples how to use the function in this way);

para_has_paras

A logical to inform processing whether the para argument contains parameters for a copula family in lieu of para containing the sample for the empirical copula (cop=EMPIRcop). Internally, para_has_paras is used to disable random subsetting by setting the sample size variable to large_n. Technically, it is possible internally to detection whether para_has_paras needed to be true (even if false) as the number of random variates for the halton() function of the randtoolbox package is computed, and the code will silently proceed as if para_has_paras=TRUE;

tol

A tolerance in absolute percent change in the global mean as the iterations progress. This tolerance should be good enough for many practical large sample applications, but can be reduced considerable if the function is used as the backdoor to integration of a given copula family instead of a sample estimator;

minit

Minimum number of iterations regardless of tol setting;

maxit

Maximum number of iterations;

subdivisions

Number of subdivisions and somewhat an analog to the term used in numerical integration. This subdivisions will be the size of the Monte Carlo sample for each iteration;

large_n

For an empirical copula and as the sample size gets large, not only does the \(\sigma_\mathbf{C}\) computation slow down because a double summation is involved, but the counting that empirical copula must also perform gets large, therefore, the para that will be ultimately passed to the empirical copula is randomly subsetted by large_n. This is done in order to speed up iteration times at expense of increasing time that tol presumably is reached;

includelmoms

A logical to include upto the first five linear moments for \(\sigma_\mathbf{C}\) and logit-transformed \(\mathrm{log}[\sigma_\mathbf{C}/(1-\sigma_\mathbf{C})]\) in the returned list.

trace

A logical, if true, that will produce a scatter plot of the sample (or the current iteration subset [refer to large_n]) along with the random sample points used for the current Monte Carlo iteration;

verbose

A logical providing percent change results by iteration to the console; and

...

Additional arguments to pass to the halton() function of the randtoolbox and the copula specified by cop (EMPIRcop) or a copula family.

Author

W.H. Asquith

References

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

Schweizer, B., and Wolff, E.F., 1981, On nonparametric measures of dependence for random variables: The Annuals of Statistics, v. 9, no. 4, pp. 879--855, https://www.jstor.org/stable/2240856.

See Also

wolfCOP, EMPIRcop