simnul {subrank}R Documentation

Test statistic distribution under independence hypothesis

Description

Simulates the test statistic, under independence

Usage

simnul(sampsize, dimension, subsampsizes, sampnum,KL=TRUE,nbsafe=5,nthreads=2)

Arguments

sampsize

sample size

dimension

sample dimension

subsampsizes

vector of sub-sample sizes

sampnum

number of samples

KL

if TRUE, returns the Kullback-Leibler divergence with the independent case, if FALSE, the L2 distance. There is no re-normalization, contrary to what happens for simany.

nbsafe

the ratio between the number of sub-samples and the cardinality of the discretized copula.

nthreads

number of number of threads, assumed to be strictly positive. For "full throttle" computations, consider using parallel::detectCores()

Value

lrs

the distances with independent case

scarcities

the proportions of non-reached vector ranks

Author(s)

Jerome Collet

Examples

library(datasets)
# plot(swiss)
c=corc(swiss,1:3,8)
c
RV=sum(c$cop*log(c$cop),na.rm=TRUE)+3*log(8)
sims=simnul(47,3,8,100)
pvalue=mean(RV<sims$lrs)
pvalue
RV
summary(sims$lrs)

[Package subrank version 0.9.9.3 Index]