Debian Codegraph @

examples/TestXML/TreePriors/testCoalescent.xml

raw symbols SCIP
1 <?xml version="1.0"?>
2 <!-- $Id: testCoalescent.xml,v 1.2 2005/07/11 23:22:40 rambaut Exp $ -->
3 <!-- Tests the coalescent prior -->
4
5 <beast>
6
7 <taxa id="taxa1">
8 <taxon id="A"/>
9 <taxon id="B"/>
10 <taxon id="C"/>
11 <taxon id="D"/>
12 </taxa>
13
14 <date id="date1" value="5000" units="days" direction="backwards"/>
15 <date id="date2" value="0" units="days" direction="backwards"/>
16
17 <taxa id="taxa2">
18 <taxon id="E">
19 <date idref="date1"/>
20 </taxon>
21 <taxon id="F">
22 <date idref="date1"/>
23 </taxon>
24 <taxon id="G">
25 <date idref="date2"/>
26 </taxon>
27 <taxon id="H">
28 <date idref="date2"/>
29 </taxon>
30 </taxa>
31
32 <!-- create a demographic model and intialize currentPopulationSize parameter -->
33 <constantSize id="demo1" units="years">
34 <populationSize>
35 <parameter id="demo1.pop1" value="10000.0"/>
36 </populationSize>
37 </constantSize>
38
39 <!-- simulate a coalescent tree -->
40 <coalescentTree id="tree1">
41 <constantSize idref="demo1"/>
42 <taxa idref="taxa1"/>
43 </coalescentTree>
44
45 <!-- simulate a coalescent tree -->
46 <coalescentTree id="tree2">
47 <constantSize idref="demo1"/>
48 <taxa idref="taxa2"/>
49 </coalescentTree>
50
51 <treeModel id="treeModel1">
52 <coalescentTree idref="tree1"/>
53 <rootHeight>
54 <parameter id="treeModel1.rootHeight"/>
55 </rootHeight>
56 <nodeHeights rootNode="false" internalNodes="true">
57 <parameter id="treeModel1.internalNodeHeights"/>
58 </nodeHeights>
59 <nodeHeights rootNode="true" internalNodes="true">
60 <parameter id="treeModel1.allNodeHeights"/>
61 </nodeHeights>
62 </treeModel>
63
64 <treeModel id="treeModel2">
65 <coalescentTree idref="tree2"/>
66 <rootHeight>
67 <parameter id="treeModel2.rootHeight"/>
68 </rootHeight>
69 <nodeHeights rootNode="false" internalNodes="true">
70 <parameter id="treeModel2.internalNodeHeights"/>
71 </nodeHeights>
72 <nodeHeights rootNode="true" internalNodes="true">
73 <parameter id="treeModel2.allNodeHeights"/>
74 </nodeHeights>
75 </treeModel>
76
77 <!-- create a coalescent model from a tree model and demographic model -->
78 <coalescentLikelihood id="coalescent1">
79 <model>
80 <constantSize idref="demo1"/>
81 </model>
82 <populationTree>
83 <treeModel idref="treeModel1"/>
84 </populationTree>
85 </coalescentLikelihood>
86
87 <!-- create a second coalescent model -->
88 <coalescentLikelihood id="coalescent2">
89 <model>
90 <constantSize idref="demo1"/>
91 </model>
92 <populationTree>
93 <treeModel idref="treeModel2"/>
94 </populationTree>
95 </coalescentLikelihood>
96
97 <mcmc id="mcmc1" chainLength="1000000" verbose="false">
98 <coalescentLikelihood idref="coalescent1"/>
99 <log id="logScreen2" logEvery="5000">
100 <column dp="4">
101 <coalescentLikelihood idref="coalescent1"/>
102 <parameter idref="treeModel1.rootHeight"/>
103 </column>
104 </log>
105 <log id="log1" logEvery="5" fileName="coalescentPrior.log">
106 <coalescentLikelihood idref="coalescent1"/>
107 <parameter idref="treeModel1.rootHeight"/>
108 </log>
109 <logTree id="logTree1" logEvery="100" nexusFormat="true"
110 fileName="coalescentPrior.trees">
111 <treeModel idref="treeModel1"/>
112 </logTree>
113 <operators>
114 <subtreeSlide weight="1" gaussian="true" size="14000">
115 <treeModel idref="treeModel1"/>
116 </subtreeSlide>
117 </operators>
118 </mcmc>
119
120 <report>
121 Time taken:
122 <property name="timer">
123 <mcmc idref="mcmc1"/>
124 </property>
125 </report>
126
127 <traceAnalysis fileName="coalescentPrior.log" burnIn="1000">
128 <expectation name="treeModel1.rootHeight" value="15000"/>
129 </traceAnalysis>
130
131 <treeTraceAnalysis fileName="coalescentPrior.trees"/>
132
133
134 <mcmc id="mcmc2" chainLength="1000000" verbose="false">
135 <coalescentLikelihood idref="coalescent2"/>
136 <log id="logScreen" logEvery="5000">
137 <column dp="4">
138 <coalescentLikelihood idref="coalescent2"/>
139 <parameter idref="treeModel2.rootHeight"/>
140 </column>
141 </log>
142 <log id="log2" logEvery="5" fileName="coalescentPrior_2.log">
143 <coalescentLikelihood idref="coalescent2"/>
144 <parameter idref="treeModel2.rootHeight"/>
145 </log>
146 <logTree id="logTree2" logEvery="100" nexusFormat="true"
147 fileName="coalescentPrior_2.trees">
148 <treeModel idref="treeModel2"/>
149 </logTree>
150 <operators>
151 <subtreeSlide weight="1" gaussian="true" size="14000">
152 <treeModel idref="treeModel2"/>
153 </subtreeSlide>
154 </operators>
155 </mcmc>
156
157 <report>
158 Time taken:
159 <property name="timer">
160 <mcmc idref="mcmc2"/>
161 </property>
162 </report>
163
164 <traceAnalysis fileName="coalescentPrior_2.log" burnIn="1000">
165 <!-- the expectation for 4 leaves with Theta=10000 and tau=5000 -->
166 <expectation name="treeModel2.rootHeight" value="19344.2178"/>
167 </traceAnalysis>
168
169 <treeTraceAnalysis fileName="coalescentPrior_2.trees"/>
170
171
172 </beast>
173
174