
Free Python ebook: Bayesian Methods for Hackers - blazin_billy
https://github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
======
recuter
"This book has an unusual development design. The content is open-sourced,
meaning anyone can be an author. Authors submit content or revisions using the
GitHub interface."

What a wonderful thing -- this book looks fantastic, but the approach to
making it really takes the cake. I really hope interactive notebooks (iPython
based or otherwise) and multiple authors collaborating on Github will become
widespread.

~~~
robbiep
There is both wikibooks and wiki university - last time (several years ago) I
looked on wikibooks there were actually very good physiology and biology
textbooks that had been open sourced. Not sure if development has tapered but
it seemed a pretty robust community for a while

~~~
vanderZwan
It sounds like a perfect fit for the kind of fields that have grown so vast
you need an expert for every sub-section. Like physiology and biology,
basically.

------
mariuskempe
I should like to give a contrarian comment about this, because it is on top of
the front page and seems to be being received positively. This book is
probably not a good way to learn about statistical inference. It has quite
confused explanations of both Bayesian and frequentist approaches. The preface
seems to imply that programmers, by virtue of being able to use computers,
don't need to take a rigorous mathematical course in Bayesian methods. However
the text actually uses mathematical notation throughout, and as far as I could
tell it is often not explained. I noticed at least one case where a
probability distribution (gamma) was described only through plots i.e. without
specifying its pdf or how you could derive the pdf. I think the kind of
discourse that this book exemplifies is halfway to cargo cult 'statistics'.

~~~
gtt
I've got exactly the same feeling. Could you suggest a good introductory
textbook into MCMC? They left it as a mysterious blackbox and I'm not very
uncomfortable with using mathematical blackboxes I don't understand.

~~~
levesque
David Mackay covers MCMC in his exhaustive book titled "Information Theory,
Inference, and Learning Algorithms" available for free here:
<http://www.inference.phy.cam.ac.uk/itprnn/book.html>

They are covered near the end of the book. It should be enough to familarize
yourself with and understand the basic concepts of MCMC. Anything more in-
depth will require a strong mathematical background.

BTW : There are probably a ton of books that cover MCMC out there - that's
just one I liked and which is freely downloadable.

~~~
gtt
I have some background (grad student in cfd, thinking about switching to some
sort of data analysis later on) but my measure theory and probability skills
are rusty (on the other hand numerical linear algebra, functional calculus and
complex analysis are superb). What would be a good book for my level?

~~~
mariuskempe
You'll have no trouble.

~~~
mariuskempe
I'm sorry! I misread your question as 'Would this be a good book for my
level?'.

------
spindritf
To spare others frustrations, you need to run IPython from the same directory
as the notebook you want to view. So to see chapter one:

    
    
        (your-virtualenv) ~/path/to/the/book/Chapter1_Introduction $ ipython notebook --pylab inline
    

and then it will be linked on the list. Importing from different directories
apparently doesn't work.

~~~
drunkpotato
I had a heck of a time getting scipy working in a virtualenv on Mac OS X
Mountain Lion. If you're looking for an easy install script, I whipped one up
here:

<https://gist.github.com/mprentice/5710992>

Improvements welcome!

~~~
bsg75
I started using Anaconda on OSX to skip the install headaches.

------
onedognight
I read this book a few weeks ago. I loved the ipython notebook format. Being
able to edit the code for each figure and play around with parameters while
reading was a treat. As a bonus, I learned as much a about making nice figures
as I did about Bayesian Methods. There were quite a few typos, but it wasn't
much of a context switch to edit the source as I found them and then submit
patches when I was done. I probably wouldn't have taken the time if it wasn't
as convenient.

~~~
csense
ipython looks really interesting, maybe even deserving its own HN thread.

This is the second time I've seen it in the last month, I noticed it in the
documentation of a Python static blog generator, Nikola [1].

[1]
[https://github.com/ralsina/nikola/blob/master/nikola/plugins...](https://github.com/ralsina/nikola/blob/master/nikola/plugins/compile_ipynb/README.txt)

~~~
gknoy
I love IPython: it's definitely worth it if you want to regularly use a REPL
to explore things like your Django objects, filter for things, or test scripts
with test data. I really like it for exploring a codebase which I am not 100%
familiar with, as its tab completion is excellent.

Run it with _ipython --pprint_ though, so you get automatic pretty printing. I
also recommend using the qtconsole plugin , as it is Much Nicer.

Basically, if you like bpython, this is better in every way I can think of. If
you like the plain python REPL, give this a shot anyway. :) You may be
pleasantly surprised.

~~~
Chris2048
It also has a nice client-server structure too:

I think there's a vim or emacs python extension that connects to an ipython
kernel to run execute python snippets.

~~~
bsg75
<https://github.com/tkf/emacs-ipython-notebook>

<https://github.com/ivanov/vim-ipython>

------
codezero
"PDF versions are coming. PDFs are the least-prefered method to read the book,
as pdf's are static and non-interactive. If PDFs are desired, they can be
created dynamically using Chrome's builtin print-to-pdf feature."

While I agree PDFs are antiquated, I still like them for casual, off-the-grid
reading, and opening many different pages and printing to PDF is not feasible
or easy to organize once on my iPad for reading. All the same, I'll check this
out.

~~~
primelens
I hate reading substantial things on any kind of backlit screen. Somehow my
attention seems to wander. But I find that I can focus somewhat better on pdfs
than webpages. I suppose it's some sort of philistinic nostalgia for the
ultimate static and non-interactive medium that is the paper book.

That said, this idea looks awesome. I'd still appreciate a pdf to supplement
this, though :).

~~~
tome
Why should it be mere nostalgia? The typesetting on PDFs is typically far
higher quality than on web pages.

------
josephagoss
A very interesting way of making a book/"store of knowledge".

I really really like this. Can these python interactive books be constructed
to show and run code snippets of different languages?

~~~
takluyver
Yes, with a bit of glue code, you can have 'cell magics' to run code in
another language. This notebook has examples with R code:

[http://nbviewer.ipython.org/urls/raw.github.com/ipython/ipyt...](http://nbviewer.ipython.org/urls/raw.github.com/ipython/ipython/master/examples/notebooks/R%20Magics.ipynb)

There are extensions for Cython, Octave and C too. And there's a generic
mechanism for scripting languages (%%script), but that only captures stdout,
rather than moving objects between different languages.

------
deadlysyntax
I'm on the first chapter, but I can tell this is the perfect book for me. Very
well written. Easy to follow for a non-mathematician and overall, a perfect
introduction to a field I'm very interested in learning. I've worked through
books such Programming Collective Intelligence but this closes the gap between
blindly following along and actually understanding the fundamentals which that
book lacks.

------
csense
The controversy of this survey [1] could have been avoided if the survey
authors had used the coin flip algorithm in Chapter 2. (Navigate to Chapter 2
on Github and Ctrl+F on "Example: Cheating" without quotes. Maybe someone
should submit a pull request to add anchors to the HTML output.)

[1] <https://news.ycombinator.com/item?id=5777578>

------
Void_
Wow the interactive book sounds like a fantastic idea.

I would still like to read text parts on my Nook. How would one go about
converting this to epub?

~~~
nhebb
View each chapter in the browser and save as web page - complete. Then use
Calibre (<http://calibre-ebook.com/>) to convert the html to your ebook format
of choice. It's kind of a pain, but I've done this for my Kindle with a bunch
of web material.

------
radikalus
I've only skimmed very briefly each chapter, but I'm a pretty big fan of PyMC
and am extremely impressed from what I saw regarding its use and how to think
about optimization problems from a Bayesian framework. Chapter 5 and the Dark
World example were particularly interesting.

------
gtt
Good book but I'd like to see more detailed explanation of MCMC inner
workings. I'm very uncomfortable with using mathematical blackboxes I don't
understand. Can anyone suggest a good introductory textbook into MCMC?

~~~
aaronharnly
It has much more than MCMC, but the "Probabilistic Graphical Models" textbook
by Daphne Koller (of Coursera) and Nir Friedman is a thorough introduction to
the subject. It includes a discussion of MCMC that will leave you with a
deeper understanding than the typical shallow treatment.

As an alternative, you can try watching about 90 minutes of lecture starting
here:

<https://class.coursera.org/pgm-003/lecture/71>

but it will drop you right into the fray without much context.

~~~
gtt
Thank you, this looks exactly like the book I need.

------
simgidacav
Weirldy enough, exactly yesterday I started having a look at this[1], which
seems to be very related...

[1] <http://www.greenteapress.com/thinkbayes/>

------
gosub
There should really be a standard interactive-ebook file format (something
like a pdf + ipython, or an open-source CDF). Low power devices could easily
degrade to text only with good tipography.

------
Fomite
I've been following this for awhile, and am very impressed with how the book
is coming together, both from a process and a content standpoint.

~~~
davidcoallier
I couldn't agree more. The content has been relevant from day one and it's
been looking even better ever since. I've passed it in a few lectures already
and people really love it already :-)

