hi, I am trying to fit the Bivariate Poisson distribution to a set of sports results to serve as a comparison model to a new model I am developing/developed with my masters thesis.My model is as follow:
model{C<-0for(iin1:nGames){# Min scoreminscore[i]<-min(Score1[i],Score2[i])+1# Generate minscore latent variableu[i]~dunif(0,minscore[i])z3[i]<-trunc(u[i])# Calculate z1 and z1 latent variablesz1[i]<-Score1[i]-z3[i]z2[i]<-Score2[i]-z3[i]Zeros[i]~dpois(zeros.mean[i])zeros.mean[i]<--l[i]+Cl[i]<--lambda[i,1]+z1[i]*log(lambda[i,1])-loggam(z1[i]+1)-lambda[i,2]+z2[i]*log(lambda[i,2])-loggam(z2[i]+1)-lambda[i,3]+z3[i]*log(lambda[i,3])-loggam(z3[i]+1)log(lambda[i,1])<-mu+offense[Team1[i]]+defense[Team2[i]]log(lambda[i,2])<-mu+offense[Team2[i]]+defense[Team1[i]]log(lambda[i,3])<-beta}for(jin2:nTeams){offense[j]~dnorm(0,.0001)defense[j]~dnorm(0,.0001)}offense[1]<--sum(offense[2:nTeams])defense[1]<--sum(defense[2:nTeams])mu~dnorm(0,0.001)beta~dnorm(0,.001)}
Now, I am trying to fix a diagonal inflated Bivariate Poisson.
My question is, what shoud I change from the above code to implement a diagonal inflated Bivariate Poisson?
My data set:
Team1/Team2 - the home and away teams
Score1/Score2 - the observed scores
nGames - the number of games in the dataset
nTeams - the number of teams in the dataset
Any help would be greatly appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I see this question has been answered by Martyn on the JAGS forum, which is probably a better place for this question as it doesn't have anything to do with runjags in particular. Hope you got what you needed.
Matt
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi, I am trying to fit the Bivariate Poisson distribution to a set of sports results to serve as a comparison model to a new model I am developing/developed with my masters thesis.My model is as follow:
Now, I am trying to fix a diagonal inflated Bivariate Poisson.
My question is, what shoud I change from the above code to implement a diagonal inflated Bivariate Poisson?
My data set:
Team1/Team2 - the home and away teams
Score1/Score2 - the observed scores
nGames - the number of games in the dataset
nTeams - the number of teams in the dataset
Any help would be greatly appreciated.
I see this question has been answered by Martyn on the JAGS forum, which is probably a better place for this question as it doesn't have anything to do with runjags in particular. Hope you got what you needed.
Matt