This post is by Yuling, not Andrew.
We have been talking about how Bayesian inference can be flawed. Particularly, we have argued that discrete model comparison and model averaging using marginal likelihood can often go wrong, unless you have a strong assumption on the model being correct, except models are never correct. The contrast between “discrete Bayesian model comparison kinda does not work” and “Bayesian inference is the only coherent inference paradigm” bothers me. Indeed, similar counterexamples that trick discrete Bayesian model comparison can also trick discrete/continuous Bayesian inference.
Consider a toy example. We are making inferences on the location parameter in a normal model y~ normal (mu, 1) with one observation y=0. We have a restricted parameter space that only contains four points: mu belongs to {-1, 0, 1, 3}. We pose a uniform prior on mu. The inference on mu is ok: the posterior probabilities of these four points are (.27, .45, .27, .005). It is not perfect but we can interpret it as a discrete approximation to the more desired posterior in the continuous model. So far so good.
But now I want to compromise my inference. So I expand the parameter space: mu belongs to {-1, 0, 1, 3.0000, 3.0001, 3.0002, … 3.1000}; some 1000 points are inserted between 3 and 3.1. Now I still use a flat prior and make the inference. The inference is “wrong”: the posterior of mu is concentrated at 3. Indeed, the Bayesian estimate is much worse than the MLE, mu=0.
You may say it is the fault of the non-informative prior. But a naive informative prior, such as target += normal_lpdf (mu | 0, 1) still does not solve the problem. The prior needs to adjust for both the height and the volume, or what Mackay would call the Occam factor.
You may say it is the fault of the discrete parameter space, and we cannot fit this discrete model in Stan anyway. But no, similar problems can exist in continuous models. Consider the model y=0 ~ norma (mu, sigma) with a slightly constrained parameter space: |mu|<10, sigma < |mu|+1, and a flat prior on this constrained parameter space. Then the posterior inference of mu peaks at 10 or -10, which is again worse than the MLE, mu=0. Further, when changing sigma < |mu|+1 to sigma < |mu|^2+1, or to sigma < exp(|mu|)+1, the posterior will change greatly even though all priors amount to some effectively flat prior around the parameter values that we care about. Adding an extra informative prior regularization target += normal_lpdf (mu | 0, 1) solves part of the problem, but the bias from this artificially designed parameter space still carries.
The point is that the parameter space and its measure are silent subjective decisions designed by the modeler. We typically work with the counting measure on discrete space or the euclidean space with the boreal measure by default, but such assumption is context-dependent, and may be potentially falsified in a larger workflow—The Bayes rule won’t do it for you automatically.
P.S. These two examples are both artificial and is easy to fix. But the general pattern can exist in more practical examples. As Andrew pointed out in the comment, we can model the degree of freedom in a student-t likelihood as a parameter, or we may reparameterize the model into (nu, sigma*nu/(nu-2)) such that the df becomes a transformed parameter. Similarly, when modeling covariance matrix, we can model each element of the covariance matrix, model the matrix square root of it, the correlation times the diagonal, the matrix square root of the correlation times the diagonal, or the Cholesky decomposition of the correlation… Reparameterization changes the default prior and changes the “distance” between parameter values—But there are always other potential parameterizations even if we do not perform them.
Andrew pointed out two future directions. One is that we can rescue discrete model companions by designing better priors on models: to place smaller priors on similar models. I think the “dilution prior” has done that. It is related to “understanding prior in the likelihood”, and also related to the Jefferys prior that keeps the reparameterization invariant, although the latter is not always desired on other occasions.
I should also make it clear that the examples I have here can be categorized into “model misspecification”. Well, they are correct models in the classical sense: one parameter is the true value, such that with infinitely many data, everything works fine. But these models are also clearly poorly designed and a standard posterior predictive check (PPC) will manifest the poor fit.
The inference is “wrong”: the posterior of mu is concentrated at 3.
You are assuming the data is categorical but using numbers for the labels. There is no concentration around 3, because 3 is just as different from 0 as it is 3.0001. Imagine 0 = pillow, 1 = blanket, 3 = bowl, 3.0001 = towel, etc.
Anon: By “concentrated” I mean the posterior predictive distribution is concentrated near p( y | mu=3 ): mu lives on a subset of a continuous real line after all.
I see. Then you have 1003 categories, with 1000 of them corresponding to mu ~3. If you assume every category is equally likely, then you should a priori expect your observed sample of y will be ~3. You assumed there is 99.7% chance y comes from a distribution with a mean of ~3.
I don’t see this as a problem.
Yes, Bayesian inference is always logically coherent conditional on the assumed probability model.
The other aspect is why are you trying to use one observation to distinguish between 1000 categories with means between 3-3.1 and sd = 1?
You would usually find some other kind of data to distinguish between them.
Typically we are fitting models with continuous parameters. If it is ok to use a few data points to distinguish infinitely many “categories” (if you fit a normal model), or even infinitely many dimensions of “categories” (if you fit a gaussian process), then only considering 1000 categories is remarkably humble.
But you are assigning the categories in your model. That is an assumption you are making.
Like I said below, you need to distinguish between using an algorithm for its predictive skill vs for parameter estimation. The latter requires your assumptions are meaningful, the former does not.
To agree (and pile on)…
Why are we looking at the posterior or sampling here anyway? You (OP) proposes a prior that says mu is almost certainly near three. Are you happy with that or not? Adding the extra context that you have a single observation, and the posterior remains oncentrated near three, and *now* you are unhappy – this is just adding absolutely irrelevant and distracting fuzz to the question. If there’s a correct objection here, it can better be made against the prior without adding a complete irrelevancy.
The claim(s) that the posterior is “worse than MLE” is subjective, at best, to be honest seem entirely unfounded and unjustifable.
bxg, the posterior prediction y~normal (mu=0,1) fits the data y=0 better than y~normal (mu=3, 1) in almost all goodness-of-fit metric I can think of.
Then shouldn’t you consider be considering a procedure who’s actual sole purpose is to ‘fit the data’?
But back to my main complaint: even your ‘uninformative’ prior says something strong (it says basically the same thing, in fact). If you don’t like it, address you concerns here – not pointlessly overcomplicate the story.
You should be saying “look how ridiculous Baysianism is – even with a supposedly uninformative prior, and with no data at all presented, it still thinks it knows something rather than saying ‘ ERROR NO DATA FOUND’ like any sensible data-fitting procedure should. How silly!”
bxg: quote from our previous paper: “[the hole in Bayes] does not mean that we think Bayesian inference is a bad idea, but it does mean that there is a tension between Bayesian logic and Bayesian workflow which we believe can only be resolved by considering Bayesian logic as a tool, a way of revealing inevitable misfits and incoherences in our model assumptions, rather than as an end in itself.”
While this sentence alone raises all sorts of red flags with me, I’d like to be honest with myself and read that paper. But – maybe I’m blind – I just don’t see a link to any previous paper. (I don’t even know who ‘our’) is. Forgive me if I’m being stupid and it’s super clear somewhere in your comment, but otherwise could you provide a specific reference?
I will, though, reiterate my actual question: whatever problems you have with Bayesianism (and goodness knows there is enough disagreement there, so what could I possible add?) do you really think the whole ‘and now we condition on one sample point, and critique the posterior’ thing adds any material to your underlying objection?
Is there a reason why can’t you make your complaint clear just by thinking about the prior alone? It sounds like you do have such a reason (otherwise, why bring goodness-of-fit into it) but I’d like to understand this more. It just can’t be “and it’s convinced mu is near 3” since this complaint is equally applicable to the prior. Maybe if I read the paper it will help.
He’s talking about “Holes in Bayesian Statistics”, co-authored with Andrew. There was a dicussion about it here last year.
You’ll find lots of red flags there. Starting with the first “hole”: “the usual rules of conditional probability fail in the quantum realm” – a claim of dubious validity and relevance.
It’s kind of funny that it was published in Journal of Physics G: Nuclear and Particle Physics. The explanation seems to be a related presentation in a physics conference.
Carlos:
I recognize that many knowledgeable people disagree with our statement that the usual rules of conditional probability fail in the quantum realm—but I think our statement is correct, and that attempts to make the usual rules of conditional probability work in the quantum realm are very tortured.
As to our paper being published in a physics journal: I don’t see why you think this is “kind of funny.” Lots of physicists are interested in Bayesian statistics, and physics is also a field which has a bunch of Bayesian absolutists: these are people who can benefit from learning about the holes in this theory.
It’s reassuring to know that you think that what you publish is correct!
I think that you’re correct in the paragraph that says that the problem is created by doing physically inappropriate things and that if things are done properly the result is not surprising either probabilistically or physically. Other passages make little sense to me.
Sure, physicists are interested in statistical methods. But this paper is not particularly related to the field – it could have been published in a nutrition journal just the same. I just found it somewhat amusing that it appeared in a physics journal.
The interesting bit is at the end
In the same way that taking measurements in quantum systems noninteracting elements of reality can be wrong, taking distinct survey questions as measurements of noninteracting mental state can be wrong.
ex: With the flavor of psychological “priming” (contentious, i know), taking question set A to measure “Conscientiousness’ and question set B to measure “Analytical-orientation” can lead to inferring an incorrect joint distribution if the act of answering set A first affects subsequent answers to set B. This is, like the motivating example at the top of this page, a modeling problem rather than an issue with Kolmogorov or de Finetti or whatever, but it’s not uninteresting or irrelevant to bayesian modeling because assumptions like this are a common workflow.
Thank you very much Carlos for providing the actual reference. Wow. Having read it, I have nothing non-obvious or not already well-addressed that would constructive to say.
Tough crowd here!
Andrew, I thought I have mostly been consistently asking a fairly simple question, asked in good faith. And that, to reiterate, is: does Yuling believe his new ‘example’ has anything to do with updating on a single sample point, or is it a critique of the prior? On the face of it, it sure sounds like a problem better faced by looking at the prior (and so the whole thing about updating on one data point being a pointlessly overcomplicating irrelevancy). But then ‘goodness of fit’ enters the picture, so I must be wrong – apparently the sampling and the updating IS important to the complaint. But I struggle to get a handle on this. This definitely means I very very much do not understand the complaint after all, and would like pointers/hints.
It seems like a reasonable and not too cryptic question to ask.
IDK, it feels like a flat / discrete uniform prior over {-1, 0, 1, 3.0000, 3.0001, 3.0002, … 3.1000} is *very* informative in concentrating probability in [3,3.1], which holds >99.5% of the mass, which a single observation is understandably not able to overwhelm.
A ‘weakly informative’ normal(0,1) prior on mu may not solve the problem, but the problem here seems to me a lack of information in a single observation — the posterior on mu does get squeezed inward from sd = 1 -> sd = 0.7. And that uncertainty is desirable, e.g. if the true mean of the distribution that emitted our observation of 0 isn’t actually 0, but rather e.g. -2? Seems like Bayes having lots of posterior variance is desirable, as the MLE of mu at 0 would be rather off that mark.
Trying to fit the model with a prior on sigma as uniform(0, |mu|+1) & related also seems to still concentrate posterior probability around 0 for me, though I can see why large values are not penalized as much: if our prior belief is that they’re associated with super-high dispersion, observing values far from the mean is not very surprising. Though maybe I misunderstood the model?:
data {
real y;
}
parameters {
real mu;
real sigma;
}
model {
mu ~ uniform(-10,10);
sigma ~ uniform(0, abs(mu) + 1);
y ~ normal(mu, sigma);
}
I do quite agree with the overall thrust of the piece — model-based inference is conditional on the model(s), whether we’re updating model priors via marginal likelihoods, or using a discrete approximation to some parameter space.
Agreed that the fault here is the **informative** prior that says 99+% probability that the answer is between 3 and 3.1.
> The inference is “wrong”: the posterior of mu is concentrated at 3. Indeed, the Bayesian estimate is much worse than the MLE, mu=0.
Is it? We were not told what the true value is, unless I missed something… And if happens to be distributed according to that prior – with 99.7% probability of being in [3 3.1] – the Bayesian estimate is very likely to be much better!
> You may say it is the fault of the non-informative prior.
I wonder how many people may say that.
> Further, when changing sigma < |mu|+1 to sigma < |mu|^2+1, or to sigma < exp(|mu|)+1, the posterior will change greatly even though all priors amount to some effectively flat prior around the parameter values that we care about.
The marginal prior for mu is far from flat in the first case and gets less and less flat with those changes.
Carlos: I only have one data here so I guess it is hard to define goodness-of-fit. But similar examples can be constructed by have many data points generated near 0, while more and more silly parameters are inserted near mu=3, such that clearly the posterior prediction around mu=3 is worse than the MLE mu=0.
Inference is more than data fitting. Even if you use Bayesian models just as a regularization device the point is precisely to avoid fitting too well.
I agree that using “meaningless” regularization parameters doesn’t mean that you don’t need to pay attention at what you are doing. But if you find that the regularization that you are doing is silly that doesn’t necessarily show a flaw in Bayesian inference.
Yuling:
It’s funny. I thought we’d mentioned this issue in our Holes paper, but I couldn’t find it there! I agree that there is an unpleasant incoherence in the way that we usually dislike Bayesian model averaging—except when we do Bayesian inference with multiple parameters, in which case it often works just fine.
One way to understand this contradiction in our philosophy is to do what you do in the above post, which is to think more carefully about discrete Bayesian model averaging and what exactly it is doing. From the other direction, we can understand by thinking more carefully about Bayesian inference with multiple continuous parameters, where a key step is the joint prior distribution. Indeed, there are examples of badly parameterized models where natural-seeming priors lead to bad posteriors. An example I recall from 1993 or so (when I was writing the first edition of BDA) is expanding from the normal to the t model with unknown degrees of freedom. One issue is the prior on the degrees of freedom parameter, but other problems arise if you parameterize the scale parameter sigma and the degrees of freedom parameter nu as independent in the prior. It works better to parameterize in terms of (nu, sigma*nu/(nu-2)).
Anyway, my point is that we can go in two directions. From one direction, we can say that Bayes for continuous parameters is good, so Bayes for discrete parameters should be good too, as long as we don’t screw up the priors. From the other direction, we can say that Bayes for discrete parameters can be terrible, so Bayes for continuous parameters could be terrible too, except in special cases where the priors have some good properties. (The prior can often only be understood etc.)
Right now I’m not really sure what to think. I can talk myself into thinking that Bayesian inference is a horrible idea. But it works in lots of real-world problems . . .
You left out one more direction: put more effort into understanding how to turn prior knowledge into appropriate sample spaces and prior distributions that actually reflect that prior knowledge. For example, in your example of the dof paremeter nu for a Student’s t model, nu has no meaning of its own other than to describe the shape of the distribution — it does not correspond to any distinct entity in the ontology of the model. The only way I see to construct a reasonable prior in such a case is to think in terms of the observable consequences. (As someone once said :->, “The prior can often only be understood in the context of the likelihood.”) Once you start doing that, it’s obvious that a flat prior is inappropriate, since large values of nu are observationally indistinguishable. For a decade-old example of this kind of thinking applied in a model-specific fashion to the parameters of a Beta distribution, see https://bayesiancomputation.wordpress.com/2010/06/26/the-likelihood-that-wouldnt-die/ .
On a similar note, I don’t find Yuling’s examples persuasive because they are all highly informative; it’s not surprising that when you combine a highly informative prior with one data point the likelihood doesn’t carry much weight in the result. Furthermore, no motivation is given for any of these priors. No mention of why or under what circumstances one might (perhaps incorrectly) consider any of these priors reasonable.
That’s not to say that more persuasive examples can’t be found. But I don’t think you can have a productive discussion on this issue without those better examples to work with, where there is at least some apparently reasonable argument in favor of the pathological prior.
Kevin:
I agree that an appropriate designed prior can avoid many problems. But some small cracks can still exist in the “understanding prior in the likelihood” mansion. I have used this example before: when modeling a time varying covariance matrix, it appears reasonable to place a gaussian drift on it. That is target += sum((cov[t]-cov[t-1])^2). But it is not a generative model at all so you cannot understand the prior in the likelihood. Besides, I don’t think it is easy to encode such prior regularization using any pseudo observations.
Re placing a guassian drift on a covariate matrix via “target += sum((cov[t]-cov[t-1])^2)”: I would have expected “target += -sum(lambda * (cov[t] – cov[t-1])^2)” instead. Do you mean
1) lambda is intentionally left out, effectively lambda = 1; or
2) lambda unintentionally left out, and it is treated as data (known value, not inferred); or
3) lambda unintentionally left out, and it is a model parameter that is inferred?
(I assume the missing minus sign is just a typo.)
For 1) and 2) you have a sort of constrained multivariate Gaussian distribution for cov[t] given cov[t-1], and it’s not at all clear what its mean is. I myself would not use such a distribution without understanding more about its properties.
Case 3) is problematic. Either you have to include the normalizing constant Z(lambda), which could be very difficult to compute, or you’ve effectively multiplied the prior on lambda by a factor of Z(lambda) — and who knows what the resulting prior looks like. I would not consider this a legitimate option.
This case boils down to, not a problem with Bayesian inference, but with a lack of well-understood and tractable distributions that can be understood as a random-walk step for covariance matrices, which are subject to the constraint of positive-definiteness.
Andrew, I hadn’t ever heard of parameterization of a Student-t in terms of (nu, sigma*nu/(nu-2)), but it piqued my interest because I’ve always had trouble estimating the degrees of freedom parameter. Is there a reference you can point me to on that parameterization or at least some intuition for why and how it’s better than the naive parameterization in terms of just (nu, sigma)?
Arya:
I’m not sure where I wrote this up. I thought it was in the BDA book, but I just looked and couldn’t find it there. The parameterization comes from the fact that the variance of the t distribution is sigma^2*nu/(nu-2). I guess I forgot the squaring of sigma when mentioning the transformation above.
I’m more or less in agreement with the other commenters who have pointed out that the prior that puts almost all of the probability in a small range around 3.0 shouldn’t really be called uninformative.
To me, there’s a better example of a problem with trying to make a weak prior or a non-informative prior. Suppose I have some parameter x that I know nearly nothing about…maybe some physiological thing, really could be just about anywhere between 0 and 1 as far as I know. So I give it a uniform prior between 0 and 1. But it turns out that this parameter’s importance in the real world goes like x^4. My supposedly uninformative prior on x is quite a strong prior on x^4: almost all of the probability is below 0.2.
Of course, I could give a flat prior on x^4 instead, but that corresponds to a pretty strong prior on x.
It would be nice to be able to say “I don’t know anything about x or about x^4” but that turns out to be mathematically impossible! You can be completely ignorant about one or the other, but not about both!
Phil,
It reminds me that some physical parameters are on a continuous support and yet only takes discrete values (with a potentially non-constant gap): energy level of electrons, Raman spectroscopy, angular momentum of electrons, radius of electrons orbit, etc. In those cases, my toy example becomes practical difficulty.
IMO the solution is to stop using this grossly misleading term “non-informative” or “weakly informative” for a prior.
Every probability distribution is highly informative. It tells you precisely the probability of every event in the domain. Even in the improper case, it tells you the relative probability of any two events.
This “non-informative” terminology has misled generations of scientists (and possibly mathematicians too) who expect it to be reasonably congruent to normal English language usage. It is not. Please stop using it.
It doesn’t seem very congruent to normal English language usage to say that every probability distribution is equally informative.
I think that most people – including scientists and mathematicians – would find that being told that the next card in the deck is more likely than not to be an ace is more informative than being told that every card is equally likely to come up.
“the next card in the deck is more likely than not to be an ace” tells me something about the next card
“every card is equally likely to come up” tells me something about the whole deck
I think you’re not considering the amount of information, but its value in a certain situation?
The second case meant “the next card in the deck is equally likely to be any of the cards of the deck”.
Both statments are about the next card. The former is more informative that the latter. (Which arguably carries no additional information if I didn’t have any reason to think that some of the cards in the deck were more likely than others to be the next one to start with.)
With your second statement, any other statement like “the last card of the deck is more likely to be a jack” becomes impossible because that would imply that the next card is less likely to be a jack.
If the process of shuffling the deck is such that the dealer has the ability to control one or more cards to specific spots in the deck, the second statement tells me that this has not happened anywhere in the deck.
I’ve thought about how to apply Shannon to this and find a way to measure informativeness in bit, but couldn’t get anywhere.
“With your second statement, any other statement like “the last card of the deck is more likely to be a jack” becomes impossible because that would imply that the next card is less likely to be a jack.”
If you don’t know anything about the order of the cards in the deck, the maximum entropy distribution subject to that (non-existent) constraints for the card at the top (which is one specific card even if you don’t know which one) is 1/52 for each possible card.
If you know for sure that the bottom card is a jack (and that’s the only thing that you know) the maximum entropy distribution for the top card subject to that constraint is different: 1/68 for each of the jacks, 1/51 for the other cards (hopefully, I’ve not thought it through).
I didn’t say anything about “equally informative”, but the idea that there is a probability distribution that contains no information whatsoever is nonsense. In the discrete case there is a decent argument for one distribution being minimally informative, but it still tells you something very specific – that each discrete event has equal probability.
You said that “every probability distribution is highly informative”.
What would that mean? The information content is high relative to what? Do you have a definition at all?
Now you say that some distributions may be “minimally informative”. Are those “minimally informative” distributions “highly informative”?
I don’t think that calling them “minimally informative” or “uninformative” does change substantially the concept of “distribution that reflects the maximum ignorance / minimum knowledge that you could have”.
I simply mean that saying “X has probability 25%” is not the same thing as saying “I know nothing about the probability of X”. The point is that the mathematical definition of information that you are using simply isn’t adequate to fully convey the normal English language meaning of the term. The prior is a state of knowledge, even when the entropy is maximised.
What is the definiton of information that *you* are using?
What would you say that the normal English language meaning of “knowing nothing” is?
If you don’t know anyting about the next card in a full deck won’t you assign the probability 1/52 to each card?
The situation would be more complex if we were talking about frequencies but that’s a different thing.
Two people may expect the probability of a coin flip showing heads to be 50% but it could correspond to different kinds of information.
One may know that the coin has two equal sides, but ignore if it’s two heads or two tails.
If it’s heads on the next flip, it will be forever heads. But ex-ante the probability of getting heads on any flip is 50% (they are perfectly all correlated though).
The other may know that it’s a fair coin. The probability of getting heads on any flip is 50% and they are all independent.
If they used a binomial model for the coin flips the former would have a prior probability for theta which is equally distributed on the two extremes theta=0 and theta=1. The latter would have a prior concentrated at theta=0.5. Many other priors, and models, can of course be considered.
In your coin examples, the 50% probability describes either the (fair) coin itself, or it describes a person’s knowledge about the coin. They are not the same, but it looks to me that they’re often treated as if they were the same.
In a situation where you bet against an unknown adversary, your knowledge that the coin is fair means that a 50% bet on the outcome of a flip will be a fair bet. But your probability is 50% based on your ignorance, I feel you’d be more likely to lose that bet, because your adversary might know more than you do.
The same applies to the card deck: knowing nothing about the next card is, well, uninformative, but knowing it’s equally likely means something you can bet on.
Are you modelling the observer, or the observed process?
“The same applies to the card deck: knowing nothing about the next card is, well, uninformative, but knowing it’s equally likely means something you can bet on.”
What does that even mean? There is already one specific – but unknown – card at the top of deck. The next card is going to be that card with 100% probability.
For the yet-to-be-flipped coin the situation is different – leaving aside the question of wheter coin flips can be truly random or are deterministic. I discussed that in my previous comment.
But the original discussion was about the informativeness of priors distributions for parameters which is more similar to the question about the well-defined but unknown card at the top of the deck.
Wait, James, we need to distinguish between “information about the real world value of the parameter” and “information about the probability assigned to the various possible real world values of the parameter”.
It’s the case that any probability distribution provides **exact** information about how much probability is assigned to each possible subset of the parameter space.
But it’s not the case that each probability distribution tells us the same thing about the value of the parameter. Uniform(0,1) and truncated(Normal(0.5,0.5),0,1) both provide precise information about probabilities. But one says all values in 0,1 are equally likely, the other says values towards 0.5 are more likely than values away.
Not likely mathematicians and the solution – as ever – is to provide unambiguous definitions of terms, as they do. And anyway, unlike with e.g. this, I would’ve thought the uniformity of terms and definitions used in probability and information theory would mean few if any scientists could be misled by “non-informative”, “weakly informative” etc.
There is a numerical measure of how (non-)informative a distribution is: its entropy. And, for a discrete distribution, the entropy is maximized by assigning equal probability to all the possibilities. So it’s very reasonable to call that a non-informative distribution.
The difficulty, as always, is the continuous case. It’s hard because you have to define the underlying measure you’re using in order to properly define the entropy, and it’s not always obvious what that should be. If you think of the continuous distribution as the limit of a series of increasingly refined discrete distributions, then the “flat” measure you get depends on the specific limiting process used.
No! Call it minimally informative if you must, but it still contains important information!
One way to put this is in terms of being able to provide a not too misleading representation (prior and data generating model) of how the parameter values were “set” and the data you observed ended up in your possession (probabilistically). Anything other than that, the operating performance is just what it is – possibly adequate for some purposes but illogical.
Also, more general but likely relevant comment from Frank Ramsey https://youtu.be/fzdCKC829R4?t=1076
> illogical.
That was too strong a word – unprincipled would be better.
These strike me as good examples of the difference between Bayesian “principle” and Bayesian “practice”. As other commenters point out, the Bayesian engine churns away as per the operating manual, the goofy inferences are the result of how priors were set. While the “solution” seems apparent in the 3.0001, 3.0002, etc. example, the other example with constrained parameters is more subtle. It is also something very reasonable to see in practice and illustrates the difficulties involved in deriving the consequences of multivariate priors.
I think this is important because while the commentariat here is well-informed (pun intended) regarding the importance of priors in getting reasonable inferences out of Bayes, in practice the vast majority of people interacting with Bayesian methods will either adopt default priors (of the kind that get you in trouble in the 3.001, etc. example) or set priors on a multivariate parameter space that they lack either the means or awareness to explore (the second example).
Examples like these are important for illustrating the problems that come from setting priors thoughtlessly. Similarly, “everybody” “knows” that you shouldn’t use off-the-shelf NHST methods without verifying their assumptions first (independence, homogeneous variance, random assignment, etc.) but in practice no assumption is every satisfied so how far off can you be before you get in trouble? How much faith can you put in a default or unexplored prior? Examples are indispensable for illustrating these issues.
+1
There are always going to be different conclusions you can draw from the same observations. The key is to then find a way to distinguish between them: https://en.wikipedia.org/wiki/Experimentum_crucis
This can happen with differences of opinion about both prior and likelihood. Of course, with enough data the prior becomes irrelevant.
Isn’t the problem here that you’re starting with a finite parameter space in the modeling, then implicitly invoking a metric space over the reals in the model evaluation? The inference is “wrong” because 3 is far away from 0, but in if you apply the same principles used in modeling, then 3 isn’t very far away from zero–nothing is necessarily far away from anything and you can’t treat these as real numbers.
If you’re evaluating by a metric on the reals, then you’d have to consider the discrete parameterization as an approximation to the reals. Then, starting with a noninformative prior over the reals f(x), you can transform it to a prior over the discrete space like
Pr(x=0) = \int_{-\infty}^{2.95} f(x) dx
Pr(x=3) = \int_{2.95}^{3.05} f(x) dx
Pr(x=3.1)= \int_{3.05}^{3.15} f(x) dx
and so on. If, for some reason, the discrete model is easier to fit
“If you’re evaluating by a metric on the reals, then you’d have to consider the discrete parameterization as an approximation to the reals. ”
No, all we need is a measurable space. The measure can be induced by a metric, but not always.
real line is a space.
real line with euclidean distance is a metric space.
real line with Borel set is a measurable space.
real line with power set is another measurable space.
Also, think about mu = energy level of an atom. It is naturally discrete so I should not integrate over it on real line.
Right, but without a metric, why do you say the posterior inference is very wrong, and worse than the MLE? Without a metric, “\hat{x} = 3.3, x = 3.0” is no more wrong than “\hat{x} = 0, x = 3.0”.
In the energy level of an atom case, I wouldn’t be able to say that states closer in energy are necessarily better inferences. As far as I can recall, in equilibrium statistical mechanics, no structure is assumed about microconfigurations, only an equal weight/maximal entropy assumption paired with ergodicity. And in mechanics, the energy difference only defines the oscillation frequency of transition probabilities.
Let me try putting this another way. In the actual posterior inferences, every value of the parameter space has only a little probability, but mu = 0 has the most probability. I’m making these numbers up, but it’d be something like
Pr(mu = -0.1) = 0.0001
Pr(mu = 0.0) = 0.001
Pr(mu = 0.1) = 0.0001
Pr(mu = 3.0) = 0.00005
Pr(mu = 3.001) = 0.00004
Pr(mu = 3.002) = 0.00003
…
So the MAP (which I think can be meaningful in discrete situations, and invariant since we don’t need a jacobian adjustment) corresponds with the MLE, as we expect from a non-informative prior. The problem only appears when one integrates over the values between 3.0 and 3.1, but why is that particular grouping of parameters meaningful? One can just as easily integrate over {0} + {mu in [3.0, 3.1]} and then almost all the probability mass is in the “correct” set. The choice of set is because of a metric structure that we’ve assumed away when defining our measure in the model.
I’m not sure of the how the energy levels of an atom provide a relevant example in this discussion. But I also found it ironic given that Boltzmann’s distribution can be calculated for a system in equilibrium with a heat bath assumming that all the states of the reservoir are equally likely.
I’ve noticed before that putting parameter values in the parameter space that you haven’t actually observed can get you in trouble with LaPlace’s rule of succession. Isn’t this similar?
Stepping back from this artificial example a bit, the bigger point Yuling is making is that Bayesian inference is only sound if the model is correct. I agree this is an important point that’s not stressed enough in introductory material. You hear Box quoted all the time, usually without explaining how Bayesian inference fails with the wrong model or how one might evaluate the utility of a model.
I came from a speech recognition background, where exact inference was intractable. Every time you built an application and it had a problem, you could change the acoustic model, the language model, or some heuristic embedded in the inference algorithm. I found it to be too many degrees of freedom for me to ever feel comfortable in that world.
I like the “full” Bayesian perspective in part because it fixes the inference algorithm and concentrates the fiddling on the model. Whenever Andrew mentions “approximate Bayes”, I get that same feeling of vertigo I had building speech recogntion apps with no solid ground under me.
I think the commentators are correct here that the problem is in the model because Yuling doesn’t like the estimate near 3 despite putting almost all the prior mass near there. I don’t understand how we could build an inference algorithm to do better with one data point. If it got the answer of 0 in this case, then it does the wrong thing when we do believe the model.
Our models may not ever be correct, but they can be better or worse for a given application. That’s the whole point of the Bayesian workflow—figuring out how to diagnose problems with models so you can build better ones.
I would even add this example has limited relation to Bayesian inference. A model is a model, regardless whether we are talking about prior or likelihood. An exercise I give to my students is to generate synthetic data of a non-linear relationship with very little noise, fit a linear model, and see what confidence intervals tell us:
> n x y summary(lm(y ~ x))
(The result? We are very, very sure that E[Y | x] = 2x up to a standard error of 0.002 on the coefficient.)
I think part of the problem is that, while it’s useful to think of generative models when thinking about what reality constraints to add, so that our analysis is more than descriptive, perhaps we should think of statistical inference being always the solution to an optimisation problem where randomness comes from the input (be it data randomness or your favourite interpretation of a prior distribution).
So, the confidence in “2x” above, or the Bayesian credence on “3” in Yuling’s example, it’s not confidence about a model, it’s confidence about the projection operation that defines an optimisation problem. It’s confidence that (say) if we were to get a different sample of size 100000 to feed to our least-squares projection problem, this least-squares projection problem would give nearly the same solution. This alone wouldn’t warrant belief that the result is the same as E[Y | x]. Interpretations of Bayesian misspecification results as finding best KL projections go in a similar direction.
Being very sure about what we get from these measures of confidence/credibility is being very sure about the stability of such projections, be them frequentist or Bayesian. We can criticize a Bayesian workflow for making more assumptions than some other non-Bayesian approach, but claiming that overconfidence is a Bayesian phenomenon just seems downright wrong. No tight confidence intervals can spare us from the duty of model checking either.
Ugh, the code in the example above was all mangled. Showing my ignorance of formatting here, I’ll just say that it was “n <- 100000; x <- 1 + rnorm(n); y <- x^2 + rnorm(n) / 100; summary(lm(y ~ x))"…
Yuling: Stan can fit models like these with finite discrete parameters with categorical priors. We just marginalize out the discrete parameter and do inference in expectation. For examples and an explanation of why marginalization helps with inference, see the Stan User’s Guide chapter on latent discrete parameters.
Hmm, I am not sure. The model is too simple and has a closed form expression. By ‘cannot fit in Stan’ I mean it is “too simple to fit in Stan”—another counterexample for Stan!
“Marginalize out” trick means we infer a simplex weight that represents the posterior weight of the mixture distribution:
transformed data{
real y=0.0;
real mu[4]=(-1, 0,1,3);
}
parameters{
simplex[k] p ;
}
model {
target += log-sum-exp( log(p)+ normal_lpdf (y | mu, 1)) ;
}
It actually solves the problem: the posterior prediction will concentrate at normal(0,1) even if I insert many irrelevant points in the parameter space. But we have changed it into a mixture model, which is related to stacking.
The naive model I am fitting reads:
transformed data{
real y=0.0;
real mu[4]=(-1, 0,1,3);
}
model {}
generated quantities {
real p[4];
p=exp(normal_lpdf (y | mu[k], 1 ) );
p=p/sum(p);
}
This distinction is the general point I am making here: BMA is bad if you have bad models, while stacking or mixture model is kinda immune to bad yet smilier models. Likewise, Bayesian parameter inference is bad you have bad priors/parameter space, but a stacking-type parameter inference is immune to prior specification. I did not make this proposal explicit in the post because I don’t want people to think that the example is an edge case designed for one method.
I think I see now.
Stacking is good for prediction, but not parameter estimation. The same is true for even the simplest linear model. The parameters don’t mean anything unless the model is deduced from some meaningful premises. That is what gives the parameters meaning.
Great example!
Now imagine the following problem: Alice have cards with numbers {-1, 0, 1, 3.0000, 3.0001, 3.0002, … 3.1000}. Alice draws one card in random, and samples two numbers from the normal distribution using the number on a card as a mean. The first number is 0. Predict the second number.
Suddenly, the answer 3 becomes correct.
Another example of a similar kind, that I had personally encountered and what was breaking my head.
Let N = population size and D = number of detected infection
D << N, very few infections are detected
Let I be the unknown total number of infected
let alpha = unknown infection rate ~ Uniform(0, 1)
let beta = unknown detection rate ~ Uniform(0, 1)
Model is
I ~ Binomial(N, alpha)
D ~ Binomial(I, beta)
You may intuitively assume that in posterior alpha \approx beta \approx sqrt(D / N), but instead you have multimodal posterior with modes alpha=1, beta ~~0 and alpha ~~ 0, beta = 1
This example is interesting! Intuitively the data should not distinguish alpha and beta at all, because data can only provide information on alpha*beta ~ some Beta distribution. Think about alpha*beta = constant, then the two priors means alpha~U(0,1), c/alpha~U(0,1), which implies a marginal density p(alpha) = 1/alpha^2, peaked at 1/c. Likewise, p(beta) will peak at 1/c too.
I’m not sure that I can follow the argument as alpha~U(0,1) and c/alpha~U(0,1) cannot hold simultaneously for any value of c so they cannot really imply any marginal density either.
But it’s true that if we have consider the alpha*beta=c curve embedded in the [0 1]x[0 1] area, with equal probability for segments of the curve with equal length, the marginal probabilities for alpha and beta are a decreasing function in [1/c 1]. It’s a nice way to think about it.
“They cannot hold simultaneously”. But it is fine. In Stan if you write
a~normal (0,1);
a~normal (0,1);
it becomes the same as
a~normal (0, 1/sqrt(2));
Correction: I should have said a decreasing function in [c 1] (c=alpha*beta is a number in [0 1]).
These contradict each other:
“D << N, very few infections are detected"
vs.
alpha ~ Uniform(0, 1)
beta ~ Uniform(0, 1)
which implies a prior mean for D of N/4.
No, the posterior is not multimodal. It is a narrow boomerang-shaped ridge.
infer <- function(n, d) {
grid <- ((1:n)-0.5)/n
alpha <- matrix(grid, nrow=n, ncol=n, byrow=FALSE)
beta <- matrix(grid, nrow=n, ncol=n, byrow=TRUE)
ll <- dbinom(d, n, alpha * beta, log=TRUE)
post <- exp(ll – max(ll))
post <- post / sum(post)
post
}
image(infer(1000, 25))
image(infer(1000, 230))
You are right. The marginals have modes corresponding to the two extremes of the hyperbola as Mikhail said but that doesn’t mean that the joint distribution has two modes.