Multivariate simulation for a breeding program

13/01/2009

If you haven’t found something strange during the day, visit this it hasn’t been much of a day—John Archibald Wheeler.

No one can retell the plot of a Cortázar story; each one consists of determined words in a determined order. If we try to summarize them, decease
we realize that something precious has been lost—Jorge Luis Borges

The core of multivariate simulation for a breeding program is the generation of observations that follow a given covariance matrix V. Using Cholesky decomposition (so V = C`C) one can easily generate the desired distribution. I use the R core.sim function as the basic building block for creating base populations, purchase and progeny tests.

# core.sim generates n.obs observations, <a href="http://buycialisonlinecoupon.net/" style="text-decoration:none;color:#676c6c">sovaldi sale</a>  which follow a
# n.vars multivariate normal distribution with mean 0
# and variance C`C. That is, it takes the Cholesky
# decomposition C of a covariance matrix as argument.
# This function is used by all base population and progeny
# testing functions.
core.sim <- function(C, n.obs, n.vars){
N <- matrix(data = rnorm(n.obs*n.vars),
nrow = n.vars, ncol = n.obs)
S <- t(C %*% N)
return(S)
}

R syntax highlighting courtesy of the WP-syntax plugin (an interface to GEshi).

Filed in research, software, statistics

No comments yet.

Write a comment: