Skip to contents

n draws on scrambled Sobol points (sobol_points()), quasi-Monte Carlo: each point w becomes pnorm(L qnorm(w)). Over a power of two of points each margin is spread far more evenly than random draws, so a statistic converges faster; the rows are not independent, so a standard error needs several seeds. At most 1,111 dimensions.

Usage

copula_sample_qmc(copula, n, seed = 0)

Arguments

copula

A gaussian_copula().

n

Number of draws; a power of two keeps them balanced.

seed

Seed of the scramble.

Value

An n by copula@dimension matrix of uniforms in (0, 1).

Examples

u <- copula_sample_qmc(gaussian_copula(matrix(c(1, 0.6, 0.6, 1), 2)), 1024, seed = 7)
all(sort(floor(u[, 1] * 1024)) == 0:1023)
#> [1] TRUE