copy code at your own peril

I have come several times upon cases of scientists [I mean, real, recognised, publishing, senior scientists!] from other fields blindly copying MCMC code from a paper or website, and expecting the program to operate on their own problem… One illustration is from last week, when I read a X Validated question [from 2013] about an attempt of that kind, on a rather standard Normal posterior, but using an R code where the posterior function was not even defined. (I foolishly replied, despite having no expectation of a reply from the person asking the question.)

4 Responses to “copy code at your own peril”

  1. With reference to your X validated reply. Suppose we have a positive parameter, say s, and corresponding prior p(s). I guess it is kosher to propose a draw log(s)* from a Gaussian random walk, then take the exponential of said draw *before* this is submitted to the prior, so that we evaluate p(s*). This should be ok, without having to resort to the transformation Jacobian, right?

  2. […] leave a comment for the author, please follow the link and comment on their blog: R – Xi’an’s Og.R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data […]

  3. […] article was first published on R – Xi'an's Og, and kindly contributed to […]

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.