I have a JAGS hierarchical model which includes a temporal sub-model for the primary vote share between four party groups (LNP, Labor, Green, and Other). For each day in the temporal model, the vote shares sum to one. The temporal model is an auto-regressive random walk: the vote shares for the four party groups today are much the same as they were yesterday.

#### -- temporal model (a daily walk where today is much like yesterday)
for(day in 2:PERIOD) { # rows
    for (party in 1:PARTIES) { # columns
        tmp[day, party] ~ dnorm(walk[day-1, party], walkPrecision[party])

## -- impose a sum-to-one constraint ... total of all parties sums to one every day
for(day in 1:PERIOD) { # rows
    walk[day, 1:PARTIES] <- tmp[day, 1:PARTIES] / sum(tmp[day, 1:PARTIES ])

## -- constrained priors for the day-to-day variance of the temporal model
for(party in 1:PARTIES) { # for each party
    sigmaWalk[party] ~ dunif(0, 0.005)  ## uniform prior on std. dev.  
    walkPrecision[party] <- pow(sigmaWalk[party], -2)   

## -- uninformative priors for first day in the temporal model
for (party in 1:PARTIES) { # for each party
    tmp[1, party] ~ dunif(0.0001, 0.9999) # fairly uninformative

My question - is there a better way of modelling this than I have above.

  • $\begingroup$ Mark. Welcome to the site. It's been my experience that the best answers here come from very targeted questions. Is there something that you're specifically concerned about with this model? Are there issues in the output or in inference that you're struggling with? The best way to get a good answer is to let the people on the site help you with something specific that you're struggling with. $\endgroup$ – Eric Peterson Apr 25 '13 at 3:40
  • $\begingroup$ I feel that I have kludged the temporal model - I was wondering whether there was a more elegant approach to this problem. I figure auto-regressive mixtures must crop up often. My intuition is that a more elegant solution might use dirichlet and multinominal distributions; or perhaps multivariate normal and wishart distributions. But so far, I have been unable to figure it (or find examples online). $\endgroup$ – Mark Graph Apr 25 '13 at 3:50
  • $\begingroup$ For more context, you can see what I am doing here: marktheballot.blogspot.com.au/2013/04/… $\endgroup$ – Mark Graph Apr 25 '13 at 3:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.