View source: R/posterior_sign_certainty.R
| posterior_sign_certainty | R Documentation |
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).
posterior_sign_certainty(pmp_uniform, pmp_random, betas, VAR, DF, Reg_ID)
pmp_uniform |
Numeric vector of length |
pmp_random |
Numeric vector of length |
betas |
Numeric matrix of dimension |
VAR |
Numeric matrix of dimension |
DF |
Numeric vector of length |
Reg_ID |
Numeric or integer matrix of dimension |
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.
A list with four elements:
A (K+1) x 1 numeric matrix containing posterior
sign certainty probabilities under the uniform model prior.
A (K+1) x 1 numeric matrix containing posterior
sign certainty probabilities under the random model prior.
A (K+1) x 1 numeric matrix of posterior means
under the uniform model prior.
A (K+1) x 1 numeric matrix of posterior means
under the random model prior.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.