Bayesian data analysis on a Mac

From enfascination

Jump to: navigation, search
Line 3: Line 3:
 
[[Blog:Bayesian_data_analysis_in English|Bayesian data analysis]] is a way of figuring out what you believe given what you just saw, but in math.  [http://www.r-project.org/ R] is a free computer language for calculating statistics.  [http://www.openbugs.info/w/ OpenBUGS] is a flexible program for doing Bayesian data analysis.  [http://www.biostat.umn.edu/~brad/software/BRugs/ BRugs] is a bridge between R and BUGS.  Macs are why Steve Jobs wears black turtlenecks.   
 
[[Blog:Bayesian_data_analysis_in English|Bayesian data analysis]] is a way of figuring out what you believe given what you just saw, but in math.  [http://www.r-project.org/ R] is a free computer language for calculating statistics.  [http://www.openbugs.info/w/ OpenBUGS] is a flexible program for doing Bayesian data analysis.  [http://www.biostat.umn.edu/~brad/software/BRugs/ BRugs] is a bridge between R and BUGS.  Macs are why Steve Jobs wears black turtlenecks.   
  
R is cross-platform, but OpenBUGS only works on Windows.  The same holds for most of the cousins of OpenBUGS, and most of the bridges between the cousins and R.  So it is hard for Mac users to do Bayesian data analysis in R with the flexibility offered by BUGS.  That is the really narrow problem that this post is solving.
+
This post is solving a very narrow problem. R is cross-platform, but OpenBUGS only works on Windows.  The same holds for most of the cousins of OpenBUGS, and most of the bridges between the cousins and R.  So it is hard for Mac users to do Bayesian data analysis in R with the flexibility offered by BUGS.   
  
My colleague [http://hri.cogs.indiana.edu/people/jack.php  Jack Harris] has a fix that doesn't take any fiddling.  Its great.  If you know what you are doing, instructions are below.  If you wish you knew what you were doing, [http://www.indiana.edu/~kruschke/DoingBayesianDataAnalysis/ read more].  The linked-to book  has puppies on the cover to signal its friendliness to the 'fraid-of-math.
+
My colleague [http://hri.cogs.indiana.edu/people/jack.php  Jack Harris] has a fix that doesn't take any fiddling.  Its great.  If you know what you are doing, instructions are below.  If you wish you knew what you were doing, [http://www.indiana.edu/~kruschke/DoingBayesianDataAnalysis/ read more].   
  
 
====Instructions for doing Bayesian Data Analysis on a Mac====
 
====Instructions for doing Bayesian Data Analysis on a Mac====
* Be a mac user of R (if you aren't then you don't have a problem)
+
* Be a Mac user of R (if you aren't then you don't have a problem)
 
* Download [http://hri.cogs.indiana.edu/~jackh/WindowsR.app.tar.bz2 this].   
 
* Download [http://hri.cogs.indiana.edu/~jackh/WindowsR.app.tar.bz2 this].   
 
* Extract the tarball or (if you don't know what that means) hope that your computer magically turns the file into one that ends with ''.app'' .   
 
* Extract the tarball or (if you don't know what that means) hope that your computer magically turns the file into one that ends with ''.app'' .   
 
* Open the app, wait a bit.  There will be a benign error, just hit OK.
 
* Open the app, wait a bit.  There will be a benign error, just hit OK.
 
* After R loads, type  
 
* After R loads, type  
  Install.packages("Brugs")
+
  install.packages("Brugs")
 
* Download [http://www.indiana.edu/~jkkteach/BayesTutorial/TutorialBRugsTest.R this test file] and type
 
* Download [http://www.indiana.edu/~jkkteach/BayesTutorial/TutorialBRugsTest.R this test file] and type
 
  setwd("~/whereeverthefilewent")
 
  setwd("~/whereeverthefilewent")
 
  source("TutorialBRugsTest.R")
 
  source("TutorialBRugsTest.R")
  
You should get pretty graphs.  That means it works.  If you want more sample code, there is lots [http://www.indiana.edu/~kruschke/DoingBayesianDataAnalysis/Programs/ here].  The folder lists the samples from [http://www.indiana.edu/~kruschke/DoingBayesianDataAnalysis Kruschke's book], and they should all run fine if you download everything to one spot.
+
You should get pretty graphs.  That means it worked.  If you want more sample code, there is lots [http://www.indiana.edu/~kruschke/DoingBayesianDataAnalysis/Programs/ here].  The folder lists the samples from [http://www.indiana.edu/~kruschke/DoingBayesianDataAnalysis Kruschke's book].  The samples should all run fine if you download everything to one spot.  The book has puppies on the cover to signal its friendliness to the 'fraid-of-math.

Revision as of 21:38, 9 March 2011

specifically: Bayesian Data Analysis on a Mac with R and OpenBUGS via BRugs

Bayesian data analysis is a way of figuring out what you believe given what you just saw, but in math. R is a free computer language for calculating statistics. OpenBUGS is a flexible program for doing Bayesian data analysis. BRugs is a bridge between R and BUGS. Macs are why Steve Jobs wears black turtlenecks.

This post is solving a very narrow problem. R is cross-platform, but OpenBUGS only works on Windows. The same holds for most of the cousins of OpenBUGS, and most of the bridges between the cousins and R. So it is hard for Mac users to do Bayesian data analysis in R with the flexibility offered by BUGS.

My colleague Jack Harris has a fix that doesn't take any fiddling. Its great. If you know what you are doing, instructions are below. If you wish you knew what you were doing, read more.

Instructions for doing Bayesian Data Analysis on a Mac

  • Be a Mac user of R (if you aren't then you don't have a problem)
  • Download this.
  • Extract the tarball or (if you don't know what that means) hope that your computer magically turns the file into one that ends with .app .
  • Open the app, wait a bit. There will be a benign error, just hit OK.
  • After R loads, type
install.packages("Brugs")
setwd("~/whereeverthefilewent")
source("TutorialBRugsTest.R")

You should get pretty graphs. That means it worked. If you want more sample code, there is lots here. The folder lists the samples from Kruschke's book. The samples should all run fine if you download everything to one spot. The book has puppies on the cover to signal its friendliness to the 'fraid-of-math.