bwd2asR0 | R Documentation |
Given a q
-dimensional random vector \mathbf{X} = (\mathbf{X}_{1},...,\mathbf{X}_{k})
with \mathbf{X}_{i}
a d_{i}
-dimensional random vector, i.e., q = d_{1} + ... + d_{k}
,
this function simulates a sample from the asymptotic distribution of the plug-in estimator for the correlation-based Bures-Wasserstein coefficient \mathcal{D}_{2}
between \mathbf{X}_{1},...,\mathbf{X}_{k}
given that the entire correlation matrix \mathbf{R}
is equal to \mathbf{R}_{0}
(correlation matrix under independence of \mathbf{X}_{1},...,\mathbf{X}_{k}
).
The argument dim should be in ascending order.
This function requires importation of the python modules "numpy" and "scipy".
bwd2asR0(R, dim, M)
R |
The correlation matrix of |
dim |
The vector of dimensions |
M |
The sample size. |
A sample of size M is drawn from the asymptotic distribution of the plug-in estimator \mathcal{D}_{2}(\widehat{\mathbf{R}}_{n})
at \mathbf{R}_{0} = \text{diag}(\mathbf{R}_{11}, \dots, \mathbf{R}_{kk})
,
where \widehat{\mathbf{R}}_{n}
is the sample matrix of normal scores rank correlations.
The underlying assumption is that the copula of \mathbf{X}
is Gaussian.
To create a Python virtual environment with "numpy" and "scipy", run:
install_tensorflow()
reticulate::use_virtualenv("r-tensorflow", required = FALSE)
reticulate::py_install("numpy")
reticulate::py_install("scipy")
A sample of size M from the asymptotic distribution of the plug-in estimator for the second Bures-Wasserstein dependence coefficient \mathcal{D}_{2}
under independence of \mathbf{X}_{1},...,\mathbf{X}_{k}
.
De Keyser, S. & Gijbels, I. (2024). High-dimensional copula-based Wasserstein dependence. doi: https://doi.org/10.48550/arXiv.2404.07141.
bwd1
for the computation of the first Bures-Wasserstein dependence coefficient \mathcal{D}_{1}
,
bwd2
for the computation of the second Bures-Wasserstein dependence coefficient \mathcal{D}_{2}
,
bwd1avar
for the computation of the asymptotic variance of the plug-in estimator for \mathcal{D}_{1}
,
bwd2avar
for the computation of the asymptotic variance of the plug-in estimator for \mathcal{D}_{2}
,
bwd1asR0
for sampling from the asymptotic distribution of the plug-in estimator for \mathcal{D}_{1}
under the hypothesis of independence between \mathbf{X}_{1},\dots,\mathbf{X}_{k}
,
estR
for the computation of the sample matrix of normal scores rank correlations,
otsort
for rearranging the columns of sample such that dim is in ascending order.
q = 5
dim = c(2,3)
# AR(1) correlation matrix with correlation 0.5
R = 0.5^(abs(matrix(1:q-1,nrow = q, ncol = q, byrow = TRUE) - (1:q-1)))
R0 = createR0(R,dim)
# Check whether scipy module is available (see details)
have_scipy = reticulate::py_module_available("scipy")
if(have_scipy){
sample = bwd2asR0(R0,dim,1000)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.