2
votes

I'm building a hierarchical bayesian linear regression model using RJAGS, and I want to constrain the sum of the values of three parameters to be normally distributed with mean 1.3. That is:

The model is:

Y = B1 * X1 + B2 * X2 + B3 * X3 + ... + BN* XN

And,

B1 + B2 + B3 ~ dnorm(1.3, 1/(0.2)^2)

Is it possible to do that? Using a line of code to distribute the sum of parameters as in the previous line doesn't seem to work.

A second best alternative would be to fully constrain the parameters (B1 + B2 + B3 = 1.3), but I don't know how to do it.

Thanks in advance for your help!

Cheers!

1
Is it possible to re-express B2 and B3 in terms of B1? This would make it easier to constrain values, as only B1 would need to be constrained, and perhaps another splitting parameter.colin

1 Answers

2
votes

One approach is by analogy to hierarchical "ANOVA"-style models. In those models, each group mean is a deflection $\beta_j$ from baseline $\beta_0$ and the deflections are forced to sum to zero. The analogy to your case is re-coding the three regression coefficients as sum-to-zero deflections from a baseline coefficient, and having the baseline come from a normal prior with mean of 1.3.

You can see examples of JAGS model specifications for ANOVA in Chapter 19 of Doing Bayesian Data Analysis 2nd Ed. The idea for adapting them here is something like this (I've suppressed the i index):

mu <- sum( b[1:3]*x[1:3] )
# Prior on unconstrained baseline a0 and deflections a[j]:
a0 ~ dnorm( 1.3 , 1/0.2^2 )
for ( j in 1:3 ) { a[j] ~ dnorm(0,1/10^2) }
# Convert a0,a[j] to sum-to-zero b0,b[j]:
for ( j in 1:3 ) { m[j] <- a0 + a[j] }
b0 <- mean( m[1:3] )
for ( j in 1:3 ) { b[j] <- m[j] - b0 }

At least, that's an idea...