Calculate matrix of error correlations using LD-score regression.
R_ldsc.Rd
Calculate matrix of error correlations using LD-score regression.
Usage
R_ldsc(
Z_hat,
ldscores,
ld_size,
N,
return_gencov = FALSE,
make_well_conditioned = TRUE,
cond_num = 1e+05 - 1,
blocks = NULL,
ncores = 1
)
Arguments
- Z_hat
matrix of z-scores
- ldscores
vector of ldscores
- ld_size
Number of variants used to compute ldscores
- N
vector of sample sizes, length equal to number of columns of Z_hat
- return_gencov
If TRUE, the function will return genetic covariance in addition to residual covariance/correlation.
- make_well_conditioned
If TRUE, residual covariance will be projected to the nearest positive definite matrix with condition number at least cond_num
- cond_num
Condition number used if make_well_conditioned = TRUE
- blocks
If not NULL, use jackknife to estimate the standard error of estimates.
- ncores
Number of cores to use for jackknifing