Live data from Hacker News

Bayes’ Theorem – What is it and what is it good for?

crucialconsiderations.org

21–30 of 35 posts

Re: Bayes’ Theorem – What is it and what is it good for?

#21
I recently had the need for Bayes Classifier[1] in a couple of projects, so I wrote a service that exposes one through an API. You can set up your prior set and then get predictions against that set.

I haven't gone through the trouble of making it suitable for public consumption yet. Would anyone be interested in consuming such a service?

[1]: https://en.wikipedia.org/wiki/Naive_Bayes_classifier

Re: Bayes’ Theorem – What is it and what is it good for?

#22
post #12

Earlier quoted context omitted.

Judging from the content of lesswrong, I actually think literal math is what many people do recommend, and that's what bothers me.

In some cases you might want to actually do that math, even if you have to guesstimate numbers, since it still will beat your intuition. http://slatestarcodex.com/2013/05/02/if-its-worth-doing-its-... But in general, no one has enough computing power in their heads to go and do explicit bayesian updates on everything all day long. You have to pick your battles, and use the right tools for the task at hand.

That post is like nobody there has ever heard the phrase "don't fall in love with your model".

Quite a lot of LessWrong posts are of the theme "my model gives this counterintuitive result" - the trouble is they go on to "AND THIS IS VERY IMPORTANT AND SIGNIFICANT!!" rather than "hmm, maybe my model needs work."

Re: Bayes’ Theorem – What is it and what is it good for?

#23
> the Standard Model of particle physics explains much, much more than thunderstorms, and its rules could be written down in a few pages of programming code.

As a programmer who doesn't know advanced math, I'd really like to see that code, in literate form.

Re: Bayes’ Theorem – What is it and what is it good for?

#24
post #3

My biggest issue with Bayes' Theorem as a method of making everyday decisions is that it assumes the ability to accurately assess the underlying likelihoods of events taking place, especially on-the-fly. I would even argue that it's actually providing a false sense of precision because the sig figs are oftentimes not correctly represented.

Two points:

1. Bayesian statistics allows use of "uninformative" priors. 2. Discarding your subjective beliefs is less than ideal as well as overweighting them. You have beliefs due to your experience. Weight them lightly but still use them. In the absence of much information your calculations will follow your gut. What else do you have in the absence of other information?

Using quantified subjective beliefs at least has the advantage of enabling you to make consistent choices based on what you know within a rigorously defined framework.

Re: Bayes’ Theorem – What is it and what is it good for?

#25
post #3

My biggest issue with Bayes' Theorem as a method of making everyday decisions is that it assumes the ability to accurately assess the underlying likelihoods of events taking place, especially on-the-fly. I would even argue that it's actually providing a false sense of precision because the sig figs are oftentimes not correctly represented.

that is why you basically don't want to use bayes if you have few samples (or you don't have any but you are preparing to collect them). There are much better models, the first coming to mind is Expectation Maximization, which works with series of inputs. The article per se is so confused at the end I was not sure I was reading about bayes (lol?), so I guess we are all a little puzzled.

Re: Bayes’ Theorem – What is it and what is it good for?

#26
Speaking of Bayes, there's a great book by Allen B. Downey 'Think Bayes' http://www.greenteapress.com/thinkbayes/ available as free PDF or (if you wish to support the author, which I did) a paperback from Amazon.

It teaches Bayes theorem accompanied with Python code examples, which I found really useful.

Re: Bayes’ Theorem – What is it and what is it good for?

#27
Here are a few tangentially related things that may be of interest:

(i) MacKay's book on Information Theory, Inference, and Learning Algorithms: http://www.inference.phy.cam.ac.uk/itila/

(ii) Probability Theory As Extended Logic: http://bayes.wustl.edu/

(iii) Causal Calculus: http://www.michaelnielsen.org/ddi/if-correlation-doesnt-impl...

(iv) I recall reading a pretty good blog post a year or two ago that described how to implement some kind of Bayesian token recognition thing to parse screen captures from some database (or something roughly like that). The gist of the approach was like this:

1. define a model expressing that certain combinations of neighbouring tokens are more likely to occur than others 2. approximate the full Bayesian inference problem as MAP inference 3. the resulting combinatorial optimisation problem could be encoded as a relatively easy mixed integer program 4. easy mixed integer programs are very tractable to commercial solvers such as CPLEX, Gurobi, or sometimes even the open source COIN-OR CBC

At the time I found the idea fascinating as I was working with LPs/MIPs and had some interest in Bayesian inference, but hadn't figured out that the former could provide a way to computationally tackle certain approximations of the latter.

I cannot for the life of me find the link again for this.

Re: Bayes’ Theorem – What is it and what is it good for?

#28
post #13

“Seeing the world through the lens of Bayes’ Theorem is like seeing The Matrix. Nothing is the same after you have seen Bayes.” I'm pretty sure this is an instance of cognitive bias.

Sure. We all have biases. Almost everything I think about in engineering is passed through two filters: bayes, and nonlinear optimization[1]. It's enormously useful, and leads me to a lot of insights that others don't come up with. But it is a bias, and we always have to guard against it leading us down the wrong path.

[1] By this I mean I always ask myself - am I incorporating all information, and in a probabilistic (Bayesian) way. If not, have I analytically proven that I can discard the information (dimensionality reduction). If I haven't proven it, my 'go to' assumption is that information, no matter how noisy, should be incorporated until I can prove analytically or empirically that it isn't needed. In more concrete terms people endlessly hand wave "that isn't important" when I ask a question, but then I go prove it is important. It's a cheap trick in some sense, but it sure does work. Don't throw away information. Likewise, I view everything as a nonlinear estimation/optimization problem. I think in terms of manifolds and surfaces - what are my variables, what can I vary, can I vary them smoothly (is the surface locally smooth and continuous). In concrete terms, maybe you are trying to figure out what features to add to a product. Lots of choices, lots of unknowns. Can I iteratively come to an answer in an agile way, do I have to make some discontinuous jumps, what step size should I use, etc. It's all just 'mathy'. Meaning I don't have analytic equations for these decisions, but thinking about it as if it is is usually very informative.

So I 100% agree with the quote.

Re: Bayes’ Theorem – What is it and what is it good for?

#29
post #3

My biggest issue with Bayes' Theorem as a method of making everyday decisions is that it assumes the ability to accurately assess the underlying likelihoods of events taking place, especially on-the-fly. I would even argue that it's actually providing a false sense of precision because the sig figs are oftentimes not correctly represented.

Two points: 1. Bayesian statistics allows use of "uninformative" priors. 2. Discarding your subjective beliefs is less than ideal as well as overweighting them. You have beliefs due to your experience. Weight them lightly but still use them. In the absence of much information your calculations will follow your gut. What else do you have in the absence of other information ? Using quantified subjective beliefs at leas…

I don't think it's as rigorously defined as it's purported to be. I just envision the practical application of manipulating values to produce desired results, and then post-hoc rationalizing those value manipulations to obtain a higer-than-warranted level of confidence in the result, because, "I applied rigor!"

Re: Bayes’ Theorem – What is it and what is it good for?

#30
post #14

I'm in the middle of designing and building a system which uses Bayesian models. One thing that struck me early is that while Bayes itself is rock solid, like arithmetic, when you go to apply it the results live or die on the quality of the models, and the relevance/realism of the evidence used to train them. GIGO. But once you do have a good, relevant, signal-producing model, then, using it is a bit like doing a mul…

"all models are wrong, but some are useful" - Box. I think the Bayesian approach is a good place to start, and provides a coherent way to think about things. Pragmatically, one might end up needing to introduce a few approximations into the model, to make it computationally tractable, for example, but it is good to be able to view this in the context of what the gold-plated theoretical modelling approach would be. In…

You can also augment the state to take this into account.

I have a model that says my system does F with Q amount of uncertainty, and my measurements are Z with R uncertainty. But I have to give precise numbers for R, when it is just an imprecise model or SWAG. I can add to my state a parameter for how precise R is, and let the filter estimate it over time. Not always, and it is noisy, but it can be done.

There are other approaches - use a filter bank, each with a different set of assumptions. Run 'em all, and either pick one or blend them, depending on your scenario. 'Depending' being the topic of many a PhD thesis, but again, very doable in practice for many problems.

Post reply on HN