Learn R Programming

RJaCGH (version 1.1.1)

gelman.brooks.plot: gelman-brooks plot for 'RJaCGH' objects

Description

A plot to show the convergence of several parallel chains, as described in Brooks and Gelman, 1998.

Usage

gelman.brooks.plot(obj, bin = 1000, array = NULL, Chrom = NULL, k = NULL)

Arguments

obj
a list containing several parallel chains; that is objects of any of RJaCGH, RJaCGH.Chrom, RJaCGH.genome, RJaCGH.array classes (obviously, all of the same class).
bin
Number of observations taken in every subchain
array
if obj is 'RJaCGH.array', the name of the array to plot must be given.
Chrom
if obj is 'RJaCGH.Chrom', the number of the chromosome to plot must be given.
k
Model to monitorize (i.e., number of hidden states). If NULL, the most visited is taken.

Value

  • A plot with four panels showing the R values is drawn. The first one shows the R value for the number of hidden states. The second one shows the R values for the means of the most visited model (there will be a R value for each mean). The third and the four show the R values for variances and betas of the most visited model. Besides, a list is returned with components
  • kR values for the numebr of states
  • muR values for the means of the states
  • muR values for the variances of the states
  • muR values for the beta parameters

Details

As described in the references, for every bin runs of the chain, the R value of k, mu, sigma.2 and beta are computed. Please note that the input to this function must be a list of parallel chains. If the convergence diagnostics returned by it are satisfactory, then one can run collapseChain to join them all, but one can not collapse all the chains and later run gelman.brooks.plot to recover the diagnostics, because the list of chains has been merged into one object.

References

Brooks, S.P. and Gelman, A. (1998). General Methods for Monitoring convergence of iterative simulations. Journal of Computational and Graphical Statistics. p434-455.

Oscar M. Rueda and Ramon Diaz Uriarte. A flexible, accurate and extensible statistical method for detecting genomic copy-number changes. http://biostats.bepress.com/cobra/ps/art9/. {http://biostats.bepress.com/cobra/ps/art9/}.

See Also

RJaCGH, summary.RJaCGH, model.averaging, plot.RJaCGH, states, trace.plot, collapseChain

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 <- list()
for (i in 1:4) {
fit.genome[[i]] <- RJaCGH(y=y, Pos=Pos, Chrom=Chrom, model="genome",
burnin=10, TOT=1000, jump.parameters=jp, k.max = 4)
}

gelman.brooks.plot(fit.genome)

Run the code above in your browser using DataLab