lab:projects:02robust_growth_curve_modeling_using_student-t_distribution:gcm_with_wishart_prior
#WinBUGS codes generated by BAUW: http://bauw.psychstat.org #USE WITH CAUTION! Model{ # Model specification for linear growth curve model for (i in 1:NS){ LS[i,1:2]~dmnorm(muLS[i,1:2], Inv_cov[1:2,1:2]) muLS[i,1]<-bL[1] muLS[i,2]<-bS[1] for (t in 1:5){ y[i, t] ~ dnorm(muY[i,t], Inv_Sig_e2[i]) muY[i,t]<-LS[i,1]+LS[i,2]*A[t] # muY[i,t]<-LS[i,1]+LS[i,2]*t } w[i]~dgamma(a, a) Inv_Sig_e2[i]<-w[i]*Pre_e2 } A[1]<-0 A[2]~dnorm(0, 1.0E-2) A[3]~dnorm(0, 1.0E-2) A[4]~dnorm(0, 1.0E-2) A[5]<-1 #Priors for model parameter #k~dexp(0.1) k~dunif(0,100) a<-k/2 for (i in 1:1){ bL[i] ~ dnorm(0, 1.0E-6) bS[i] ~ dnorm(0, 1.0E-6) } Inv_cov[1:2,1:2]~dwish(R[1:2,1:2], 2) R[1,1]<-1 R[2,2]<-1 R[2,1]<-R[1,2] R[1,2]<-0 Pre_e2 ~ dgamma(.001, .001) para[6]<- 1/Pre_e2 Cov[1:2,1:2]<-inverse(Inv_cov[1:2,1:2]) para[1]<-bL[1] para[2]<-bS[1] para[3] <- Cov[1,1] para[4] <- Cov[2,2] para[5] <- Cov[1,2] para[7] <- k para[8] <- A[2] para[9]<-A[3] para[10]<-A[4] }
lab/projects/02robust_growth_curve_modeling_using_student-t_distribution/gcm_with_wishart_prior.txt · Last modified: 2016/01/24 09:48 by 127.0.0.1