# Simulate genetic values with 'AlphaSimR' for two additive traits in two
# environments based on a multiplicative model with three terms.
# 1. Define the genetic architecture of the simulated traits.
# Mean genetic values.
mean <- c(5, 240) # Trait 1, Trait 2
# Additive genetic variances.
var <- c(0.086, 0.12, 15.1, 8.5) # Trait 1 x 2 environments, Trait 2 x 2 environments
# Additive genetic correlations between the two simulated traits.
TcorA <- matrix(c(
1.0, 0.6,
0.6, 1.0
), ncol = 2)
# Additive genetic correlations between the two simulated environments.
EcorA <- matrix(c(
1.0, 0.2,
0.2, 1.0
), ncol = 2)
# Construct separable additive genetic correlation matrix.
corA <- kronecker(TcorA, EcorA)
input_asr <- multi_asr_input(
ntraits = 2,
nenvs = 2,
mean = mean,
var = var,
corA = corA,
nterms = 3
)
Run the code above in your browser using DataLab