createR0 | 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 constructs the correlation matrix under independence of \mathbf{X}_{1},...,\mathbf{X}_{k}
, given the entire correlation matrix \mathbf{R}
.
createR0(R, dim)
R |
The correlation matrix of |
dim |
The vector of dimensions |
Given a correlation matrix
\mathbf{R} = \begin{pmatrix} \mathbf{R}_{11} & \mathbf{R}_{12} & \cdots & \mathbf{R}_{1k} \\
\mathbf{R}_{12}^{\text{T}} & \mathbf{R}_{22} & \cdots & \mathbf{R}_{2k} \\
\vdots & \vdots & \ddots & \vdots \\
\mathbf{R}_{1k}^{\text{T}} & \mathbf{R}_{2k}^{\text{T}} & \cdots & \mathbf{R}_{kk} \end{pmatrix},
the matrix \mathbf{R}_{0} = \text{diag}(\mathbf{R}_{11}, \dots, \mathbf{R}_{kk})
, being the correlation matrix
under independence of \mathbf{X}_{1}, \dots, \mathbf{X}_{k}
, is returned.
The correlation matrix under independence of \mathbf{X}_{1}, \dots, \mathbf{X}_{n}
.
q = 10
dim = c(1,2,3,4)
# 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)))
createR0(R,dim)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.