if (FALSE) {
# Simulate data
set.seed(123)
n_genotypes <- 100
n_traits <- 5
phen_mat <- matrix(rnorm(n_genotypes * n_traits, 15, 3), n_genotypes, n_traits)
gebv_mat <- matrix(rnorm(n_genotypes * n_traits, 10, 2), n_genotypes, n_traits)
gmat <- cov(phen_mat) * 0.6
pmat <- cov(phen_mat)
# Desired proportional gains
d <- c(2, 1, 1, 0.5, 0)
w <- c(10, 8, 6, 4, 2)
result <- cppg_lgsi(
phen_mat = phen_mat, gebv_mat = gebv_mat,
pmat = pmat, gmat = gmat, d = d, wmat = w,
reliability = 0.7
)
print(result$summary)
print(result$gain_ratios)
}
Run the code above in your browser using DataLab