I have the following problem: I need to assess whether a given parameter $B$ is equal to 0. Let's consider the following model (my problem is more complicated but I think that this example is sufficient):

$$ Y_i \sim N(A \cdot X_i+B,\sigma^2) $$

the observations $Y_i$ being independent conditionally on $A$, $B$, and explanatory variables $(X_i)$. I used a non-informative prior for $A$, $\sigma$ and $B$. Then I estimate the 95% level hpd interval for $p(B|Y)$ and check whether $0$ belongs to this interval.

I have two questions regarding this strategy.

First, is it a correct way to answer the problem? If yes, are there some authoritative references? Perhaps I lack the keywords because I did not find anything. If not, what is a good alternative to my problem?

Second, in practice $B<0$ has no physical meaning (while analytically there is no problem to define the model for $B<0$). However, in practice if I restrict the domain of the prior of $B$ to non-negative values the described strategy becomes not feasible (I guess). Is it a real problem?


2 Answers 2


If you are interested in TESTING B=0, then the standard Bayesian solution (i.e. the most accepted), to that problem is the Bayes Factor (BF). Suppose you want to test model 1 against model 2. Let

$\pi_1(\theta_1|y)= \frac{L(\theta_1)\pi_1(\theta_1)}{p_1(y)}$, $p_1(y)=\int L(\theta_1)\pi_1(\theta_1)d\theta_1$

$\pi_2(\theta_2|y)= \frac{L(\theta_2)\pi_2(\theta_2)}{p_2(y)}$, $p_2(y)=\int L(\theta_2)\pi_2(\theta_2)d\theta_2$

Then the BF of model 1 against model 2 is simply $BF_{12}=p_1(y)/p_2(y)$ and it tells, for instance, how much likely is model 1 with respect to model 2.

BFs automatically penalise for model complexity and are asymptotically related to the BIC information criterion. See Kass and Raftery (1995) https://www.stat.washington.edu/raftery/Research/PDF/kass1995.pdf for more dails on its interpretation.

It does have some problems, though. For instance, it is not well-defined with improper priors. See, for instance, Robert and Marin (2007) http://www.amazon.com/Bayesian-Core-Practical-Computational-Statistics/dp/0387389792.

Of course, not ALL Bayesians are happy with BFs. Some prefer to use the DIC or similar Bayesian information criteria. There are also some proposals for Bayesian testing via HPDs or credible intervals, but in my opinion, this approach is quite limited, and is not yet widely accepted. See, for instance this issue What is the connection between credible regions and Bayesian hypothesis tests?.

  • 2
    $\begingroup$ We are looking for high-quality answers. Could you provide a broader description on what BF's are and why would you consider them a standard approach in here. Btw, some argue that BF's are not the best approach to comparing models (e.g. andrewgelman.com/2009/02/26/why_i_dont_like ) $\endgroup$
    – Tim
    May 18, 2015 at 20:50
  • $\begingroup$ I've revised the answer accordingly. $\endgroup$
    – utobi
    May 18, 2015 at 21:42
  • 1
    $\begingroup$ Now it is better (+1). Just as a comment: using BF enbles us to answer a little bit other question: "does including intercept makes the model 'better'", while the problem described in the question asks rather what is the probability that $B \neq 0$. $\endgroup$
    – Tim
    May 19, 2015 at 5:49
  • $\begingroup$ Thanks @Tim. The question starts with "... I need to assess whether a given parameter B is equal to 0." To me this sounds as a hypothesis testing problem, as confirmed also by the tag "hypothesis-testing". $\endgroup$
    – utobi
    May 19, 2015 at 10:07
  • $\begingroup$ Those are two different readings of the problem and two possible approaches :) $\endgroup$
    – Tim
    May 19, 2015 at 10:25

The model you describe is simple univariate linear regression and what you want to do is to test wether your intercept is greater then zero. You can use MCMC obtaining posterior distribution of such model and then you can check what is the proportion of cases where $B > 0$:

$$ \Pr(B > 0) = \frac{1}N \sum^N_{i=1} \mathbf{1}(B_i) $$


$$ \mathbf{1}(B_i) = \begin{cases} 1 &\text{if } & B_i > 0, \\ 0 &\text{if } & B_i \leq 0. \end{cases} $$

for all $B_i$ values from $i = 1,...,N$ MCMC replications. This gives you posterior probability of $B > 0$. Since $B$ is continuous checking whether it is exactly zero does not make sense. Examples of using such approach could be found in possibly any handbook on Bayesian statistics.

If you restrict the range of $B$'s by choosing some prior that is only positive, then there is no point in checking if there are posterior $B$ values less then zero. In Bayesian approach you choose some priors for your parameters and every prior brings some information in your model ("noninformative" is a misleading term), however in many cases you do not want to use prior to restrict range of your values, but rather you use prior that enables "improbable" values with lower probability (example here). On the other hand, if values of $B$ simply cannot be less then zero, then you can restrict your prior but you should describe this approach and its rationale in your report.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.