<?xml version="1.0" standalone="yes"?>

<!-- Generated by BEAUTi v1.7.0 Prerelease r3910                             -->
<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
<!--       Department of Computer Science, University of Auckland and        -->
<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
<!--       http://beast.bio.ed.ac.uk/                                        -->
<beast>

    <!-- The list of taxa to be analysed (can also include dates/ages).          -->
    <!-- ntax=6                                                                  -->
    <taxa id="taxa">
        <taxon id="human"/>
        <taxon id="chimp"/>
        <taxon id="bonobo"/>
        <taxon id="gorilla"/>
        <taxon id="orangutan"/>
        <taxon id="siamang"/>
    </taxa>

    <!-- The sequence alignment (each sequence refers to a taxon above).         -->
    <!-- ntax=6 nchar=768                                                        -->
    <alignment id="alignment" dataType="nucleotide">
        <sequence>
            <taxon idref="human"/>
            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCGGAGCTTGGTAAAAAGAGGCCTAACCCCTGTCTTTAGATTTACAGTCCAATGCTTCA-CTCAGCCATTTTACCACAAAAAAGGAAGGAATCGAACCCCCCAAAGCTGGTTTCAAGCCAACCCCATGGCCTCCATGACTTTTTCAAAAGGTATTAGAAAAACCATTTCATAACTTTGTCAAAGTTAAATTATAGGCT-AAATCCTATATATCTTA-CACTGTAAAGCTAACTTAGCATTAACCTTTTAAGTTAAAGATTAAGAGAACCAACACCTCTTTACAGTGA
        </sequence>
        <sequence>
            <taxon idref="chimp"/>
            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCTTGGTAAAAAGAGGCTTAACCCCTGTCTTTAGATTTACAGTCCAATGCTTCA-CTCAGCCATTTTACCACAAAAAAGGAAGGAATCGAACCCCCTAAAGCTGGTTTCAAGCCAACCCCATGACCTCCATGACTTTTTCAAAAGATATTAGAAAAACTATTTCATAACTTTGTCAAAGTTAAATTACAGGTT-AACCCCCGTATATCTTA-CACTGTAAAGCTAACCTAGCATTAACCTTTTAAGTTAAAGATTAAGAGGACCGACACCTCTTTACAGTGA
        </sequence>
        <sequence>
            <taxon idref="bonobo"/>
            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCTTGGTAAAAAGAGGCTTAACCCCTGTCTTTAGATTTACAGTCCAATGCTTCA-CTCAGCCATTTTACCACAAAAAAGGAAGGAATCGAACCCCCTAAAGCTGGTTTCAAGCCAACCCCATGACCCCCATGACTTTTTCAAAAGATATTAGAAAAACTATTTCATAACTTTGTCAAAGTTAAATTACAGGTT-AAACCCCGTATATCTTA-CACTGTAAAGCTAACCTAGCATTAACCTTTTAAGTTAAAGATTAAGAGGACCAACACCTCTTTACAGTGA
        </sequence>
        <sequence>
            <taxon idref="gorilla"/>
            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCACCTCGGAGCTTGGTAAAAAGAGGCCCAGCCTCTGTCTTTAGATTTACAGTCCAATGCCTTA-CTCAGCCATTTTACCACAAAAAAGGAAGGAATCGAACCCCCCAAAGCTGGTTTCAAGCCAACCCCATGACCTTCATGACTTTTTCAAAAGATATTAGAAAAACTATTTCATAACTTTGTCAAGGTTAAATTACGGGTT-AAACCCCGTATATCTTA-CACTGTAAAGCTAACCTAGCGTTAACCTTTTAAGTTAAAGATTAAGAGTATCGGCACCTCTTTGCAGTGA
        </sequence>
        <sequence>
            <taxon idref="orangutan"/>
            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCACCTCAGGGCTTGGTAAAAAGAGGTCTGACCCCTGTTCTTAGATTTACAGCCTAATGCCTTAACTCGGCCATTTTACCGCAAAAAAGGAAGGAATCGAACCTCCTAAAGCTGGTTTCAAGCCAACCCCATAACCCCCATGACTTTTTCAAAAGGTACTAGAAAAACCATTTCGTAACTTTGTCAAAGTTAAATTACAGGTC-AGACCCTGTGTATCTTA-CATTGCAAAGCTAACCTAGCATTAACCTTTTAAGTTAAAGACTAAGAGAACCAGCCTCTCTTTGCAATGA
        </sequence>
        <sequence>
            <taxon idref="siamang"/>
            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCACTTCGGAGCTTGGCAAAAAGAGGTTTCACCTCTGTCCTTAGATTTACAGTCTAATGCTTTA-CTCAGCCACTTTACCACAAAAAAGGAAGGAATCGAACCCTCTAAAACCGGTTTCAAGCCAGCCCCATAACCTTTATGACTTTTTCAAAAGATATTAGAAAAACTATTTCATAACTTTGTCAAAGTTAAATCACAGGTCCAAACCCCGTATATCTTATCACTGTAGAGCTAGACCAGCATTAACCTTTTAAGTTAAAGACTAAGAGAACTACCGCCTCTTTACAGTGA
        </sequence>
    </alignment>

    <!-- The unique patterns from 1 to end                                       -->
    <!-- npatterns=69                                                            -->
    <patterns id="patterns" from="1">
        <alignment idref="alignment"/>
    </patterns>

    <!-- A prior assumption that the population size has remained constant       -->
    <!-- throughout the time spanned by the genealogy.                           -->
    <constantSize id="constant" units="substitutions">
        <populationSize>
            <parameter id="constant.popSize" value="100" lower="0.0" upper="Infinity"/>
        </populationSize>
    </constantSize>

    <!-- Generate a random starting tree under the coalescent process            -->
    <coalescentTree id="startingTree" rootHeight="380.0">
        <taxa idref="taxa"/>
        <constantSize idref="constant"/>
    </coalescentTree>

    <!-- Generate a tree model                                                   -->
    <treeModel id="treeModel">
        <coalescentTree idref="startingTree"/>
        <rootHeight>
            <parameter id="treeModel.rootHeight"/>
        </rootHeight>
        <nodeHeights internalNodes="true">
            <parameter id="treeModel.internalNodeHeights"/>
        </nodeHeights>
        <nodeHeights internalNodes="true" rootNode="true">
            <parameter id="treeModel.allInternalNodeHeights"/>
        </nodeHeights>
    </treeModel>

    <generalizedSkyLineLikelihood id="skyline" linear="false">
        <populationSizes>
            <parameter id="skyline.popSize" dimension="3" value="380.0" lower="0.0" upper="38000.0"/>
        </populationSizes>
        <groupSizes>
            <parameter id="skyline.groupSize" dimension="3"/>
        </groupSizes>
        <populationTree>
            <treeModel idref="treeModel"/>
        </populationTree>
    </generalizedSkyLineLikelihood>

    <exponentialMarkovLikelihood id="eml1" jeffreys="true">
        <chainParameter>
            <parameter idref="skyline.popSize"/>
        </chainParameter>
    </exponentialMarkovLikelihood> 

    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
    <HKYModel id="hky">
        <frequencies>
            <frequencyModel dataType="nucleotide">
                <frequencies>
                    <parameter id="frequencies" value="0.25 0.25 0.25 0.25"/>
                </frequencies>
            </frequencyModel>
        </frequencies>
        <kappa>
            <parameter id="kappa" value="2.0" lower="0.0" upper="Infinity"/>
        </kappa>
    </HKYModel>

    <!-- site model                                                              -->
    <siteModel id="siteModel">
        <substitutionModel>
            <HKYModel idref="hky"/>
        </substitutionModel>
    </siteModel>

    <!-- Likelihood for tree given sequence data                                 -->
    <treeLikelihood id="treeLikelihood" useAmbiguities="false">
        <patterns idref="patterns"/>
        <treeModel idref="treeModel"/>
        <siteModel idref="siteModel"/>
    </treeLikelihood>

    <!-- Define operators                                                        -->
    <operators id="operators">
        <scaleOperator scaleFactor="0.75" weight="0.1">
            <parameter idref="kappa"/>
        </scaleOperator>
        <deltaExchange delta="0.01" weight="0.1">
            <parameter idref="frequencies"/>
        </deltaExchange>
        <subtreeSlide size="0.0077" gaussian="true" weight="15">
            <treeModel idref="treeModel"/>
        </subtreeSlide>
        <narrowExchange weight="15">
            <treeModel idref="treeModel"/>
        </narrowExchange>
        <wideExchange weight="3">
            <treeModel idref="treeModel"/>
        </wideExchange>
        <wilsonBalding weight="3">
            <treeModel idref="treeModel"/>
        </wilsonBalding>
        <scaleOperator scaleFactor="0.75" weight="3">
            <parameter idref="treeModel.rootHeight"/>
        </scaleOperator>
        <uniformOperator weight="30">
            <parameter idref="treeModel.internalNodeHeights"/>
        </uniformOperator>
        <scaleOperator scaleFactor="0.75" weight="15">
            <parameter idref="skyline.popSize"/>
        </scaleOperator>
        <deltaExchange delta="1" integer="true" weight="3" autoOptimize="false">
            <parameter idref="skyline.groupSize"/>
        </deltaExchange>
        <upDownOperator scaleFactor="0.75" weight="3">
            <up>
            </up>
            <down>
                <parameter idref="treeModel.allInternalNodeHeights"/>
            </down>
        </upDownOperator>
    </operators>

    <!-- Define MCMC                                                             -->
    <mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
        <posterior id="posterior">
            <prior id="prior">
                <logNormalPrior id="hky.kappa.prior" mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
                    <parameter idref="kappa"/>
                </logNormalPrior>
                <uniformPrior id="hky.frequencies.prior" lower="0.0" upper="1.0">
                    <parameter idref="frequencies"/>
                </uniformPrior>
                <generalizedSkyLineLikelihood idref="skyline"/>
                <exponentialMarkovLikelihood idref="eml1"/> 
            </prior>
            <likelihood id="likelihood">
                <treeLikelihood idref="treeLikelihood"/>
            </likelihood>
        </posterior>
        <operators idref="operators"/>

        <!-- write log to screen                                                     -->
        <log id="screenLog" logEvery="100000">
            <column label="Posterior" dp="4" width="12">
                <posterior idref="posterior"/>
            </column>
            <column label="Prior" dp="4" width="12">
                <prior idref="prior"/>
            </column>
            <column label="Likelihood" dp="4" width="12">
                <likelihood idref="likelihood"/>
            </column>
            <column label="rootHeight" sf="6" width="12">
                <parameter idref="treeModel.rootHeight"/>
            </column>
            <column label="L(coalecent)" dp="4" width="12">
                <generalizedSkyLineLikelihood idref="skyline"/>
            </column>
            <parameter idref="skyline.popSize"/>            
        </log>

        <!-- write log to file                                                       -->
        <log id="fileLog" logEvery="1000" fileName="testBSPNoClock.log" overwrite="false">
            <posterior idref="posterior"/>
            <prior idref="prior"/>
            <likelihood idref="likelihood"/>
            <parameter idref="treeModel.rootHeight"/>
            <parameter idref="skyline.popSize"/>
            <parameter idref="skyline.groupSize"/>
            <parameter idref="kappa"/>
            <parameter idref="frequencies"/>
            <treeLikelihood idref="treeLikelihood"/>
            <generalizedSkyLineLikelihood idref="skyline"/>
            <exponentialMarkovLikelihood idref="eml1"/>
            <!-- <logNormalPrior idref="hky.kappa.prior"/>
            <uniformPrior idref="hky.frequencies.prior"/>  -->
        </log>

        <!-- write tree log to file
          <logTree id="treeFileLog" logEvery="1000" nexusFormat="true" fileName="testBSPNoClock.trees" sortTranslationTable="true">
              <treeModel idref="treeModel"/>
              <posterior idref="posterior"/>
          </logTree> -->
    </mcmc>
    <report>
        <property name="timer">
            <mcmc idref="mcmc"/>
        </property>
    </report>
    <!--     <treeTraceAnalysis fileName="testCoalescentNoClock.trees"/> -->
</beast>
