CDOoDocuments.StdDocumentDescDocuments.DocumentDescContainers.ViewDescViews.ViewDescStores.StoreDescDocuments.ModelDescContainers.ModelDescModels.ModelDescStores.ElemDesc TextViews.StdViewDescTextViews.ViewDescTextModels.StdModelDescTextModels.ModelDesc  M TextModels.AttributesDesc'*+ '* '*0 '* .*PSxxStdFolds.FoldDesc   '*PS '*PS *j(4G model { for (i in 1:N){ mu[1,i] <- a[1] + a[2]*x1[i] + a[3]*x2[i] + a[4]*x4[i] mu[2,i] <- b[1] + b[2]*x1[i] + b[3]*x2[i] + b[4]*x3[i] mu[3,i] <- c[1] + c[2]*x1[i] + c[3]*x3[i] + c[4]*x4[i] mu[4,i] <- d[1] + d[2]*x1[i] + d[3]*x2[i] + d[4]*x3[i]+ d[5]*x4[i] mu[5,i] <- e[1] + e[2]*x1[i] + e[3]*x2[i] mu[6,i] <- f[1] + f[2]*x1[i] + f[3]*x4[i] mu[7,i] <- g[1] + g[2]*x2[i] + g[3]*x3[i] + g[4]*x4[i] mu[8,i] <- h[1] + h[2]*x1[i] + h[3]*x3[i] } # compare C from models 1-8 for (j in 1:8) { tau[j] ~ dgamma(12.5,62.5) C[j] <- sqrt(sum(D2[,j])) # data sets 1-8 for different models for (i in 1:N){ Y[i,j] <- y[i] Y[i,j] ~ dnorm(mu[j,i],tau[j]) D2[i,j] <- pow(y[i]-Z[i,j],2) Z[i,j] ~ dnorm(mu[j,i],tau[j]) }} # Compare predictive criteria between models i and j for (i in 1:7) { for (j in i+1:8) {Comp[i,j] <- step(C[j]-C[i])}} # priors for (j in 1:5) { a[j] ~ dnorm(0,0.00001) b[j] ~ dnorm(0,0.00001) c[j] ~ dnorm(0,0.00001) d[j] ~ dnorm(0,0.00001) e[j] ~ dnorm(0,0.00001) f[j] ~ dnorm(0,0.00001) g[j] ~ dnorm(0,0.00001) h[j] ~ dnorm(0,0.00001)}}  7ArialPS,xx5 xx    '*PS ,*PS  '* *PS  # To load the data follow these two steps: (do them both BEFORE clicking # on compile) # Step 1: Highlight list on Data 1 and click on load data. # Step 2: Highlight the first line of Data 2 and click on load data again. # Data 1 list(N=13) # Data 2 x1[] x2[] x3[] x4[] y[] 7 26 6 60 78.5 1 29 15 52 74.3 11 56 8 20 104.3 11 31 8 47 87.6 7 52 6 33 95.9 11 55 9 22 109.2 3 71 17 6 102.7 1 31 22 44 72.5 2 54 18 22 93.1 21 47 4 26 115.9 1 40 23 34 83.8 11 66 9 12 113.3 10 68 8 12 109.4 END + .*PSxx: x  y: ArialPS5click on one of the arrows to open the initial values 8*PSIgx Homework 5 Stat 544 - Spring 2005 Problem 2 Model click on one of the arrows to open the model Data click on one of the arrows to open the data Inits  # Generate Random Inits for regn coefficients of models 1-8 in each chain list(tau=c(1,1,1,1,1,1,1,1)) list(tau=c(5,5,5,5,5,5,5,5)) list(tau=c(0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1))TextControllers.StdCtrlDescTextControllers.ControllerDescContainers.ControllerDescControllers.ControllerDesc TextRulers.StdRulerDescTextRulers.RulerDescTextRulers.StdStyleDescTextRulers.StyleDescZTextRulers.AttributesDesc$ ZGo * ,[ @Documents.ControllerDesc Ws,! [h$