-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTreePriors.xml
540 lines (468 loc) · 36.1 KB
/
TreePriors.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
<beast version='2.0'
namespace='beastfx.app.beauti:beast.pkgmgmt:beast.base.core:beast.base.inference:beast.base.evolution.branchratemodel:beast.base.evolution.speciation:beast.base.evolution.tree.coalescent:beast.base.util:beast.base.math:beast.evolution.nuc:beast.base.evolution.operator:beast.base.inference.operator:beast.base.evolution.sitemodel:beast.base.evolution.substitutionmodel:beast.base.evolution.likelihood:beast.evolution:beast.base.inference.distribution'>
<mergewith point='misc'>
<fragment id='TreeOperators' spec="beastfx.app.beauti.Fragment">
<![CDATA[
<!--
replace tree scale operator with more efficient BICESPS operators.
<operator id='$(m)TreeScaler.t:$(n)' spec='BactrianScaleOperator' scaleFactor="0.1" weight="3" tree="@Tree.t:$(n)"/>
-->
<operator id="$(m)BICEPSEpochTop.t:$(n)" spec="beast.base.evolution.operator.EpochFlexOperator" tree="@Tree.t:$(n)" weight="2.0" scaleFactor="0.1"/>
<operator id="$(m)BICEPSEpochAll.t:$(n)" spec="beast.base.evolution.operator.EpochFlexOperator" tree="@Tree.t:$(n)" weight="2.0" scaleFactor="0.1" fromOldestTipOnly="false"/>
<operator id="$(m)BICEPSTreeFlex.t:$(n)" spec="beast.base.evolution.operator.TreeStretchOperator" scaleFactor="0.01" tree="@Tree.t:$(n)" weight="2.0"/>
<operator id='$(m)TreeRootScaler.t:$(n)' spec='beast.base.evolution.operator.kernel.BactrianScaleOperator' scaleFactor="0.1" weight="3" tree="@Tree.t:$(n)" rootOnly='true'/>
<operator id='$(m)UniformOperator.t:$(n)' spec='beast.base.evolution.operator.kernel.BactrianNodeOperator' weight="30" tree="@Tree.t:$(n)"/>
<operator id='$(m)SubtreeSlide.t:$(n)' spec='beast.base.evolution.operator.kernel.BactrianSubtreeSlide' weight="15" size="1.0" tree="@Tree.t:$(n)"/>
<operator id='$(m)Narrow.t:$(n)' spec='Exchange' isNarrow='true' weight="15" tree="@Tree.t:$(n)"/>
<operator id='$(m)Wide.t:$(n)' spec='Exchange' isNarrow='false' weight="3" tree="@Tree.t:$(n)"/>
<operator id='$(m)WilsonBalding.t:$(n)' spec='WilsonBalding' weight="3" tree="@Tree.t:$(n)"/>
]]>
<connect srcID='$(m)BICEPSEpochTop.t:$(n)' targetID='mcmc' inputName='operator' if='inposterior($(m).t:$(n)) and Tree.t:$(n)/estimate=true'>Epoch operator that only scale internal nodes above least recent node for tree t:$(n)</connect>
<connect srcID='$(m)BICEPSEpochAll.t:$(n)' targetID='mcmc' inputName='operator' if='inposterior($(m).t:$(n)) and Tree.t:$(n)/estimate=true'>Epoch operator that scales all internal nodes for tree t:$(n)</connect>
<connect srcID='$(m)BICEPSTreeFlex.t:$(n)' targetID='mcmc' inputName='operator' if='inposterior($(m).t:$(n)) and Tree.t:$(n)/estimate=true'>Flex operators for all internal nodes for tree t:$(n)</connect>
<connect srcID='$(m)TreeRootScaler.t:$(n)' targetID='mcmc' inputName='operator' if='inposterior($(m).t:$(n)) and Tree.t:$(n)/estimate=true'>Scales root node for tree t:$(n)</connect>
<connect srcID='$(m)UniformOperator.t:$(n)' targetID='mcmc' inputName='operator' if='inposterior($(m).t:$(n)) and Tree.t:$(n)/estimate=true'>Draws new internal node heights uniformally for tree t:$(n)</connect>
<connect srcID='$(m)SubtreeSlide.t:$(n)' targetID='mcmc' inputName='operator' if='inposterior($(m).t:$(n)) and Tree.t:$(n)/estimate=true'>Performs subtree slide rearrangement of tree t:$(n)</connect>
<connect srcID='$(m)Narrow.t:$(n)' targetID='mcmc' inputName='operator' if='inposterior($(m).t:$(n)) and Tree.t:$(n)/estimate=true'>Narrow exchange performs local rearrangement of tree t:$(n)</connect>
<connect srcID='$(m)Wide.t:$(n)' targetID='mcmc' inputName='operator' if='inposterior($(m).t:$(n)) and Tree.t:$(n)/estimate=true'>Wide exchange performs global rearrangement of tree t:$(n)</connect>
<connect srcID='$(m)WilsonBalding.t:$(n)' targetID='mcmc' inputName='operator' if='inposterior($(m).t:$(n)) and Tree.t:$(n)/estimate=true'>Performs Wilson-Balding global rearrangement of tree t:$(n)</connect>
</fragment>
</mergewith>
<!-- tree priors -->
<mergewith point='treePriorTemplates'>
<!-- Yule -->
<subtemplate id='YuleModel' class='beast.base.evolution.speciation.YuleModel' mainid='YuleModel.t:$(n)' hmc='
YuleModelUniformOperator/index/=Operators/BactrianNodeOperator/,
YuleModelSubtreeSlide/index/=Operators/SubtreeSlide/,
YuleModelNarrow/index/=Operators/Exchange/,
YuleModelWide/index/=Operators/Exchange/,
YuleModelWilsonBalding/index/=Operators/WilsonBalding/,
YuleModelBICEPSEpochTop/index/=Operators/EpochFlexer/,
YuleModelBICEPSEpochAll/index/=Operators/EpochFlexer/,
YuleModelBICEPSTreeFlex/index/=Operators/TreeStretcher/,
YuleModelTreeRootScaler/index/=Operators/BactrianTreeScaler/,
YuleBirthRateScaler/index/=Operators/BactrianRateScaler/,
YuleBirthRatePrior/index/=Priors/YuleBirthRatePrior/
'>
<![CDATA[
<plugin spec='YuleModel' id="YuleModel.t:$(n)" tree='@Tree.t:$(n)'>
<parameter name='birthDiffRate' id="birthRate.t:$(n)" lower="0.0" value='1.0'/>
</plugin>
<prior id='YuleBirthRatePrior.t:$(n)' x='@birthRate.t:$(n)'><distr spec="beast.base.inference.distribution.Uniform" lower='0' upper='1000'/></prior>
<scale id='YuleBirthRateScaler.t:$(n)' spec='kernel.BactrianScaleOperator' scaleFactor="0.75" weight="3" parameter="@birthRate.t:$(n)"/>
]]>
<plate fragment="TreeOperators" var="m" range="YuleModel"/>
<connect srcID='YuleModel.t:$(n)' targetID='prior' inputName='distribution'
if='inposterior(YuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'>Yule
speciation prior on tree t:$(n)
</connect>
<connect srcID='birthRate.t:$(n)' targetID='state' inputName='stateNode'
if='inposterior(YuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and inposterior(birthRate.t:$(n)) and birthRate.t:$(n)/estimate=true'/>
<connect srcID='YuleBirthRatePrior.t:$(n)' targetID='prior' inputName='distribution'
if='inposterior(YuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and birthRate.t:$(n)/estimate=true'>
Yule speciation process birth rate of partition t:$(n)
</connect>
<connect srcID='YuleBirthRateScaler.t:$(n)' targetID='mcmc' inputName='operator'
if='inposterior(YuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and birthRate.t:$(n)/estimate=true'>
Scale birth rate of Yule prior of tree t:$(n)
</connect>
<connect srcID='YuleModel.t:$(n)' targetID='tracelog' inputName='log'
if='inposterior(YuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
<connect srcID='birthRate.t:$(n)' targetID='tracelog' inputName='log'
if='inposterior(YuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and birthRate.t:$(n)/estimate=true'/>
<connect srcID='birthRate.t:Species' targetID='SBI' inputName='birthRate' if='inposterior(YuleModel.t:Species) and inposterior(birthRate.t:Species)'/>
</subtemplate>
<!-- Calibrated Yule -->
<subtemplate id='CalibratedYuleModel' class='beast.base.evolution.speciation.CalibratedYuleModel'
mainid='CalibratedYuleModel.t:$(n)'
suppressInputs='beast.base.evolution.speciation.CalibratedYuleModel.logMarginal,beast.base.evolution.speciation.CalibratedYuleModel.tree,beast.base.evolution.speciation.CalibratedYuleModel.treeIntervals,beast.base.evolution.speciation.CalibratedYuleModel.calibrations'
hmc="
CalibratedYuleModelUniformOperator/index/=Operators/BactrianNodeOperator/index,
CalibratedYuleModelSubtreeSlide/index/=Operators/SubtreeSlide/,
CalibratedYuleModelNarrow/index/=Operators/Exchange/,
CalibratedYuleModelWide/index/=Operators/Exchange/,
CalibratedYuleModelWilsonBalding/index/=Operators/WilsonBalding/,
CalibratedYuleModelBICEPSEpochTop/index/=Operators/EpochFlexer/,
CalibratedYuleModelBICEPSEpochAll/index/=Operators/EpochFlexer/,
CalibratedYuleModelBICEPSTreeFlex/index/=Operators/TreeStretcher/,
CalibratedYuleModelTreeRootScaler/index/=Operators/BactrianTreeScaler/,
CalibratedYuleBirthRateScaler/index/=Operators/BactrianRateScaler/,
CalibratedYuleBirthRatePrior/index/=Priors/CalibratedYuleBirthRatePrior/
">
<![CDATA[
<plugin spec='CalibratedYuleModel' id="CalibratedYuleModel.t:$(n)" tree='@Tree.t:$(n)'>
<parameter name='birthRate' id="birthRateY.t:$(n)" lower="0.0" value='1.0'/>
</plugin>
<prior id='CalibratedYuleBirthRatePrior.t:$(n)' x='@birthRateY.t:$(n)'><distr spec="beast.base.inference.distribution.Uniform" lower='0' upper='1000'/></prior>
<scale id='CalibratedYuleBirthRateScaler.t:$(n)' spec='kernel.BactrianScaleOperator' scaleFactor="0.75" weight="3" parameter="@birthRateY.t:$(n)"/>
]]>
<plate fragment="TreeOperators" var="m" range="CalibratedYuleModel"/>
<connect srcID='CalibratedYuleModel.t:$(n)' targetID='prior' inputName='distribution'
if='inposterior(CalibratedYuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'>
Calibrated Yule speciation prior on tree t:$(n)
</connect>
<connect srcID='birthRateY.t:$(n)' targetID='state' inputName='stateNode'
if='inposterior(CalibratedYuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and inposterior(birthRateY.t:$(n)) and birthRateY.t:$(n)/estimate=true'/>
<connect srcID='CalibratedYuleBirthRatePrior.t:$(n)' targetID='prior' inputName='distribution'
if='inposterior(CalibratedYuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and birthRateY.t:$(n)/estimate=true'>
Calibrated Yule speciation process birth rate for t:$(n)
</connect>
<connect srcID='CalibratedYuleBirthRateScaler.t:$(n)' targetID='mcmc' inputName='operator'
if='inposterior(CalibratedYuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and birthRateY.t:$(n)/estimate=true'>
Scale birth rate of Calibrated Yule prior of tree t:$(n)
</connect>
<connect srcID='CalibratedYuleModel.t:$(n)' targetID='tracelog' inputName='log'
if='inposterior(CalibratedYuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
<connect srcID='birthRateY.t:$(n)' targetID='tracelog' inputName='log'
if='inposterior(CalibratedYuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and birthRateY.t:$(n)/estimate=true'/>
<connect srcID="CalibratedYuleModel.t:Species" targetID='SBI' inputName='calibratedYule' if='inposterior(CalibratedYuleModel.t:Species)'/>
<connect srcID='birthRateY.t:Species' targetID='SBI' inputName='birthRate' if='inposterior(YuleModel.t:Species) and inposterior(birthRateY.t:Species)'/>
</subtemplate>
<!-- Birth Death model according to Gernhard'08 -->
<subtemplate id='BirthDeathModel' class='beast.base.evolution.speciation.BirthDeathGernhard08Model'
mainid='BirthDeath.t:$(n)'
hmc='
BirthDeathUniformOperator/index/=Operators/BactrianNodeOperator/index,
BirthDeathSubtreeSlide/index/=Operators/SubtreeSlide/,
BirthDeathNarrow/index/=Operators/Exchange/,
BirthDeathWide/index/=Operators/Exchange/,
BirthDeathWilsonBalding/index/=Operators/WilsonBalding/,
BirthDeathBICEPSEpochTop/index/=Operators/EpochFlexer/,
BirthDeathBICEPSEpochAll/index/=Operators/EpochFlexer/,
BirthDeathBICEPSTreeFlex/index/=Operators/TreeStretcher/,
BirthDeathTreeRootScaler/index/=Operators/BactrianTreeScaler/,
BirthRateScaler/index/=Operators/BactrianRateScaler/,
DeathRateScaler/index/=Operators/BactrianRateScaler/,
BirthRatePrior/index/=Priors/BirthRatePrior/,
DeathRatePrior/index/=Priors/DeathRatePrior/'>
<![CDATA[
<distribution id="BirthDeath.t:$(n)" spec="BirthDeathGernhard08Model" tree='@Tree.t:$(n)'>
<birthDiffRate spec='parameter.RealParameter' id="BDBirthRate.t:$(n)" value='1' lower='0' upper='10000' />
<relativeDeathRate spec='parameter.RealParameter' id="BDDeathRate.t:$(n)" value='0.5' lower='0' upper='1' />
</distribution>
<prior id='BirthRatePrior.t:$(n)' x='@BDBirthRate.t:$(n)'><distr spec="beast.base.inference.distribution.Uniform" lower='0' upper='1000'/></prior>
<prior id='DeathRatePrior.t:$(n)' x='@BDDeathRate.t:$(n)'><distr spec="beast.base.inference.distribution.Uniform" lower='0' upper='1'/></prior>
<scale id='BirthRateScaler.t:$(n)' spec='kernel.BactrianScaleOperator' scaleFactor="0.75" weight="3" parameter="@BDBirthRate.t:$(n)"/>
<scale id='DeathRateScaler.t:$(n)' spec='kernel.BactrianScaleOperator' scaleFactor="0.75" weight="3" parameter="@BDDeathRate.t:$(n)"/>
]]>
<plate fragment="TreeOperators" var="m" range="BirthDeath"/>
<connect srcID='BirthDeath.t:$(n)' targetID='prior' inputName='distribution'
if='inposterior(BirthDeath.t:$(n)) and inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'>
Birth-Death speciation prior on tree t:$(n)
</connect>
<connect srcID='BDBirthRate.t:$(n)' targetID='state' inputName='stateNode'
if='inposterior(BirthDeath.t:$(n)) and inposterior(BDBirthRate.t:$(n)) and BDBirthRate.t:$(n)/estimate=true'/>
<connect srcID='BDDeathRate.t:$(n)' targetID='state' inputName='stateNode'
if='inposterior(BirthDeath.t:$(n)) and inposterior(BDDeathRate.t:$(n)) and BDDeathRate.t:$(n)/estimate=true'/>
<connect srcID='BirthRatePrior.t:$(n)' targetID='prior' inputName='distribution'
if='inposterior(BirthDeath.t:$(n)) and inposterior(BDBirthRate.t:$(n)) and BDBirthRate.t:$(n)/estimate=true'>
Birth-Death speciation process rate of partition t:$(n)
</connect>
<connect srcID='DeathRatePrior.t:$(n)' targetID='prior' inputName='distribution'
if='inposterior(BirthDeath.t:$(n)) and inposterior(BDDeathRate.t:$(n)) and BDDeathRate.t:$(n)/estimate=true'>
Death/Birth speciation process relative death rate of partition t:$(n)
</connect>
<connect srcID='BirthRateScaler.t:$(n)' targetID='mcmc' inputName='operator'
if='inposterior(BirthDeath.t:$(n)) and inposterior(BDBirthRate.t:$(n)) and BDBirthRate.t:$(n)/estimate=true'>
Scale Death-Birth rate of Yule prior of tree t:$(n)
</connect>
<connect srcID='DeathRateScaler.t:$(n)' targetID='mcmc' inputName='operator'
if='inposterior(BirthDeath.t:$(n)) and inposterior(BDDeathRate.t:$(n)) and BDDeathRate.t:$(n)/estimate=true'>
Scale Death/Birth rate of Yule prior of tree t:$(n)
</connect>
<connect srcID='BirthDeath.t:$(n)' targetID='tracelog' inputName='log'
if='inposterior(BirthDeath.t:$(n)) and inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
<connect srcID='BDBirthRate.t:$(n)' targetID='tracelog' inputName='log'
if='inposterior(BirthDeath.t:$(n)) and inposterior(BDBirthRate.t:$(n)) and BDBirthRate.t:$(n)/estimate=true'/>
<connect srcID='BDDeathRate.t:$(n)' targetID='tracelog' inputName='log'
if='inposterior(BirthDeath.t:$(n)) and inposterior(BDDeathRate.t:$(n)) and BDDeathRate.t:$(n)/estimate=true'/>
<connect srcID='BDBirthRate.t:Species' targetID='SBI' inputName='birthRate' if='inposterior(BirthDeath.t:Species) and inposterior(BDBirthRate.t:Species)'/>
</subtemplate>
<!-- Coalescent for Constant population -->
<subtemplate id='CoalescentConstantPopulation' class='beast.base.evolution.tree.coalescent.Coalescent'
mainid='CoalescentConstant.t:$(n)' hmc='
CoalescentConstantPopulationUniformOperator/index/=Operators/BactrianNodeOperator/index,
CoalescentConstantPopulationSubtreeSlide/index/=Operators/SubtreeSlide/,
CoalescentConstantPopulationNarrow/index/=Operators/Exchange/,
CoalescentConstantPopulationWide/index/=Operators/Exchange/,
CoalescentConstantPopulationWilsonBalding/index/=Operators/WilsonBalding/,
CoalescentConstantPopulationBICEPSEpochTop/index/=Operators/EpochFlexer/,
CoalescentConstantPopulationBICEPSEpochAll/index/=Operators/EpochFlexer/,
CoalescentConstantPopulationBICEPSTreeFlex/index/=Operators/TreeStretcher/,
CoalescentConstantPopulationTreeRootScaler/index/=Operators/BactrianTreeScaler/,
PopSizePrior/index/=Priors/PopSizePrior/,
PopSizeScaler/index/=Operators/BactrianRateScaler/index/'>
<![CDATA[
<distribution id="CoalescentConstant.t:$(n)" spec="Coalescent">
<treeIntervals spec='beast.base.evolution.tree.TreeIntervals' id='TreeIntervals.t:$(n)' tree='@Tree.t:$(n)'/>
<populationModel spec="ConstantPopulation" id='ConstantPopulation.t:$(n)'>
<parameter name="popSize" id="popSize.t:$(n)" value='0.3' lower="0.0" estimate='true'/>
</populationModel>
</distribution>
<operator id='PopSizeScaler.t:$(n)' spec='kernel.BactrianScaleOperator' scaleFactor="0.75" weight="3" parameter="@popSize.t:$(n)"/>
<prior id='PopSizePrior.t:$(n)' x='@popSize.t:$(n)'>
<distr spec="OneOnX"/>
</prior>
]]>
<plate fragment="TreeOperators" var="m" range="CoalescentConstant"/>
<connect srcID='CoalescentConstant.t:$(n)' targetID='prior' inputName='distribution'
if='inposterior(CoalescentConstant.t:$(n)) and Tree.t:$(n)/estimate=true'>Coalescent prior with
constant rate on tree t:$(n)
</connect>
<connect srcID='PopSizePrior.t:$(n)' targetID='prior' inputName='distribution'
if='inposterior(CoalescentConstant.t:$(n)) and inposterior(popSize.t:$(n)) and popSize.t:$(n)/estimate=true'>
Coalescent population size parameter of partition t:$(n)
</connect>
<connect srcID='popSize.t:$(n)' targetID='state' inputName='stateNode'
if='inposterior(CoalescentConstant.t:$(n)) and inposterior(popSize.t:$(n)) and popSize.t:$(n)/estimate=true'/>
<connect srcID='PopSizeScaler.t:$(n)' targetID='mcmc' inputName='operator'
if='inposterior(CoalescentConstant.t:$(n)) and inposterior(popSize.t:$(n)) and popSize.t:$(n)/estimate=true'>
Scale population size of Coalescent prior of tree t:$(n)
</connect>
<connect srcID='popSize.t:$(n)' targetID='tracelog' inputName='log'
if='inposterior(CoalescentConstant.t:$(n)) and inposterior(popSize.t:$(n)) and popSize.t:$(n)/estimate=true'/>
<connect srcID='CoalescentConstant.t:$(n)' targetID='tracelog' inputName='log'
if='inposterior(CoalescentConstant.t:$(n)) and Tree.t:$(n)/estimate=true'/>
</subtemplate>
<!-- Coalescent for Exponential population -->
<subtemplate id='CoalescentExponentialPopulation' class='beast.base.evolution.tree.coalescent.Coalescent'
mainid='CoalescentExponential.t:$(n)' hmc='
CoalescentExponentialPopulationUniformOperator/index/=Operators/BactrianNodeOperator/index,
CoalescentExponentialPopulationSubtreeSlide/index/=Operators/SubtreeSlide/,
CoalescentExponentialPopulationNarrow/index/=Operators/Exchange/,
CoalescentExponentialPopulationWide/index/=Operators/Exchange/,
CoalescentExponentialPopulationWilsonBalding/index/=Operators/WilsonBalding/,
CoalescentExponentialPopulationBICEPSEpochTop/index/=Operators/EpochFlexer/,
CoalescentExponentialPopulationBICEPSEpochAll/index/=Operators/EpochFlexer/,
CoalescentExponentialPopulationBICEPSTreeFlex/index/=Operators/TreeStretcher/,
CoalescentExponentialPopulationTreeRootScaler/index/=Operators/BactrianTreeScaler/,
GrowthRatePrior/index/=Priors/GrowthRatePrior/,
ePopSizePrior/index/=Priors/ePopSizePrior/,
ePopSizeScaler/index/=Operators/BactrianRateScaler/,
GrowthRateRandomWalk/index/=Operators/BactrianRandomWalk'>
<![CDATA[
<distribution id="CoalescentExponential.t:$(n)" spec="Coalescent">
<treeIntervals spec='beast.base.evolution.tree.TreeIntervals' id='TreeIntervals.t:$(n)' tree='@Tree.t:$(n)'/>
<populationModel spec="ExponentialGrowth" id="ExponentialGrowth.t:$(n)">
<parameter name="popSize" id="ePopSize.t:$(n)" value='0.3' lower="0.0" estimate='true'/>
<parameter name="growthRate" id="growthRate.t:$(n)" value='3e-4' estimate='true'/>
</populationModel>
</distribution>
<operator id='ePopSizeScaler.t:$(n)' spec='kernel.BactrianScaleOperator' scaleFactor="0.75" weight="3" parameter="@ePopSize.t:$(n)"/>
<operator id="GrowthRateRandomWalk.t:$(n)" spec="kernel.BactrianRandomWalkOperator" scaleFactor='0.1' weight="3" parameter="@growthRate.t:$(n)"/>
<prior id='ePopSizePrior.t:$(n)' x='@ePopSize.t:$(n)'>
<distr spec="OneOnX"/>
</prior>
<prior id='GrowthRatePrior.t:$(n)' x='@growthRate.t:$(n)'>
<distr spec="LaplaceDistribution">
<parameter name="mu" value='0.001' estimate="false"/>
<parameter name="scale" value='0.5' estimate="false"/>
</distr>
</prior>
]]>
<plate fragment="TreeOperators" var="m" range="CoalescentExponential"/>
<connect srcID='CoalescentExponential.t:$(n)' targetID='prior' inputName='distribution'
if='inposterior(CoalescentExponential.t:$(n)) and Tree.t:$(n)/estimate=true'>Coalesenct prior with
exponential rate on tree t:$(n)
</connect>
<connect srcID='ePopSizePrior.t:$(n)' targetID='prior' inputName='distribution'
if='inposterior(CoalescentExponential.t:$(n)) and inposterior(ePopSize.t:$(n)) and ePopSize.t:$(n)/estimate=true'>
Coalescent population size parameter of partition t:$(n)
</connect>
<connect srcID='GrowthRatePrior.t:$(n)' targetID='prior' inputName='distribution'
if='inposterior(CoalescentExponential.t:$(n)) and inposterior(growthRate.t:$(n)) and growthRate.t:$(n)/estimate=true'>
Coalescent growth rate of partition t:$(n)
</connect>
<connect srcID='ePopSize.t:$(n)' targetID='state' inputName='stateNode'
if='inposterior(CoalescentExponential.t:$(n)) and inposterior(ePopSize.t:$(n)) and ePopSize.t:$(n)/estimate=true'/>
<connect srcID='growthRate.t:$(n)' targetID='state' inputName='stateNode'
if='inposterior(CoalescentExponential.t:$(n)) and inposterior(growthRate.t:$(n)) and growthRate.t:$(n)/estimate=true'/>
<connect srcID='ePopSizeScaler.t:$(n)' targetID='mcmc' inputName='operator'
if='inposterior(CoalescentExponential.t:$(n)) and inposterior(ePopSize.t:$(n)) and ePopSize.t:$(n)/estimate=true'>
Scale population size of Coalescent prior of tree t:$(n)
</connect>
<connect srcID='GrowthRateRandomWalk.t:$(n)' targetID='mcmc' inputName='operator'
if='inposterior(CoalescentExponential.t:$(n)) and inposterior(growthRate.t:$(n)) and growthRate.t:$(n)/estimate=true'>
Scale growth rate of Coalescent prior of tree t:$(n)
</connect>
<connect srcID='CoalescentExponential.t:$(n)' targetID='tracelog' inputName='log'
if='inposterior(CoalescentExponential.t:$(n)) and Tree.t:$(n)/estimate=true'/>
<connect srcID='ePopSize.t:$(n)' targetID='tracelog' inputName='log'
if='inposterior(CoalescentExponential.t:$(n)) and inposterior(ePopSize.t:$(n)) and ePopSize.t:$(n)/estimate=true'/>
<connect srcID='growthRate.t:$(n)' targetID='tracelog' inputName='log'
if='inposterior(CoalescentExponential.t:$(n)) and inposterior(growthRate.t:$(n)) and growthRate.t:$(n)/estimate=true'/>
</subtemplate>
<!-- Coalescent for Bayesian skyline -->
<subtemplate id='CoalescentBayesianSkyline' class='beast.base.evolution.tree.coalescent.Coalescent'
mainid='BayesianSkyline.t:$(n)'
suppressInputs='beast.base.inference.distribution.MarkovChainDistribution.parameter,
beast.base.inference.distribution.MarkovChainDistribution.initialMean,
beast.base.evolution.tree.coalescent.BayesianSkyline.tree,
beast.base.evolution.tree.coalescent.BayesianSkyline.treeIntevals
'
hmc='
BayesianSkylineUniformOperator/index/=Operators/BactrianNodeOperator/index,
BayesianSkylineSubtreeSlide/index/=Operators/SubtreeSlide/,
BayesianSkylineNarrow/index/=Operators/Exchange/,
BayesianSkylineWide/index/=Operators/Exchange/,
BayesianSkylineWilsonBalding/index/=Operators/WilsonBalding/,
BayesianSkylineBICEPSEpochTop/index/=Operators/EpochFlexer/,
BayesianSkylineBICEPSEpochAll/index/=Operators/EpochFlexer/,
BayesianSkylineBICEPSTreeFlex/index/=Operators/TreeStretcher/,
BayesianSkylineTreeRootScaler/index/=Operators/BactrianTreeScaler/,
popSizesScaler/index/=Operators/BactrianRateScaler/,
groupSizesDelta/index/=Operators/BactrianDeltaExchange/index/'>
<![CDATA[
<distribution spec="BayesianSkyline" id='BayesianSkyline.t:$(n)'>
<parameter name='popSizes' id='bPopSizes.t:$(n)' dimension="5" value="380.0" lower="0.0" estimate='true'/>
<groupSizes spec='parameter.IntegerParameter' id='bGroupSizes.t:$(n)' dimension='5' value='1' estimate='true'/>
<treeIntervals spec='beast.base.evolution.tree.TreeIntervals' id='BSPTreeIntervals.t:$(n)' tree='@Tree.t:$(n)'/>
</distribution>
<distribution id='MarkovChainedPopSizes.t:$(n)' spec="beast.base.inference.distribution.MarkovChainDistribution"
jeffreys="true"
parameter="@bPopSizes.t:$(n)"/>
<operator id='popSizesScaler.t:$(n)' spec='kernel.BactrianScaleOperator' scaleFactor="0.75" weight="15" parameter="@bPopSizes.t:$(n)"/>
<operator id='groupSizesDelta.t:$(n)' spec='kernel.BactrianDeltaExchangeOperator' delta="1" weight="6" integer="true"
intparameter="@bGroupSizes.t:$(n)"/>
]]>
<plate fragment="TreeOperators" var="m" range="BayesianSkyline"/>
<connect srcID='BayesianSkyline.t:$(n)' targetID='prior' inputName='distribution'
if='inposterior(BayesianSkyline.t:$(n)) and Tree.t:$(n)/estimate=true'>Coalescent with Bayesian
skyline prior tree t:$(n)
</connect>
<connect srcID='bPopSizes.t:$(n)' targetID='state' inputName='stateNode'
if='inposterior(BayesianSkyline.t:$(n)) and inposterior(bPopSizes.t:$(n))'/>
<connect srcID='bGroupSizes.t:$(n)' targetID='state' inputName='stateNode'
if='inposterior(BayesianSkyline.t:$(n)) and inposterior(bGroupSizes.t:$(n))'/>
<connect srcID='MarkovChainedPopSizes.t:$(n)' targetID='prior' inputName='distribution'
if='inposterior(BayesianSkyline.t:$(n))'>Markov chained prior on population sizes of Bayesian
skyline plot
</connect>
<connect srcID='BayesianSkyline.t:$(n)' targetID='tracelog' inputName='log'
if='inposterior(BayesianSkyline.t:$(n))'/>
<connect srcID='bPopSizes.t:$(n)' targetID='tracelog' inputName='log'
if='inposterior(BayesianSkyline.t:$(n))'/>
<connect srcID='bGroupSizes.t:$(n)' targetID='tracelog' inputName='log'
if='inposterior(BayesianSkyline.t:$(n))'/>
<connect srcID='popSizesScaler.t:$(n)' targetID='mcmc' inputName='operator'
if='inposterior(BayesianSkyline.t:$(n))'>Scale population size of Coalscent prior of tree t:$(n)
</connect>
<connect srcID='groupSizesDelta.t:$(n)' targetID='mcmc' inputName='operator'
if='inposterior(BayesianSkyline.t:$(n))'>Exchange group sizes of Coalscent prior of tree t:$(n)
</connect>
</subtemplate>
<!-- Coalescent for Extended Bayesian skyline -->
<subtemplate id='CoalescentExtendedBayesianSkyline' class='beast.base.evolution.tree.coalescent.Coalescent'
mainid='ExtendedBayesianSkyline.t:$(n)' hmc='
ExtendedBayesianSkylineUniformOperator/index/=Operators/BactrianNodeOperator/index,
ExtendedBayesianSkylineSubtreeSlide/index/=Operators/SubtreeSlide/,
ExtendedBayesianSkylineNarrow/index/=Operators/Exchange/,
ExtendedBayesianSkylineWide/index/=Operators/Exchange/,
ExtendedBayesianSkylineWilsonBalding/index/=Operators/WilsonBalding/,
ExtendedBayesianSkylineBICEPSEpochTop/index/=Operators/EpochFlexer/,
ExtendedBayesianSkylineBICEPSEpochAll/index/=Operators/EpochFlexer/,
ExtendedBayesianSkylineBICEPSTreeFlex/index/=Operators/TreeStretcher/,
ExtendedBayesianSkylineTreeRootScaler/index/=Operators/BactrianTreeScaler/,
bitflip.alltrees/index/=Operators/BitFlipper/,
indicatorSampler.alltrees/index/=Operators/BactrianDeltaExchange/,
indicatorScaler.alltrees/index/=Operators/BactrianDeltaExchange/,
populationMeanPrior/index/=Priors/populationMeanPrior/,
indicatorsPrior/index/=Priors/indicatorsPrior/,
EBSPupDownOperator.alltrees/index/=Operators/BactrianUpDown/,
EBSPLogger/fileName/,
EBSPLogger/sort/,
EBSPLogger/sanitiseHeaders/,
EBSPLogger/logEvery/,
EBSPLogger/mode/
'>
<![CDATA[
<stateNode id="indicators.alltrees" spec="parameter.BooleanParameter" value="false"/>
<stateNode id="populationMean.alltrees" spec="parameter.RealParameter" lower="0.0" value="1"/>
<stateNode id="popSizes.alltrees" spec="parameter.RealParameter" lower="0.0" value="1"/>
<distribution id="ExtendedBayesianSkyline.t:$(n)" spec="Coalescent">
<treeIntervals id="treeIntervals.t:$(n)" spec='beast.base.evolution.tree.TreeIntervals' tree="@Tree.t:$(n)"/>
<populationModel id="scaledDemo.t:$(n)" spec="beast.base.evolution.tree.coalescent.ScaledPopulationFunction" factor='1' population='@demographic.alltrees'/>
</distribution>
<population id="demographic.alltrees" populationIndicators="@indicators.alltrees" populationSizes="@popSizes.alltrees" spec="beast.base.evolution.tree.coalescent.CompoundPopulationFunction" type="linear" useIntervalsMiddle="false">
<itree idref="treeIntervals.t:$(n)"/>
</population>
<prior id="populationMeanPrior.alltrees" x="@populationMean.alltrees">
<Gamma name="distr">
<alpha spec="parameter.RealParameter" value="0.01" estimate="false"/>
<beta spec="parameter.RealParameter" value="100.0" estimate="false"/>
</Gamma>
</prior>
<prior id="indicatorsPrior.alltrees">
<x arg="@indicators.alltrees" id="indsSun.alltrees" spec="beast.base.evolution.Sum"/>
<distr spec="Poisson" id='Poisson.EBSP'>
<parameter name="lambda" upper="0.0" value="0.69314718056" estimate='false'/>
</distr>
</prior>
<prior id="popSizePrior.alltrees" x="@popSizes.alltrees">
<distr id="popPriorDist.EBSP" mean="@populationMean.alltrees" spec="Exponential"/>
</prior>
<logger id="EBSPLogger" fileName='EBSP.log' logEvery='5000' model="@demographic.alltrees">
<log idref='demographic.alltrees'/>
</logger>
<log id='sumIndicators' spec='beast.base.evolution.Sum' arg='@indicators.alltrees'/>
<operator id="bitflip.alltrees" parameter="@indicators.alltrees" spec="BitFlipOperator" uniform="true" weight="30.0"/>
<operator id="indicatorSampler.alltrees" dist="@popPriorDist.EBSP" indicators="@indicators.alltrees" spec="beast.base.evolution.tree.coalescent.SampleOffValues" values="@popSizes.alltrees" weight="15.0"/>
<operator id="indicatorScaler.alltrees" degreesOfFreedom="1" indicator="@indicators.alltrees" parameter="@popSizes.alltrees" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="kernel.BactrianScaleOperator" weight="15.0"/>
<operator id="EBSPupDownOperator.alltrees" scaleFactor="0.7" spec="kernel.BactrianUpDownOperator" weight="5.0">
<up idref="popSizes.alltrees"/>
<up idref="populationMean.alltrees"/>
</operator>
]]>
<plate fragment="TreeOperators" var="m" range="ExtendedBayesianSkyline"/>
<connect srcID='ExtendedBayesianSkyline.t:$(n)' targetID='prior' inputName='distribution'
if='inposterior(ExtendedBayesianSkyline.t:$(n)) and Tree.t:$(n)/estimate=true'>Coalescent with
extended Bayesian skyline prior tree t:$(n)
</connect>
<connect srcID='treeIntervals.t:$(n)' targetID='demographic.alltrees' inputName='itree'
if='inposterior(ExtendedBayesianSkyline.t:$(n)) and Tree.t:$(n)/estimate=true'/>
<connect srcID='indicators.alltrees' targetID='state' inputName='stateNode'
if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
<connect srcID='populationMean.alltrees' targetID='state' inputName='stateNode'
if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
<connect srcID='popSizes.alltrees' targetID='state' inputName='stateNode'
if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
<connect srcID='populationMeanPrior.alltrees' targetID='prior' inputName='distribution'
if='inposterior(ExtendedBayesianSkyline.t:$(n))'>Extended Bayesian Skyline population prior mean of
partition t:$(n)
</connect>
<connect srcID='indicatorsPrior.alltrees' targetID='prior' inputName='distribution'
if='inposterior(ExtendedBayesianSkyline.t:$(n))'>Average number of population change points of
partition t:$(n)
</connect>
<connect srcID='popSizePrior.alltrees' targetID='prior' inputName='distribution'
if='inposterior(ExtendedBayesianSkyline.t:$(n))'>Extended Bayesian Skyline population prior of
partition t:$(n)
</connect>
<connect srcID='ExtendedBayesianSkyline.t:$(n)' targetID='tracelog' inputName='log'
if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
<connect srcID='indicators.alltrees' targetID='tracelog' inputName='log'
if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
<connect srcID='populationMean.alltrees' targetID='tracelog' inputName='log'
if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
<connect srcID='popSizes.alltrees' targetID='tracelog' inputName='log'
if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
<connect srcID='sumIndicators' targetID='tracelog' inputName='log'
if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
<connect srcID='EBSPLogger' targetID='mcmc' inputName='logger'
if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
<connect srcID='bitflip.alltrees' targetID='mcmc' inputName='operator'
if='inposterior(ExtendedBayesianSkyline.t:$(n))'>EBSP bitflip operator
</connect>
<connect srcID='indicatorSampler.alltrees' targetID='mcmc' inputName='operator'
if='inposterior(ExtendedBayesianSkyline.t:$(n))'>EBSP indicator sampler
</connect>
<connect srcID='indicatorScaler.alltrees' targetID='mcmc' inputName='operator'
if='inposterior(ExtendedBayesianSkyline.t:$(n))'>EBSP population sizes
</connect>
<connect srcID='EBSPupDownOperator.alltrees' targetID='mcmc' inputName='operator'
if='inposterior(ExtendedBayesianSkyline.t:$(n))'>Up/down scale substitution rates of EBSP prior and
tree
</connect>
</subtemplate>
</mergewith>
</beast>