CDOoDocuments.StdDocumentDescDocuments.DocumentDescContainers.ViewDescViews.ViewDescStores.StoreDesc@ Documents.ModelDescContainers.ModelDescModels.ModelDescStores.ElemDesc TextViews.StdViewDescTextViews.ViewDesc0 TextModels.StdModelDescTextModels.ModelDesc0 ( TextModels.AttributesDesc1$Courier Newg $Courier New#------------------------------------------------------------------------------------------------------------------------------ Version 3 MULTIVARIATE-conkugate (General conjugate - specify prior parameters in data - V=(xtx)^{-1}) #------------------------------------------------------------------------------------------------------------------------------ model{ #--------------------------------------------------------------- # definition of prior parameters # calculation of the inverse matrix of V inverse.V[1:P,1:P] <- inverse(V[,]) # calculation of the elements of prior precision matrix for(i in 1:P){ for (j in 1:P){ prior.T[i,j] <- inverse.V[i,j] * tau /c2 }} #--------------------------------------------------------------- # model's likelihood # ------------------ for (i in 1:n){ # specifying the constant term in the first column time[i] ~ dnorm( mu[i], tau ) # stochastic componenent # link and linear predictor mu[i] <- inprod( beta[], x[i,] ) } # prior distributions # ------------------ # calculation of the inverse matrix of V # prior parameters # multivariate prior for the beta vector beta[1:P] ~ dmnorm( mu.beta[], prior.T[,] ) # gamma prior for the precision tau ~ dgamma( 0.01, 0.01 ) # deterministic calculation of variance s2 <- 1/tau s <-sqrt(s2) # } INITS list( tau=1, beta=c(1, 0, 0) ) list( n=25, P=3, c2=25, mu.beta=c(0,0,0), V=structure(.Data = c( 0.113215186112351, -0.0044485932353407, -8.3672569807385E-05, -0.0044485932353407, 0.00274378329085448, -4.78570865728707E-05, -8.36725698073853E-05, -4.78570865728707E-05, 1.22874474243973E-06), .Dim = c(3,3)), time = c(16.68, 11.5, 12.03, 14.88, 13.75, 18.11, 8, 17.83, 79.24, 21.5, 40.33, 21, 13.5, 19.75, 24, 29, 15.35, 19, 9.5, 35.1, 17.9, 52.32, 18.75, 19.83, 10.75), x=structure(.Data=c(1, 7, 560, 1, 3, 220, 1, 3, 340, 1, 4, 80, 1, 6, 150, 1, 7, 330, 1, 2, 110, 1, 7, 210, 1, 30, 1460, 1, 5, 605, 1, 16, 688, 1, 10, 215, 1, 4, 255, 1, 6, 462, 1, 9, 448, 1, 10, 776, 1, 6, 200, 1, 7, 132, 1, 3, 36, 1,17, 770, 1, 10, 140, 1, 26, 810, 1, 9, 450, 1, 8, 635, 1, 4, 150), .Dim = c(25,3)) ) TextControllers.StdCtrlDescTextControllers.ControllerDescContainers.ControllerDescControllers.ControllerDesc TextRulers.StdRulerDescTextRulers.RulerDescTextRulers.StdStyleDescTextRulers.StyleDescZTextRulers.AttributesDesc$ ZGo $Courier New ,[ @Documents.ControllerDesc t]s ' `h*