CDOoDocuments.StdDocumentDescDocuments.DocumentDescContainers.ViewDescViews.ViewDescStores.StoreDesc:Documents.ModelDescContainers.ModelDescModels.ModelDescStores.ElemDesc : :TextViews.StdViewDescTextViews.ViewDesc9TextModels.StdModelDescTextModels.ModelDesc28*82/TextModels.AttributesDesc'*0 '*0 3*PSOW+DoodleViews.ViewDescDoodleModels.ModelDescF0.01.0E-6@KDE 0.01.0E-64S;DD0.01.0E-6 L* !C0.01.0E-6 L*zB0.01.0E-6DDA0.01.0E-6`=DArial|ArialD[W+P aR  3*W6*   ` S=/i1Ntau.E1.0E-31.0E-3AK`=tau.F1.0E-31.0E-3eR3beta.FE0.01.0E-6PF 3beta.CE0.01.0E-6+?beta.DE0.01.0E-6!9 3mu.E[i]beta.CE*C[i]+beta.DE*D[i] + beta.FE*F[i](!9 tau.D1.0E-31.0E-3@ - 3beta.BD0.01.0E-63mu.D[i]beta.BD*D[i] @A$ tau.C1.0E-31.0E-33`=beta.AC0.01.0E-6$mu.C[i]beta.AC*C[i] @A$  tau.B1.0E-31.0E-3/ `/4beta.AB0.01.0E-6`=mu.B[i]beta.AB*A[i]  tau.A1.0E-31.0E-3 `=F[i]0.01.0E-6I %E[i]0.01.0E-6@iG`D[i]0.01.0E-6@ -' C[i]0.01.0E-6@ -  B[i]0.01.0E-6^@w A[i]0.01.0E-6 Arial|ArialD[W6d aR*uTTextRulers.StdRulerDescTextRulers.RulerDescTextRulers.StdStyleDescTextRulers.StyleDescbTextRulers.AttributesDesc,mGom 3*|xStdFolds.FoldDesc  6 *`list(N=100, A = c(-0.6879498, -1.271795, 0.6970278, -1.20437, -0.8101617, 0.5607208, 1.770313, -0.5243447, -1.212006, 0.1513526, -1.078058, 0.6378108, -1.095501, 0.9501515, 0.1929235, -0.09672379, -0.4577614, -2.511922, -0.7612971, -1.151742, 0.5010984, 0.3454673, -0.4241347, -1.948784, -1.889222, 0.5564768, 0.3688061, 0.7687322, -0.5674687, -2.201869, -1.068431, 1.358567, -0.172463, -1.053461, 0.1102357, 0.4425582, -1.282514, -1.495574, 1.456512, 0.750184, -0.7122511, 0.04192086, 1.057354, -0.5960568, -0.7800443, 0.09150889, -0.6257968, 1.05985, 1.51137, 1.83985, -0.3564915, 0.0833914, -0.433362, -0.8572867, 0.3036838, 0.6579903, 0.7370805, 0.02211952, -1.840832, 1.304641, 0.1233836, -0.1811548, -0.113275, 0.7075061, 0.3251261, 0.5985277, -0.3073869, 1.718985, 1.047947, 0.8413628, 0.5395763, 0.1451782, 0.5060667, 1.318606, 1.185415, 2.428678, 0.510518, -2.591574, 0.173974, -1.256459, -0.9739862, -1.18953, 0.5323556, -0.2900768, 0.8951323, 2.142477, 1.274165, 0.1169553, -1.098849, 2.680819, -0.5923112, -0.5295662, 1.602226, -0.5275655, -0.1025768, 2.22944, -1.323073, -0.5346853, -0.3866602, 0.6123678), B = c(-0.6209904, -0.7080992, -0.03499479, -1.212538, -0.02429179, -0.1895875, 0.3296475, -1.568061, 0.08186205, 0.5352387, -2.126787, 0.05227999, -3.324427, 0.2429253, 0.2586265, -1.118927, 0.3841767, -2.109143, 1.043168, -1.072307, 1.492725, 1.002204, -0.4514197, -1.170677, -0.7877173, 0.3191382, 0.818566, -0.3651479, -1.654752, -0.9402633, 0.4839534, 1.337146, -0.1207067, -0.1626091, 0.0450607, 0.4999382, 0.9134943, -2.111404, 2.090238, 1.443261, -0.5488372, 0.9081886, 0.2870419, -0.7283081, -1.072324, -0.6469399, -0.07882681, 0.1702674, -0.2123008, 1.790519, 0.5393638, -0.5317761, 0.748283, 0.0779508, 0.185628, 0.9870886, -0.3606773, 0.8381636, -1.039615, -0.5452159, -1.254222, -0.496867, -1.096258, 0.4136929, -0.9842072, 0.4847017, 1.887232, 0.736151, -0.7591252, -0.344556, 1.169885, 0.7596115, 1.860107, -0.3242992, 0.01653174, -0.3322496, -0.773778, -0.6350336, -0.5330004, -2.290975, -0.929204, -0.6803277, -1.133492, -1.114805, 1.910811, -0.9370813, -0.4740849, -1.376257, -1.765977, 0.03316092, -0.5940448, -1.155804, 0.1912307, -0.1210392, -0.7646107, 0.8739765, -2.214458, 0.4267701, -1.185641, 1.603156), C = c(-0.9712268, -1.201763, -1.16424, -0.7571319, -0.2893191, 0.8150569, -0.7195304, -0.2451194, 1.883679, 1.262194, -0.2560279, 0.01892068, -0.9723164, 0.6714802, 0.2830274, -1.430772, 0.4582851, 0.662135, 0.4506963, -2.037966, 0.2347442, 0.2074075, 0.4841741, -2.364141, 0.4333297, 0.9329954, 0.624156, -0.1613998, -0.04866424, -0.8607327, 0.1795974, 0.6781212, -0.985293, -0.5404138, 0.06219581, -0.9387284, -0.3784975, -0.378372, -0.9836862, 0.6379872, 1.053618, -0.0112402, -0.3488339, 0.02911374, -0.154642, -0.3994323, -0.4053839, 0.3374334, -1.278879, 1.432869, 0.05975621, -0.3438711, 0.6825052, 1.480859, -0.9599745, 2.395582, -0.712053, -1.602122, -1.947133, 0.08002275, -0.9592974, 0.2044564, -0.4720429, 1.561067, 0.878803, -0.2726103, 1.901951, -0.8211265, -0.579229, 0.0352708, 1.445274, -1.092291, 1.609779, 0.499113, -2.226822, 0.2586928, -0.5610153, -0.1905978, 0.1683727, -0.888508, -0.452797, -0.965942, -0.3943648, -2.313899, 1.174672, -1.307697, -0.563417, -0.7581943, 0.3026367, 0.3229811, -0.943765, -0.474677, -1.44547, 0.2857029, -0.806061, 0.3110843, -1.250447, 0.5422803, -0.7073696, 2.381202), D = c(-1.679269, -1.400615, 0.2499183, 0.05482119, 0.3404966, -0.2364342, 0.3244361, -1.835289, 0.7661842, 0.7495297, -1.49312, -0.192543, -2.674021, 0.4504314, -1.179432, 0.3831189, 1.045338, -0.6933822, -0.06016292, -0.08337438, 1.045012, 1.784627, 0.3013376, -1.549319, -0.2461409, 1.57817, -0.1887962, 0.3357082, -1.080966, 0.1160228, -0.1311935, 0.371914, -0.8351183, 0.1999332, 0.3491642, -1.407035, 1.454067, -1.850867, 0.2202444, 0.4081275, 0.5139066, -1.619703, -1.003435, 0.4498087, 1.498383, 1.441226, -2.048272, 0.05864285, -0.5547794, 2.154737, -1.133597, 1.360025, 0.8351266, 0.6209092, 0.5422566, 0.4401789, 0.1716646, 1.256162, -1.465004, -0.2657921, -1.120838, -1.455436, -0.226273, 0.05822667, -0.6276442, 0.6833525, 1.641866, 1.481808, 0.04345195, 0.3709218, 0.09810066, -0.2973134, 0.2104341, 0.6207585, 0.2362381, 0.7655703, -0.23316, -0.3609226, -1.728471, -1.767338, 0.306909, -1.307365, -1.514025, 0.1004022, 0.8586464, -0.482804, 0.1110478, -1.238818, -2.141057, 0.01619985, -0.4419008, -0.1091218, -0.8238539, -0.5132795, -1.041132, -0.550796, -1.161223, -0.7345607, -1.909764, 0.7334562), E = c(-0.8365372, -0.2810647, 0.5161662, -0.5695089, -0.5554109, 0.7046418, -1.857829, -0.7120118, 1.359878, 1.563125, -0.6776184, 0.6264083, -2.643411, 1.159875, 0.3734664, 0.6933593, 0.9630778, 0.339053, 0.4220491, -1.708403, 0.5823814, 1.344309, -0.3787459, -2.5124, -0.4485453, 0.4952338, 0.5279239, 0.3154967, -1.656878, -1.16177, -0.2512411, 0.7151124, -0.8092651, -0.2627484, -0.615743, -1.201287, 0.1613429, -1.308927, 0.2686419, 0.9311713, 1.151961, -0.4980498, -1.923297, 0.6244961, -0.07478544, 1.200849, -1.981515, -0.2293309, -0.4665063, 1.659295, -0.9265787, -0.1201689, 0.844047, 1.052083, 0.3804441, 2.077772, 1.164479, 0.3069004, -2.846115, 1.123269, -1.227383, -0.3002501, 0.1262138, 0.05938116, -0.1182584, 0.3029785, 1.964193, 0.5074245, 0.492063, 0.8913486, 0.4990643, 0.1274508, 0.93029, 0.5348722, -1.045042, 0.8163387, -2.577524, -0.812075, -1.887392, -0.2885848, -1.110923, -1.159434, -0.04063491, -2.780775, 1.257963, -0.9909187, 0.1634956, -1.388236, -1.234207, 0.1216782, -1.840188, -0.5576815, -1.986669, 0.2281765, -1.132678, 1.082402, -2.091449, -0.230291, -0.06602663, 1.196724), F = c(0.8070673, 0.9773702, 1.326953, -0.8912469, -0.8911685, -0.2684452, -1.621908, 0.8585859, -0.3788924, 0.5928591, -1.328878, 0.4460399, -1.019112, -0.3053744, 1.168944, 2.000923, 1.03344, -0.2815628, -0.04791572, -1.080487, 0.6266032, 1.299021, -2.227256, -0.8430512, 0.5096334, -1.443459, 0.540759, 0.5763142, -1.687219, 0.4050873, -0.7369436, -0.9383037, -0.5027284, -0.2599968, -0.5222669, -0.6373706, 0.1700826, -0.5230228, -0.05520952, 1.164302, 0.2770812, 0.1969777, -1.377443, 0.3856188, -1.264005, 0.08830223, -0.5375621, -0.4890606, 0.2266621, -0.4450172, 0.01490963, -0.8712395, -0.09789498, 0.1284892, 1.984207, 1.588714, 0.3302897, 0.2698636, -1.422286, 1.530538, -0.02833464, -1.337067, 0.001632471, 0.5128777, -0.8203888, 0.4289442, 0.07866858, -0.3888472, 0.5057444, -0.2167558, -0.7555556, 0.8174242, -0.09706103, 0.1122539, -0.7994474, 1.437314, -1.998988, 0.1035905, -1.111393, 0.6909264, -1.239233, -0.1436356, 0.7167032, -0.902396, -1.108063, 0.06164836, 0.5670179, -0.06111812, -0.901678, 0.4792185, -1.974893, 0.4626214, -0.2322136, 0.366942, 0.604997, 2.516843, -0.9603594, -0.7430815, 1.724015, -0.436187))  3*PS xI <y*uTgLLQGo Z%$.6?HLQ B*|:W+tF0.01.0E-6@KDE 0.01.0E-64S;DD0.01.0E-6) !C0.01.0E-6 L*zB0.01.0E-6DDA0.01.0E-6`=DArial|ArialD[W+P aRgFig. 3.1 From Bill Shipley's part of the course, we have this causal model for an SEM:  The model in an SEM is that the mean of any node is a linear combination of its parents, e.g. mu.E = betaC*C + betaD*D + betaF*F E ~ dnorm(mu.E, tau.E) The BUGS DAG is therefore more complicated, because every part of the model beeds to be specified. Here it is:  This is a bit nicer as code:  model{ for( i in 1 : N ) { A[i] ~ dnorm(0.0, tau.A) B[i] ~ dnorm(mu.B[i], tau.B) C[i] ~ dnorm(mu.C[i], tau.C) D[i] ~ dnorm(mu.D[i], tau.D) E[i] ~ dnorm(mu.E[i], tau.E) F[i] ~ dnorm(0.0, tau.F) mu.B[i] <- beta.AB * A[i] mu.C[i] <- beta.AC * C[i] mu.D[i] <- beta.BD * D[i] mu.E[i] <- beta.CE * C[i] + beta.DE * D[i] + beta.FE * F[i] } beta.AB ~ dnorm(0.0, 1.0E-6) beta.AC ~ dnorm(0.0, 1.0E-6) beta.BD ~ dnorm(0.0, 1.0E-6) beta.CE ~ dnorm(0.0, 1.0E-6) beta.DE ~ dnorm(0.0, 1.0E-6) beta.FE ~ dnorm(0.0, 1.0E-6) tau.A ~ dgamma(0.001, 0.001) tau.B ~ dgamma(0.001, 0.001) tau.C ~ dgamma(0.001, 0.001) tau.D ~ dgamma(0.001, 0.001) tau.E ~ dgamma(0.001, 0.001) tau.F ~ dgamma(0.001, 0.001) } Data in Here Inits list(tau.A=1, tau.B=1, tau.C=1, tau.D=1, tau.E=1, tau.F=1) Running 2 chains, with a burn-in of 1000 iterations, and then taking the next 10 000 iterations, we get these estimates:  mean sd MC_error val2.5pc median val97.5pc start sample beta.AB 0.4469 0.08775 6.266E-4 0.273 0.4473 0.6196 1001 20000 beta.AC 1.0 4.617E-4 3.423E-6 0.9991 1.0 1.001 1001 20000 beta.BD 1.0 4.444E-4 3.285E-6 0.9991 1.0 1.001 1001 20000 beta.CE 0.5518 0.05198 4.217E-4 0.4492 0.5516 0.6535 1001 20000 beta.DE 0.4735 0.05045 4.348E-4 0.3757 0.4729 0.5734 1001 20000 beta.FE 0.5414 0.05075 3.949E-4 0.4427 0.5413 0.6415 1001 20000 tau.A 0.8521 0.1201 8.899E-4 0.6322 0.8467 1.104 1001 20000 tau.B 1.133 0.1611 0.001144 0.8418 1.125 1.468 1001 20000 tau.C 49430.0 7002.0 48.76 36730.0 49060.0 64040.0 1001 20000 tau.D 49500.0 7034.0 48.78 36630.0 49170.0 64260.0 1001 20000 tau.E 4.488 0.6463 0.004716 3.335 4.454 5.831 1001 20000 tau.F 1.136 0.1593 0.001158 0.8442 1.128 1.473 1001 20000 The alternative model is this:  Writing this as a DAG, and using DIC to compare to the other model, is left an exercise for the reader. TextControllers.StdCtrlDescTextControllers.ControllerDescContainers.ControllerDescControllers.ControllerDesc aY?$ ZGo * ,[ @Documents.ControllerDesc vz pk ~