Re: [R] About Coda Package

From: Martyn Plummer <>
Date: Tue 27 Sep 2005 - 19:35:29 EST

Dear Juan Pablo,

It is best to send package-specific queries the package maintainer (me in this case) which you can find out by typeing "library(help=coda)"

The inconsistency comes from two different ways of estimating the spectral density at frequency 0: spectrum0() adapted from Heidelberger & Welch, fits a generalized linear model to the periodogram. This function is called by the effectiveSize() function. Unfortunately it crashes when there is very high autocorrelation. The alternative function does the same thing by fitting an autoregressive model to the data, and won't crash even on highly autocorrelated data. The latter function is called by codamenu().

The two functions are giving different results here, but to be honest, an effective sample size of 370 isn't sufficient for serious inference from an MCMC sample either. I can only reiterate the advice given by the warning message.


On Tue, 2005-09-27 at 11:11 +0200, Juan Pablo Sanchez Serrano wrote:
> Dear R users:
> I am using the package coda (the last verison in CRAN) to analyse the
> output from a MCMC Bayesian analysis. And I get unconsitented
> results. I have export the chain using the read.table function and
> after I have transformed this data frame to an mcmc object using the
> mcmc function. I am interested in three variables, when I use the
> function effectiveSize I have these figures: 403.3730 1854.4534
> 369.8643. But when I run the function codamenu to perform same
> convergence test I get this warning mensage:
> Checking effective sample size ...
> *******************************************
> Some variables in your chain have an
> effective sample size of less than 200
> This is too small, and may cause errors
> in the diagnostic tests
> Look at plots first to identify variables
> with slow mixing. (Choose menu Output
> Analysis then Plots)
> Re-run your chain with a larger sample
> size and thinning interval. If possible,
> reparameterize your model to improve mixing
> *******************************************
> Some thing is wrong. Could someone explain to me what is happening?
> Thanks,
> Juan Pablo.

This message and its attachments are strictly confidential. ...{{dropped}} mailing list PLEASE do read the posting guide! Received on Tue Sep 27 19:44:30 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 17:46:40 EST