Change prior terms for fixed effects

Welcome to the forum for runmlwin users. Feel free to post your question about runmlwin here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Go to runmlwin: Running MLwiN from within Stata >> http://www.bristol.ac.uk/cmm/software/runmlwin/
Post Reply
yransome
Posts: 12
Joined: Wed Apr 22, 2015 12:07 pm

Change prior terms for fixed effects

Post 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!
ChrisCharlton
Posts: 1351
Joined: Mon Oct 19, 2009 10:34 am

Re: Change prior terms for fixed effects

Post 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 http://www.bristol.ac.uk/cmm/software/r ... /examples/ along with the corresponding text from http://www.bristol.ac.uk/cmm/software/m ... 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.
Post Reply