ntrait <- 2
genetic_corrmat <- matrix(0.6, ncol = ntrait, nrow = ntrait)
diag(genetic_corrmat) <- 1
full_corrmat <- matrix(-0.25, ncol = ntrait, nrow = ntrait)
diag(full_corrmat) <- 1
h2_vec <- rep(0.6, ntrait)
cov <- construct_covmat(fam_vec = c("m", "f"),
genetic_corrmat = genetic_corrmat,
h2 = h2_vec,
full_corrmat = full_corrmat)
cov
correct_positive_definite(cov)
Run the code above in your browser using DataLab