Page 1 of 1

Change prior terms for fixed effects

Posted: Thu Sep 13, 2018 3:03 pm
by yransome
Hello community,
I'm running a spatial CAR model and wondered it was possible to change the prior term for the fixed effect from the default which is dflat to dnorm (0, 0.0001)? I know there is an option in the syntax to add informative priors, but in this case, I have 13 covariates including the constant and have no substantive values to input using the matrix option. Likewise, for the random part, can we also change from dgamma to dnorm or half normal distribution as recommended by Gelman (2006).

Is there a way to customize the runmlwin syntax for this?
Also, seems when you use priormatrix (matrix), you cannot results and syntax the files to winbugs formats.

My syntax below is
runmlwin club cons c.stdoffprem c.stdonp stdwhol stdgroc stdconv stdblk std18 std35 stdfem stdvac SEP_INDEX i.combinedzi, ///
level3(POLY_ID: cons, carids(mmid1-mmid10) carweights(carweight1-carweight10)) ///
level2(POLY_ID:) ///
level1(POLY_ID:) ///
discrete(distribution(poisson) link(log) offset(logpop)) ///
mcmc(chain(80000) burnin(20000) refresh(500) ) savewinbugs ( ///
model("paper1_model.txt", replace) ///
inits("paper1_inits.txt", replace) ///
data("paper1_data.txt", replace) ///
)) initsprevious nopause irr

Below is piece of the winbugs code the runmlwin produced.

# Priors for fixed effects
for (k in 1:13) { beta[k] ~ dflat() }
carmean ~ dflat()
# Priors for random terms
tau.u3 ~ dgamma(0.001,0.001)
sigma2.u3 <- 1/tau.u3

Thank you all in advance!

Re: Change prior terms for fixed effects

Posted: Thu Sep 13, 2018 3:20 pm
by ChrisCharlton
The fixed-part priors for MLwiN can be specified as either flat or Normal, so it should be possible to change these to what you want via syntax. For an example of this see the MCMC chapter 5 replication materials at ... /examples/ along with the corresponding text from ... nuals.html. The priors for the random part can currently only be specified as Uniform or Gamma (inverse-Wishart in the multivariate case). This means that unfortunately the only way to change these to what you wanted would be to save and then modify the generated BUGS code.

If setting informative priors prevents BUGS code being generated then this is most likely a bug. If can you provide a reproducible example of this I will look into it further.