Thanks for the nice remarks about the book; I'm glad it is useful!
The error you've encountered is caused by a change I made to the output of plotPost(). It used to return aspects of the histogram such as the densities in bins, but now it returns details about the posterior distribution. Therefore histInfo$densities no longer exists. It was only used to set aspects of subsequent graphs such as scale limits, so there are other ways to do things. For example, see the reply to an earlier discussion about this problem, at http://doing-bayesian-data-analysis.12272.x6.nabble.com/BernMetropolisTemplate-R-td5000491.html#a5000604
Sorry for the hassle! I hope it's not too much of a frustration.
On Fri, Apr 19, 2013 at 1:17 AM, Rothrock [via Doing Bayesian Data Analysis] <[hidden email]> wrote:
First let me say, "Thank you!" for writing this book. It has been my dream for a couple of years to learn Bayesian and your book is fantastic.
I'm using the second edition, JAGS, and R Studio with R version 2.15.2 on a Mac.
On exercise 7.5 I get the following error:
Error in histInfo$density : $ operator is invalid for atomic vectors
This is referring to the value give for densMax that I got
densMax = max( histInfo$density )
I replaced it with the value from BernMetropolisTemplate.R and that worked well.
densMax = max( density( acceptedTraj )$y )
If you reply to this email, your message will be added to the discussion below: