Tuesday, July 4, 2017

DBDA2E Scripts in Stan


Many more scripts from DBDA2E have been re-written for Stan, by Prof. Joseph Houpt at Wright State University. Joe has posted his scripts at GitHub: https://github.com/jhoupt/DBDA2Estan

To run Joe's Stan scripts you will need the usual other supporting scripts and data files from DBDA2E, available at the book's web site (see Step 5 of Software Installation). Just copy Joe's scripts into your folder of scripts from the book.

Joe's GitHub site includes only the new scripts he modified from the book's JAGS scripts. The book had several Stan scripts already, and Joe has not re-written those. The book describes Stan in Chapter 14, and has several Stan scripts accompanying applications in later chapters. (Regarding discrete parameters: The book points out that Stan does not directly implement discrete parameters like JAGS, but the book does not discuss how to marginalize over discrete parameters instead. Some of Joe's scripts implement marginalization over discrete parameters.)

Big thanks to Joe Houpt for writing these scripts and making them available!

Notes regarding the figure at the top of this post:
1. Yes, the "<-" operator is deprecated in Stan, and I avoid using it in R, but it still looks like an arrow, and programmers who are familiar with R and JAGS will recognize it.
2. The Stan icon comes from the Stan web page. If the Stan folks don't like my use of the icon here, please contact me and I'll remove it or modify it as required.


Reminders of some recent posts:

3 comments:

  1. Funny you should ask! We just received a registered trademark for Stan and there are now some usage guidelines posted. We're basically following what Apache does with their trademarks.

    Short answer is that you're OK with non-commercial references of this kind.

    And thanks for the post. I just noted it in the weekly Stan roundup on Gelman's blog.

    ReplyDelete
  2. Interesting, why are you not using `<-` anymore in R? It is very powerful assignment operator to distinguish scope. See here

    ReplyDelete
  3. Thanks for the pointer, and thanks to Joe.

    ReplyDelete