Learn R Programming

RJaCGH (version 2.0.4)

smoothMeans: Smoothed posterior mean

Description

Smoothed posterior mean for every probe after fitting a RJaCGH model.

Usage

smoothMeans(obj, array=NULL, Chrom = NULL, k = NULL) "smoothMeans"(obj, array=NULL, Chrom = NULL, k=NULL)

Arguments

obj
An RJaCGH object, of class 'RJaCGH'
array
Vector of names of the array to get smoothed means. If NULL, all of them.
Chrom
Vector of the chromosomes. If NULL, all of them.
k
Number of states (or model) to get the smoothed means from. If NULL, Bayesian Model Averaging is used.

Value

A matrix. Columns of the matrix are arrays (i.e., for an RJaCGH object with a single array, the value is a one column matrix). Each column contains the smoothed means for every probe.

Details

For a model with k hidden states, the mean from the MCMC samples from mu is computed for every hidden state. Then, for every probe these means are averaged by its posterior probability of belonging to every hidden state. If k is NULL, then these smoothed means are computed for every model and averaged by the posterior probability of each model.

References

Rueda OM, Diaz-Uriarte R. Flexible and Accurate Detection of Genomic Copy-Number Changes from aCGH. PLoS Comput Biol. 2007;3(6):e122

See Also

RJaCGH, plot.RJaCGH

Examples

Run this code
y <- c(rnorm(100, 0, 1), rnorm(10, -3, 1), rnorm(20, 3, 1),
       rnorm(100,0, 1)) 
Pos <- sample(x=1:500, size=230, replace=TRUE)
Pos <- cumsum(Pos)
Chrom <- rep(1:23, rep(10, 23))

jp <- list(sigma.tau.mu=rep(0.5, 4), sigma.tau.sigma.2=rep(0.3, 4),
           sigma.tau.beta=rep(0.7, 4), tau.split.mu=0.5, tau.split.beta=0.5)

fit.genome <- RJaCGH(y=y, Pos=Pos, Chrom=Chrom, model="Genome",
                    burnin=10, TOT=1000, k.max = 4,
                    jump.parameters=jp)
plot(y~Pos)
lines(smoothMeans(fit.genome) ~ Pos)

Run the code above in your browser using DataLab