transforms {Umpire} | R Documentation |
normalOffset
is a function that can be used as the
TRANSFORM
argument in an alterMean
operation, which adds
an offset to each value in the mean where the offset is chosen from a
normal distribution.
invGammaMultiple
is a function that can be used as the
TRANSFORM
argument in an alterSD
operation, which multiplies
each standard deviation by a positive value chosen from an inverse gamma
distribution with parameters shape
and scale
.
normalOffset(x, delta, sigma) invGammaMultiple(x, shape, rate)
x |
numeric vector of mean expression or standard deviation defined in the object |
delta, sigma |
numeric vector used as |
shape, rate |
numeric vector used as |
... |
additional arguments affecting the specific transformation performed |
normalOffset
returns a new vector, each element of which is added
by a offset chosen from a normal distribution with parameters mean
and sd
.
invGammaMultiple
returns a new vector, each element of which is
multiplied by a positive value chosen from an inverse gamma distribution
with parameters shape
and scale
.
Kevin R. Coombes krc@silicovore.com, Jiexin Zhang jiexinzhang@mdanderson.org,
nComp <- 10 nGenes <- 100 comp <- list() for (i in 1:nComp) { comp[[i]] <- IndependentNormal(rnorm(nGenes/nComp, 6, 1.5), 1/rgamma(nGenes/nComp, 44, 28)) } myEngine <- Engine(comp) nrow(myEngine) nComponents(myEngine) summary(myEngine) myData <- rand(myEngine, 5) dim(myData) summary(myData) MEAN <- 2 SD <- 2 myEngine.alterMean <- alterMean(myEngine, function(x) normalOffset(x, MEAN, SD)) myData.alterMean <- rand(myEngine.alterMean, 5) summary(myData.alterMean) RATE <- 1 SHAPE <- 2 myEngine.alterSD <- alterSD(myEngine, function(x) invGammaMultiple(x, SHAPE, RATE)) myData.alterSD <- rand(myEngine.alterSD, 5) summary(myData.alterSD)