In the code provided for the simulation data, I can see that the correlation matrix (b_cor
) is used directly as navmix()
input. Given that the input matrix is suggested to undergo both standardization and normalization (like what was done forb_prop
), I am wondering if the b_cor
matrix should undergo something similar?
# R.version
platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 4
minor 1.0
year 2021
month 05
day 18
svn rev 80317
language R
version.string R version 4.1.0 (2021-05-18)
nickname Camp Pontanezen
### Since my traits are highly correlated and determined in the same sample, I need to use the correlation matrix
corX <- cor(traits, method=c("spearman")) # traits have undergone rank-based inverse normal transformation
b_cor = matrix(nrow = n_all, ncol = m) #n_all=number of variants, m=number of traits
for (j in 1:n_all){
S1 = diag(se[j, ])
S = S1 %*% corX %*% S1
b_cor[j, ] = solve(sqrtm(S), bhat[j, ])
}
nav_out_cor <- navmix(b_cor, ...)
### I also created a b_prop matrix since I interpreted the paper as to say that the input should be standardized and normalized
# For every _Beta_ for each SNP x Trait combination, I divided by its SE. The results were stored in a matrix called b_std.
# To normalize, I used the code provided in the simulation example:
b_prop = navmix::row_norm(data.matrix(b_std))
# I noticed that b_prop is never used as input for navmix()... is that indeed correct? Otherwise, I would do:
nav_out_prop <- navmix(b_prop, ...)
# Only b_std and b_cor look to be used as navmix() input in the simulation code.
Please let me know if you require any clarification. To try and summarize my questions: