Description Usage Arguments Details Value Examples
Create a matrix where columns are (Pearson) uncorrelated.
1 | decor(seedMat)
|
seedMat |
A matrix where the number of rows is no less than the number of columns. The function will change |
Algorithm: for i = 2
to ncol(seedMat)
, the function replaces the first i - 1
elements of the i
th column with values such that the new i
th column becomes uncorrelated with the first i - 1
columns.
None.
1 2 3 4 5 6 7 8 9 10 11 12 13 | set.seed(123)
X = matrix(rnorm(1000), ncol = 10)
corMat = cor(X)
summary(corMat[corMat < 1]) # Off-diagonal.
# Min. 1st Qu. Median Mean 3rd Qu. Max.
# -0.19271 -0.05648 -0.02272 -0.01303 0.01821 0.24521
SimJoint::decor(X)
corMat2 = cor(X)
summary(corMat2[corMat2 < 1])
# Min. 1st Qu. Median Mean 3rd Qu. Max.
# -2.341e-17 -3.627e-18 3.766e-18 4.018e-18 1.234e-17 3.444e-17
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.