Skip to content
Prev 2381 / 398506 Next

Problems with coda

Geir Olve Storvik wrote:
Geir,

I had the same problem and got it fixed by adding an additional argument
"bwf" to the "densplot" function like this: 

"densplot" <-function (x, combine.chains = F, bwf) 
{
        x <- as.mcmc(x)
# *** Argument bwf required        do.densplot <- function(j, i) {
#     Like the next line
         do.densplot <- function(j, i, bwf) {
                #NB Using R scoping rules
                #
                if (missing(i)) 
                        y <- as.vector(x[, j, , drop = T])
                else y <- as.vector(x[, j, i, drop = T])
                y.orig <- y
# *** R complains about the next line, "illegal use of missing"
                if (missing(bwf)) {
                        N <- length(!is.na(y))
                        bw <- 1.06 * min(sd(y), IQR(y)/1.34) * 
                                N^-0.2
                }
                else {
                        bw <- bwf(y)
                        if (bw == 0) 
                                bw <- 0.1
                }
... 

There are a couple of other bugs, too.
I have notified the author/maintainer of the package and according to
him, it may be due to changes in R between 0.62 and 0.63 and he is
trying to look at the problem. 

Regards,

ST
--
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._