Showing posts with label MCMC. Show all posts
Showing posts with label MCMC. Show all posts

Saturday, February 8, 2014

Week 2 : Zipfian Academy - Are you Frequentist or Bayesian ?

We started the week with a tour de force of matplotlib and then switched gears to Statistics. For the rest of the week, we covered Hypothesis Testing, Goodness of Fit (Kolmogorov Smirnov Test), Distributions, Confidence Intervals, p-values, t-tests, Frequentist A/B vs Bayesian A/B testing, MCMC

A few notes from this week:
  • There's a huge debate on the Frequentist vs Bayesian schools of thought with proponents on both sides. Just in case you're on the fence here's an Open Letter on why you should think about going Bayesian
  • The goal in Bayesian inference is to get a good handle on the posterior distribution over the input parameters. Some of the math can get pretty beefy so you would normally use a package like pymc or rjags to fit you distributions / models. Some good resources for pymc and MCMC are this Stats Book for Hackers and this set of videos from mathematicalmonk
  • Some EDA (Exploratory Data Analysis)  tools you should have in your workflow include Raw  and CartoDB
  • We had two pretty good talks by @nitin on LearnDataScience and @Udacity on their Data Science course development at one of the local meetup groups

Wednesday, February 6, 2013

Installing JAGS and rjags on Ubuntu 12.04

I ran into a few issues earlier trying to install JAGS/rjags on Ubuntu. This set of instructions assumes you already have R installed on your system

  • Download and Install R (32/64) -bit
  • Download the Bayesian Sampling Program JAGS from here : Extract the contents of the tar file and install the JAGS program by running the following commands from the JAGS root folder.
  • Download and install the rjags package : I tried install.packages('rjags') in R, which failed initially on my system (Ubuntu). Now, this may work if you're on a Mac or Windows. If you experience the same problems, you need to download the appropriate rjags tar file and and then install it manually.
  • The second line configures rjags for (32/64) bit R. If you are running 32-bit R be sure to replace \lib{64} with \lib and for 64-bit R replace \lib{64} with \lib64. This is very important as you could lose a few nights of sleep here trying to figure out why you can't link the rjags library with the JAGS program. This comes courtesy of Rrasch
    JAGS is a program that is used for the analysis of Bayesian Hierarchical Models using MCMC (Markov Chain Monte Carlo) Simulations. I used JAGS over BUGS(WinBUGS/OpenBUGS) because it is cross platform, runs on Linux and it appears to be more robust among other reasons.