Difference between revisions of "GGB-correlation-snippet.R"

From Organic Design wiki
m
 
(Fixing parameters (untested))
Line 1: Line 1:
kcorrelation <- rgamma(2*nDE, shape=k, rate=k) # p49 2001 NEWTON paper
+
p <- 1000
DEscales <- rep(rgamma(nDE, shape=a0.shape, rate=scale), each=2)
+
n <- 10
 +
a.shape  <- parameters[1]
 +
a0.shape <- parameters[2]
 +
scale    <-  parameters[3]
 +
k <- 20
 +
 
 +
kcorrelation <- rgamma(2*m1 shape=k, rate=k) # p49 2001 NEWTON paper
 +
DEscales <- rep(rgamma(m1, shape=a0.shape, rate=scale), each=2)
 
DEscales <- DEscales * kcorrelation
 
DEscales <- DEscales * kcorrelation
  
 
kcorrelation <- rgamma(m0, shape=k, rate=k)
 
kcorrelation <- rgamma(m0, shape=k, rate=k)
EEscales <- rgamma(nEE , shape=a0.shape, rate=scale)
+
EEscales <- rgamma(m0 , shape=a0.shape, rate=scale)
 
EEscales <- EEscales / kcorrelation
 
EEscales <- EEscales / kcorrelation
scales  <- c(rep(DEscales, each=nreps), rep(EEscales, each=2*nreps))
+
scales  <- c(rep(DEscales, each=slides), rep(EEscales, each=2*slides))
  
X <- rgamma(ngenes*pcols, a.shape, rate=scales)
+
X <- rgamma(ngenes*p, a.shape, rate=scales)
dim(X) <- c(pcols, ngenes)
+
dim(X) <- c(p, n)
 
X <- t(X)  # Data already on raw scale
 
X <- t(X)  # Data already on raw scale

Revision as of 03:01, 28 August 2006

p <- 1000 n <- 10 a.shape <- parameters[1] a0.shape <- parameters[2] scale <- parameters[3] k <- 20

kcorrelation <- rgamma(2*m1 shape=k, rate=k) # p49 2001 NEWTON paper DEscales <- rep(rgamma(m1, shape=a0.shape, rate=scale), each=2) DEscales <- DEscales * kcorrelation

kcorrelation <- rgamma(m0, shape=k, rate=k) EEscales <- rgamma(m0 , shape=a0.shape, rate=scale) EEscales <- EEscales / kcorrelation scales <- c(rep(DEscales, each=slides), rep(EEscales, each=2*slides))

X <- rgamma(ngenes*p, a.shape, rate=scales) dim(X) <- c(p, n) X <- t(X) # Data already on raw scale