Learn R Programming

copBasic (version 1.7.1)

lcomCOPpv: Simulating the Sample Distribution(s) of L-correlation, L-coskew, and L-cokurtosis for a Copula

Description

EXPERIMENTAL: The function provides two themes of sampling distribution characterization of the first three L-comoment ratios (L-correlation $\tau_{2[\ldots]}$, L-coskew $\tau_{3[\ldots]}$ and L-cokurtosis $\tau_{4[\ldots]}$) of a copula by simulation. First, optional simulations involving the sample size $n$ presumably of an actual sample from which various estimates of these L-comoments are given as arguments. These simulations result in a report of the L-moments of the sampling distribution and are these then used to compute p-values for the L-comoment matrices provided by the user as a function argument. Second, optional simulations involving (or intended to involve) a very large sample size may be made with the objective of computing the central tendency for samples $N >> n$.

Usage

lcomCOPpv(n, lcom, cop=NULL, para=NULL, repcoe=5E3, type="gno",
                   larsimn=1E4, larsimrep=15, uselarmu=FALSE, digits=5, ...)

Arguments

n
The sample size $n$ for which $n = 0$ can be given to skip corresponding simulations;
lcom
The sample L-comoments (see below);
cop
A copula function;
para
Vector of parameters, if needed, to pass to the copula;
repcoe
The replication coefficient $\phi$;
type
The distribution type used for modeling the distribution of the sampling values. The Generalized Normgal accommodates some skewness compared to the Normal. The distribution abbreviations of package lmomco are recognized;
larsimn
The sample size $N$ for the large sample simulation for which $N = 0$ can be given to skip corresponding simulations. If $N = 0$ then large sample simulation is not used, otherwise the minimum sample size is $N=4$ so that first four L-moment are computabl
larsimrep
The number of replications of the large sample simulation;
uselarmu
A logical toggling whether the mean value computed from the large sample simulation is used instead of the mean values for the small sample simluation for the p-value computations;
digits
The number of digits to round numerical entries in the returned tables and can be NA for no rounding; and
...
Additional arguments to pass to simCOP such as snv, infsnv.rm, and trapinfsnv should the input L-comoments be based on normal scores and thus normal scores would be req

Value

  • An Rlist is returned.
  • textA string functioning as a label for the remaining tables;
  • NtableAnother Rlist holding tables of the L-moments of the L-comoments derived from the large sample simulations for samples of size $N =$larsimn. The simulations are replicated larsimrep times; and
  • ntableAnother Rlist holding tables of the L-moments of the L-comoments derived from the small sample simulations for samples of size $n =$n as well as the p-values estimated by a Generalized Normal distribution model of the L-moments using either the small sample means or large sample mean as dictated by uselarmu. However, in all circumstances the results for the small sample simluations are tabulated in ntable only the p-value reflects the setting of uselarmu.

Details

The notation $r[\ldots]$ refers to two specific types of L-comoment definitions and a blend between the two. The notation $r[12]$ means that the $r$th L-comoment for random variables ${X^{(1)}, X^{(2)}}$ where $X^{(2)}$ is the sorted variable and $X^{(1)}$ is shuffled by the sorting index. Conversely, the notation $r[21]$ means that the $r$th L-comoment for random variables ${X^{(1)}, X^{(2)}}$ where $X^{(1)}$ is the sorted variable and $X^{(2)}$ is shuffled by the sorting index. The notation $r[12|21]$ means that the average between the $r[21]$ and $r[21]$ is computed, which might prove useful in circumstances of known or expected symmetry of the L-comoments. Continuing, $\tau_{2[12]}$ is the L-correlation, $\tau_{3[12]}$ is the L-coskew, and $\tau_{4[12]}$ is the L-cokurtosis all with respect to the sorting of the second variable. The computation of these L-comoment matricies can be made by functions such as lcomoms2() in the lmomco package. The number of replications for the simulations involving the $n$ sample size is computed by $$m = \phi/\sqrt{n}\mbox{,}$$ where $\phi$ is the repcoe replication factor or coefficient. If uselarmu is TRUE then larsimn$> 0$ else uselarmu is reset to FALSE.

References

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

See Also

COP, kullCOP, vuongCOP

Examples

Run this code
# See Note section of vuongCOP() for an extended discussion of copula inference
Tau <- 0.6410811; para <- GHcop(tau=Tau)$para # This Tau is from a situation of
# two river tributaries. These three L-comoments with univariate L-moments on the
T2 <- c(1,  0.79908960, 0.79908960, 1) # diagonals are derived from those river
# tributaries, which come together.
T3 <- c(0, -0.04999318, 0.07689082, 0)
T4 <- c(0,  0.01773833, 0.04756257, 0) # Is the Ho:GHcop rejectable?
LCOM <- list(T2=matrix(T2, nrow=2), T3=matrix(T3, nrow=2), T4=matrix(T4, nrow=2))
set.seed(30312)
ZZ1 <- lcomCOPpv(75, LCOM, cop=GHcop, para=para, repcoe=2000, larsimn=0)
print(ZZ1)
set.seed(30312)
ZZ2 <- lcomCOPpv(75, LCOM, cop=GHcop, para=para, repcoe=100, larsimn=2E4, larsimrep=10)
print(ZZ2)
# The results here suggest that the GHcop is not rejectable.

Run the code above in your browser using DataLab