CDOoDocuments.StdDocumentDescDocuments.DocumentDescContainers.ViewDescViews.ViewDescStores.StoreDesc5 Documents.ModelDescContainers.ModelDescModels.ModelDescStores.ElemDesc { TextViews.StdViewDescTextViews.ViewDesc% TextModels.StdModelDescTextModels.ModelDesc  TextModels.AttributesDesc.**uTTextRulers.StdRulerDescTextRulers.RulerDescTextRulers.StdStyleDescTextRulers.StyleDescZTextRulers.AttributesDesc$0ZGo +ArialPS +ArialPS +ArialPS 0ArialPS" XArialPS*S^ <(Times New RomanPS*uTgY?$0ZGo> 0ArialPS 2 *Bookman Old Style0Ymodel{ #here begins the model definition #The following loop declares the likelihood. You observed 10 values of y and each # value of y comes from a normal distribution with mean mu and fixed variance # equal to 2. for (i in 1:10){ y[i] ~ dnorm(mu,.5) } # The following statement declares the prior distribution that has been given to mu mu ~ dnorm(5,1) } #here ends the model definition The following is the data declaration. Here you list the values of y that you have observed. list(y=c(3.65,4.01,3.17,3.48,2.77,4.28,4.78,4.03,3.44,3.09)) On the data declaration part you can list, besides the observed values of y, whatever is considered fixed on your model declaration. Note that the things that are considered fixed on our model are 1 - The number of observations (10) 2 - The variance of the likelihood (2) 3 - The mean and the variance of the prior distribution (5 and 1 respectively). Thus, remembering that WinBugs parameterization of the normal distribution is on terms of the mean and the inverse of the variance, we can rewrite our program as: model{ for (i in 1:N) { y[i] ~ dnorm(mu,y.prec) } mu ~ dnorm(mu.mean,mu.prec ) y.prec <- 1/y.variance mu.prec <- 1/mu.variance } list( y=c(3.65,4.01,3.17,3.48,2.77,4.28,4.78,4.03,3.44,3.09), N = 10, y.variance = 2, mu.mean = 5, mu.variance = 1) Beware, WinBugs syntaxis is case sensitive, i.e. N and n represent two different objects.TextControllers.StdCtrlDescTextControllers.ControllerDescContainers.ControllerDescControllers.ControllerDesc aY?$0ZGo * <[ @Documents.ControllerDesc vz pk ~