| 1 |
<?xml version="1.0" standalone="yes"?> |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
<beast> |
| 6 |
|
| 7 |
<normalDistributionModel id="normalDistribution" meanInRealSpace="false" > |
| 8 |
<mean> |
| 9 |
<parameter id="mu" value="0"/> |
| 10 |
</mean> |
| 11 |
<precision> |
| 12 |
<parameter id="tau" value="2"/> |
| 13 |
</precision> |
| 14 |
</normalDistributionModel> |
| 15 |
|
| 16 |
<distributionLikelihood id="hierarchicalModel"> |
| 17 |
<distribution> |
| 18 |
<logNormalDistributionModel idref="normalDistribution"/> |
| 19 |
</distribution> |
| 20 |
<data> |
| 21 |
<parameter id="data" value="1 2 3 4 5 6 7 8 9"/> |
| 22 |
</data> |
| 23 |
</distributionLikelihood> |
| 24 |
|
| 25 |
<normalPrior id="normalMeanPrior" mean="0" stdev="1000"> |
| 26 |
<parameter idref="mu"/> |
| 27 |
</normalPrior> |
| 28 |
|
| 29 |
<gammaPrior id="gammaPrecisionPrior" shape="0.001" scale="1000" offset="0"> |
| 30 |
<parameter idref="tau"/> |
| 31 |
</gammaPrior> |
| 32 |
|
| 33 |
<reciprocalStatistic id="sigma2"> |
| 34 |
<parameter idref="tau"/> |
| 35 |
</reciprocalStatistic> |
| 36 |
|
| 37 |
<operators id="operators"> |
| 38 |
<normalNormalMeanGibbsOperator weight="1"> |
| 39 |
<likelihood> |
| 40 |
<distributionLikelihood idref="hierarchicalModel"/> |
| 41 |
</likelihood> |
| 42 |
<prior> |
| 43 |
<normalPrior idref="normalMeanPrior"/> |
| 44 |
</prior> |
| 45 |
</normalNormalMeanGibbsOperator> |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
<normalGammaPrecisionGibbsOperator weight="1"> |
| 52 |
<likelihood> |
| 53 |
<distributionLikelihood idref="hierarchicalModel"/> |
| 54 |
</likelihood> |
| 55 |
<prior> |
| 56 |
<gammaPrior idref="gammaPrecisionPrior"/> |
| 57 |
</prior> |
| 58 |
</normalGammaPrecisionGibbsOperator> |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
</operators> |
| 65 |
|
| 66 |
<mcmc id="mcmc" chainLength="1000000" autoOptimize="true"> |
| 67 |
<posterior> |
| 68 |
<likelihood id="likelihood"> |
| 69 |
<distributionLikelihood idref="hierarchicalModel"/> |
| 70 |
</likelihood> |
| 71 |
<prior id="prior"> |
| 72 |
|
| 73 |
<gammaPrior idref="gammaPrecisionPrior"/> |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
</prior> |
| 78 |
</posterior> |
| 79 |
<operators idref="operators"/> |
| 80 |
<log logEvery="10000"> |
| 81 |
<column label="posterior" dp="4" width="12"> |
| 82 |
<likelihood idref="likelihood"/> |
| 83 |
<prior idref="prior"/> |
| 84 |
</column> |
| 85 |
<column label="Mean" sf="6" width="12"> |
| 86 |
<parameter idref="mu"/> |
| 87 |
</column> |
| 88 |
<column label="Precision" sf="6" width="12"> |
| 89 |
<parameter idref="tau"/> |
| 90 |
</column> |
| 91 |
</log> |
| 92 |
<log logEvery="1000" fileName="testNormalModelGibbs.log"> |
| 93 |
<likelihood idref="likelihood"/> |
| 94 |
<prior idref="prior"/> |
| 95 |
<parameter idref="mu"/> |
| 96 |
<parameter idref="tau"/> |
| 97 |
<reciprocalStatistic idref="sigma2"/> |
| 98 |
</log> |
| 99 |
</mcmc> |
| 100 |
|
| 101 |
<report> |
| 102 |
<property name="timer"> |
| 103 |
<object idref="mcmc"/> |
| 104 |
</property> |
| 105 |
</report> |
| 106 |
|
| 107 |
<traceAnalysis fileName="testNormalModelGibbs.log" stdError="true"/> |
| 108 |
|
| 109 |
</beast> |