posterior_sign_certainty: Posterior sign certainty probability

View source: R/posterior_sign_certainty.R

posterior_sign_certaintyR Documentation

Posterior sign certainty probability

Description

Computes the posterior probability that a regression coefficient has the same sign as its posterior mean, following the sign-certainty measure used in Sala-i-Martin, Doppelhofer and Miller (2004) and Doppelhofer and Weeks (2009).

Usage

posterior_sign_certainty(pmp_uniform, pmp_random, betas, VAR, DF, Reg_ID)

Arguments

pmp_uniform

Numeric vector of length MS containing posterior model probabilities under a uniform model prior.

pmp_random

Numeric vector of length MS containing posterior model probabilities under a random model prior.

betas

Numeric matrix of dimension MS x (K+1) containing estimated coefficients for each model. Column 1 corresponds to the intercept.

VAR

Numeric matrix of dimension MS x (K+1) containing variances of the coefficient estimates. Must have the same dimensions as betas.

DF

Numeric vector of length MS giving the degrees of freedom associated with each model.

Reg_ID

Numeric or integer matrix of dimension MS x K indicating regressor inclusion. Entry Reg_ID[i, k] = 1 if regressor k is included in model i, and 0 otherwise.

Details

For each coefficient j, define

S_j = \sum_{i=1}^{MS} p(M_i \mid y)\, F_t\!\left( \frac{\beta_{ij}}{\sqrt{\mathrm{VAR}_{ij}}}; \mathrm{DF}_i \right),

where F_t(\cdot;\mathrm{DF}_i) is the CDF of the Student-t distribution with \mathrm{DF}_i degrees of freedom.

The posterior sign certainty probability is then defined as

p(\mathrm{sign}_j \mid y) = \begin{cases} S_j, & \text{if } \mathrm{sign}(E[\beta_j \mid y]) > 0, \\ 1 - S_j, & \text{if } \mathrm{sign}(E[\beta_j \mid y]) < 0, \\ 0.5, & \text{if } E[\beta_j \mid y] = 0. \end{cases}

The intercept is included in all models. For slope coefficients that are excluded from a given model, the contribution to S_j is set to F_t(0)=0.5, reflecting a symmetric distribution centered at zero.

Value

A list with four elements:

PSC_uniform

A (K+1) x 1 numeric matrix containing posterior sign certainty probabilities under the uniform model prior.

PSC_random

A (K+1) x 1 numeric matrix containing posterior sign certainty probabilities under the random model prior.

PostMean_uniform

A (K+1) x 1 numeric matrix of posterior means under the uniform model prior.

PostMean_random

A (K+1) x 1 numeric matrix of posterior means under the random model prior.

References

Sala-i-Martin, X., Doppelhofer, G., and Miller, R. I. (2004). Determinants of long-term growth: A Bayesian averaging of classical estimates. American Economic Review, 94(4), 813–835.

Doppelhofer, G. and Weeks, M. (2009). Jointness of growth determinants. Journal of Applied Econometrics, 24(2), 209–244.


rmsBMA documentation built on March 14, 2026, 5:06 p.m.