Learn R Programming

copula (version 0.99-4)

timing: Timing for Sampling Nested Archimedean Copulas

Description

This function provides measurements of user run times for the frailty variables involved in a nested Archimedean copula.

Usage

timing(n, family, taus, digits = 3, verbose = FALSE)

Arguments

n
integer specifying the sample size to be used for the random variates $V_0$ and $V_{01}$.
family
the Archimedean family (class "acopula") for which $V_0$ and $V_{01}$ are sampled.
taus
numeric vector of Kendall's taus. This vector is converted to a vector of copula parameters $theta$, which then serve as $theta_0$ and $theta_1$ for a three-dimensional fully nested Archimedean
digits
number of digits for the output.
verbose
logical indicating if timing output should generated while the random variates are generated (defaults to FALSE).

Value

  • A $k \times k$ matrix of user run time measurements in milliseconds (1000*system.time(.)[1]) where $k$ is length(taus). The first column contains the run times for generating the $V_0$s. For the submatrix that remains if the first column is removed, row $i$ (for ${theta_0}_i$) contains the run times for the $V_{01}$s for a particular $theta_0$ and all the admissible $theta_1$s.

See Also

The class acopula and our predefined "acopula" family objects in acopula-families. For some timings on a standard notebook, see demo(timings) (or the file timings.R in the demo folder).

Examples

Run this code
## takes about 12 seconds (so we rather test unrealistically 10x smaller):
timing(10000, "Gumbel", taus = c(0.05,(1:9)/10,0.95))
timing( 100, "Gumbel", taus = c(0.05,(1:9)/10,0.95))

Run the code above in your browser using DataLab