GGB-correlation-snippet.R
From Organic Design wiki
kcorrelation <- rgamma(2*nDE, shape=k, rate=k) # p49 2001 NEWTON paper DEscales <- rep(rgamma(nDE, shape=a0.shape, rate=scale), each=2) DEscales <- DEscales * kcorrelation
kcorrelation <- rgamma(m0, shape=k, rate=k) EEscales <- rgamma(nEE , shape=a0.shape, rate=scale) EEscales <- EEscales / kcorrelation scales <- c(rep(DEscales, each=nreps), rep(EEscales, each=2*nreps))
X <- rgamma(ngenes*pcols, a.shape, rate=scales) dim(X) <- c(pcols, ngenes) X <- t(X) # Data already on raw scale