Hi:

Ben's example worked for me as follows:

x <- matrix(runif(22000),ncol=22)
library(lattice)
library(coda)
m <- as.mcmc(x)
xyplot(m, layout = c(2, 11))

layout =  uses columns first, then rows...I always forget that :)  It also
has an optional
third argument for pages, which might come in handy here. If you want the
order of the
panels to be reversed, use the additional option as.table = TRUE.

HTH,
Dennis

On Tue, Jun 1, 2010 at 9:37 AM, Noah Silverman <noah@smartmediacorp.com>wrote:

> Hi,
>
> I used the term "run", as each iteration of the Gibbs sampler produces
> 22 variables (coefficients for Beta in a regression model)
>
>
> The example wont work
>
>
> On 6/1/10 5:54 AM, Ben Bolker wrote:
> > Noah Silverman <noah <at> smartmediacorp.com> writes:
> >
> >
> >> I'm running a long MCMC chain that is generating samples for 22
> variables.
> >>
> >> I have each run of the chain as a row in a matrix.
> >>
> >
> >> So:  Chain[,1] is the column with all the samples for variable one.
> >> Chain[,2] is the column with all the samples for variable 2, etc.
> >>
> >   The previous 2 paragraphs seemed contradictory until I realized
> > that in the first paragraph you are using "run" to mean what I would
> > usually call a "sample" ...
> >
> >
> >> I'd like to fit all 22 on a single page to print a nice summary.  It is
> >> OK if the graphs are small, I just need to show the overall shape and
> >> convergence.
> >>
> >   How about for example
> >
> >
> >> x <- matrix(runif(22000),ncol=22)
> >> library(coda)
> >> m <- as.mcmc(x)
> >> xyplot(m)
> >> xyplot(m,layout=c(4,6))
> >>
> > ______________________________________________
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]

