collapseChain {RJaCGH}R Documentation

Collapse several parallel chains ('RJaCGH' objects)

Description

method to join or collapse several 'RJaCGH' objects, for use in every method of class 'RJaCGH'.

Usage

collapseChain(obj)
collapseChain.RJaCGH(obj)
collapseChain.RJaCGH.genome(obj)
collapseChain.RJaCGH.Chrom(obj)
collapseChain.RJaCGH.array(obj)

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).

Details

If several parallel chains are run and if they converge (see gelman.brooks.plot) they should be joined in one. This is what this method does.

Value

An object of the same class as any of the list obj.

Author(s)

Oscar Rueda and Ramon Diaz Uriarte

References

Oscar Rueda and Ramon Diaz Uriarte, in prep.

See Also

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

Examples

y <- c(rnorm(100, 0, 1), rnorm(10, -3, 1), rnorm(20, 3, 1),
       rnorm(100,0, 1)) 
Pos <- runif(230)
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.chrom <- RJaCGH(y=y, Pos=Pos, Chrom=Chrom, model="Chrom",
                    burnin=10, TOT=1000, k.max = 4,
                    jump.parameters=jp)
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)
}

## Not run: gelman.brooks.plot(fit.genome)
##If all R seem to be round 1
## Not run: fit.genome <- collapseChain(fit.genome)

[Package RJaCGH version 0.4 Index]