Recent Changes for "BayesTraits with Discrete Traits (Glor)" - Bodega Phylogenetics Wikihttp://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%29Recent Changes of the page "BayesTraits with Discrete Traits (Glor)" on Bodega Phylogenetics Wiki.en-us BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-13 19:59:28BMoore <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p>No differences found!</div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-13 16:34:10(quick edit) <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 154: </td> <td> Line 154: </td> </tr> <tr> <td> <span>-</span> Note that this output includes the iteration in the left column as well as the Harmonic Mean estimate of the marginal log likelihood that we'll need later to calculate Bayes Factor scores, and indicates which tree is being sampled at each iteration. Note that the likelihood scores are considerably worse than they were previously, that's not surprising because we are no longer maximizing the likelihood. The most disturbing aspect of the results is that the transition rates are crazy high. This is not too surprising, given that the {{prior (uniform [0,100])}} places the vast majority of the prior mass is on very high rates. Accordingly, we'll modify the prior to reflect more reasonable; specifically, we'll change the prior to a uniform [0,1]. This prior is more reasonable in light of the range of MLE values for these parameters (that would make this an example of an 'empirical prior'--one that is informed by a ML 'peek' at the data. Run the analysis under this new prior and see how it looks. </td> <td> <span>+</span> Note that this output includes the iteration in the left column as well as the Harmonic Mean estimate of the marginal log likelihood that we'll need later to calculate Bayes Factor scores, and indicates which tree is being sampled at each iteration. Note that the likelihood scores are considerably worse than they were previously, that's not surprising because we are no longer maximizing the likelihood. The most disturbing aspect of the results is that the transition rates are crazy high. This is not too surprising, given that the <span>{</span>{{prior (uniform [0,100])}}<span>}</span> places the vast majority of the prior mass is on very high rates. Accordingly, we'll modify the prior to reflect more reasonable; specifically, we'll change the prior to a uniform [0,1]. This prior is more reasonable in light of the range of MLE values for these parameters (that would make this an example of an 'empirical prior'--one that is informed by a ML 'peek' at the data. Run the analysis under this new prior and see how it looks. </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-13 16:33:48(quick edit) <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 154: </td> <td> Line 154: </td> </tr> <tr> <td> <span>-</span> Note that this output includes the iteration in the left column as well as the Harmonic Mean estimate of the marginal log likelihood that we'll need later to calculate Bayes Factor scores, and indicates which tree is being sampled at each iteration. Note that the likelihood scores are considerably worse than they were previously, that's not surprising because we are no longer maximizing the likelihood. The most disturbing aspect of the results is that the transition rates are crazy high. This is not too surprising, given that the prior (uniform [0,100]) places the vast majority of the prior mass is on very high rates. Accordingly, we'll modify the prior to reflect more reasonable; specifically, we'll change the prior to a uniform [0,1]. This prior is more reasonable in light of the range of MLE values for these parameters (that would make this an example of an 'empirical prior'--one that is informed by a ML 'peek' at the data. Run the analysis under this new prior and see how it looks. </td> <td> <span>+</span> Note that this output includes the iteration in the left column as well as the Harmonic Mean estimate of the marginal log likelihood that we'll need later to calculate Bayes Factor scores, and indicates which tree is being sampled at each iteration. Note that the likelihood scores are considerably worse than they were previously, that's not surprising because we are no longer maximizing the likelihood. The most disturbing aspect of the results is that the transition rates are crazy high. This is not too surprising, given that the <span>{{</span>prior (uniform [0,100])<span>}}</span> places the vast majority of the prior mass is on very high rates. Accordingly, we'll modify the prior to reflect more reasonable; specifically, we'll change the prior to a uniform [0,1]. This prior is more reasonable in light of the range of MLE values for these parameters (that would make this an example of an 'empirical prior'--one that is informed by a ML 'peek' at the data. Run the analysis under this new prior and see how it looks. </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-13 16:27:14BMooreUpload of file <a href="http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%29?action=Files&do=view&target=Adox_trait1_commands.txt">Adox_trait1_commands.txt</a>.BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-13 16:27:01BMoore <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 11: </td> <td> Line 11: </td> </tr> <tr> <td> </td> <td> <span>+ ||[[File(Adox_trait1_commands.txt)]]||</span> </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-13 15:35:39BMoore <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 91: </td> <td> Line 91: </td> </tr> <tr> <td> <span>-</span> Tree No Lh q01 q10 Root P(0) Root P(1) </td> <td> <span>+</span> <span>{{{</span>Tree No Lh q01 q10 Root P(0) Root P(1) </td> </tr> <tr> <td> Line 101: </td> <td> Line 101: </td> </tr> <tr> <td> <span>-</span> 10 -14.833338 0.006706 0.006706 0.427272 0.572728 </td> <td> <span>+</span> 10 -14.833338 0.006706 0.006706 0.427272 0.572728<span>}}}</span> </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-13 15:34:47BMoore <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 163: </td> <td> Line 163: </td> </tr> <tr> <td> <span>- We have estimates of the marginal likelihoods (based on the harmonic mean) for each of tWe can use these estimates , which allows us to --we have an estimate of the marginal likelihood the If the acceptance rates are too low, we'll need to do things change if we use different priors? Let's try to follow the program authors' advice by using a hyperprior. We can set a hyperprior by re-running the steps above and selecting {{{rjhp exp 0 30}}}. After running this analysis, we should see some lines that look like this:<br> - <br> - <br> - We should also notice that our rate parameters are ridiculously high and that the acceptance rate is too high (&gt;90%; we'd like the acceptance rates to be in the range of ~20-40%).<br> - <br> - **** for for the ]to an exponential) and the<br> - <br> - 9. How do things change if we use different priors? Let's try to follow the program authors' advice by using a hyperprior. We can set a hyperprior by re-running the steps above and selecting {{{rjhp exp 0 30}}}. After running this analysis, we should see some lines that look like this:</span> </td> <td> <span>+ <br> + 12. The two previous Bayesian analyses conditioned on a model--the first on a two-rate model, the second on a one-rate model. If we want to get really Bayesian, we can treat the model itself as a random variable. That is, we can use a special type of MCMC, reversible-jump MCMC to average over the set of possible trait models (for binary traits, there are a total of 5 possible models). This procedure accommodates uncertainty in model choice so the the inference of ancestral states and transition rates does not assume any one model of trait evolution. Let' specify a model-averaged inference of trait evolution by specifying the prior and hyperpriorm, {{{rjhp exp 0 30}}}, for the rjMCMC--this specifies an exponential prior for the transition rates, and the rate parameter for the exponential is itself sampled from a uniform hyperprior on the interval [0,30] . After running this analysis, we should see some lines that look like this:</span> </td> </tr> <tr> <td> Line 187: </td> <td> Line 181: </td> </tr> <tr> <td> -<span>&nbsp;Changing the </span>p<span>rior results in a major improvement in likelihood scores and recovery of rate parameters that are more in line with the MLE estimates. This dataset therefore provides an indication of how strong an impact the priors can have on Bayesian inference of character reconstruction.<br> - <br> - 10. Even though we're getting good parameter estimates, our mixing is</span> a bit low (&lt;20%). Let's try to improve mixing by reducing the RateDev parameter<span>. Let's try going from 2</span> to 0.1 {{{RateDev 0.1}}}. If we do this, we find that we have good mixing by the end of the analysis, but that we have yet to reach stationarity by the previously set burn-in. In this case, therefore, we're going to need to increase the burn-in point to ensure adequate mixing. </td> <td> <span>+ 13. Again, lets iteratively tweak the RateDev parameter to ensure that the rjMCMC is mixing well</span>-<span>-the current acce</span>p<span>tance rates are</span> a bit low (&lt;20%). Let's try to improve mixing by reducing the RateDev parameter<span>, setting it</span> to 0.1 {{{RateDev 0.1}}}. If we do this, we find that we have good mixing by the end of the analysis, but that we have yet to reach stationarity by the previously set burn-in. In this case, therefore, we're going to need to increase the burn-in point to ensure adequate mixing. </td> </tr> <tr> <td> Line 209: </td> <td> Line 201: </td> </tr> <tr> <td> - 1<span>1</span>. Suppose we are particularly interested in knowing what the growth form was at the root of our tree. As we've already seen, our analyses strongly favor a herbaceous growth form at the root. We can assess how well supported this outcome is by using the {{{fossil}}} command. By fixing the state at each possible alternative and running the analysis, we can compare the resulting Bayes Factor scores to generate an estimate for the relative support of each alternative hypothesis. Let's fix the root to be a woody form {{{Fossil root 0 1 12}}}, ie set the root to state 0 (woody) between taxa number 1 and 12. The syntax here requires that fossil [node name] [state to fix] [taxon numbers]. Once this operation is complete, we can re-run a second time after fixing a root state of 1. Compare the resulting Harmonic mean likelihoods to see how well supported each alternative state is. </td> <td> <span>+ 14. The rjMCMC simulation provides an estimate of the marginal probabilities of the various trait models. What are the marginal probabilities for the one</span>- <span>and two rate models? How does this result jive with the results of the Bayes factor test that you performed previously?<br> + <br> + </span>1<span>5</span>. Suppose we are particularly interested in knowing what the growth form was at the root of our tree. As we've already seen, our analyses strongly favor a herbaceous growth form at the root. We can assess how well supported this outcome is by using the {{{fossil}}} command. By fixing the state at each possible alternative and running the analysis, we can compare the resulting Bayes Factor scores to generate an estimate for the relative support of each alternative hypothesis. Let's fix the root to be a woody form {{{Fossil root 0 1 12}}}, ie set the root to state 0 (woody) between taxa number 1 and 12. The syntax here requires that fossil [node name] [state to fix] [taxon numbers]. Once this operation is complete, we can re-run a second time after fixing a root state of 1. Compare the resulting Harmonic mean likelihoods to see how well supported each alternative state is. </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-13 15:20:42BMoore <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 157: </td> <td> Line 157: </td> </tr> <tr> <td> <span>-</span> 10. Now we're going to repeat the above Bayesian analyses under a one-rate model. To do this, we're going to use the command {{{restrict q01 q10}}} (just before entering run). We can confirm that this operation was successful by typing {{{info}}}. We should now see that q01 is restricted to be the same as q10 while q10 has no restrictions. Let's now re-run the analysis by typing {{{run}}}.<br> -<span>&nbsp;</span><br> - If the acceptance rates are too low, we'll need to do things change if we use different priors? Let's try to follow the program authors' advice by using a hyperprior. We can set a hyperprior by re-running the steps above and selecting {{{rjhp exp 0 30}}}. After running this analysis, we should see some lines that look like this: </td> <td> <span>+</span> 10. Now we're going to repeat the above Bayesian analyses under a one-rate model. To do this, we're going to use the command {{{restrict q01 q10}}} (just before entering run). We can confirm that this operation was successful by typing {{{info}}}. We should now see that q01 is restricted to be the same as q10 while q10 has no restrictions. Let's now re-run the analysis by typing {{{run}}}.<span>&nbsp;&nbsp;As before, iteratively adjust the value of the RateDev parameter until the acceptance rates are in the target range (2-–40%).</span><br> <span>+ <br> + <br> + <br> + 11. We have estimates of the marginal likelihoods (based on the harmonic mean estimator) for each of the preceding Bayesian analyses (under the two</span>-<span>rate and one-rate models). We can therefore assess the support in the data for the two models (by taking the difference in the estimated marginal log likelihoods). Which model is preferred?</span><br> <span>+ <br> + We have estimates of the marginal likelihoods (based on the harmonic mean) for each of tWe can use these estimates , which allows us to </span>-<span>-we have an estimate of the marginal likelihood the</span> If the acceptance rates are too low, we'll need to do things change if we use different priors? Let's try to follow the program authors' advice by using a hyperprior. We can set a hyperprior by re-running the steps above and selecting {{{rjhp exp 0 30}}}. After running this analysis, we should see some lines that look like this: </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-13 15:13:28BMoore <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 153: </td> <td> Line 153: </td> </tr> <tr> <td> <span>- Note that this output includes the iteration in the left column as well as the Harmonic Mean estimate of the marginal log likelihood that we'll need later to calculate Bayes Factor scores. We are also told which tree is being investigated at each iteration. Note that our likelihood scores are considerably worse than they were previously, that's not surprising because we are no longer maximizing the likelihood. We should also notice that our rate parameters are ridiculously high and that the acceptance rate is too high (&gt;90%; we'd like the acceptance rates to be in the range of ~20-40%). To try to address this, we're going to change the prior (from a uniform [0,100] to a uniform [0,1]). This prior is more reasonable in light of the range of MLE values for these parameters (that would make this an 'empirical prior'--one that is informed by a ML 'peek at the data.<br> - <br> - <br> - <br> - **** for for the ]to an exponential) and the magnitude of proposed changes to the transition rates (i.e., Rate Dev parameter). All else being equal, we expect higher Rate Dev values to result in lower acceptance rates because they will propose larger changes to the rate parameters.</span> </td> <td> <span>+ Note that this output includes the iteration in the left column as well as the Harmonic Mean estimate of the marginal log likelihood that we'll need later to calculate Bayes Factor scores, and indicates which tree is being sampled at each iteration. Note that the likelihood scores are considerably worse than they were previously, that's not surprising because we are no longer maximizing the likelihood. The most disturbing aspect of the results is that the transition rates are crazy high. This is not too surprising, given that the prior (uniform [0,100]) places the vast majority of the prior mass is on very high rates. Accordingly, we'll modify the prior to reflect more reasonable; specifically, we'll change the prior to a uniform [0,1]. This prior is more reasonable in light of the range of MLE values for these parameters (that would make this an example of an 'empirical prior'--one that is informed by a ML 'peek' at the data. Run the analysis under this new prior and see how it looks.<br> + <br> + 9. How is the MCMC mixing? Ideally, the acceptance rates to for proposed changes to the rate parameters should fall in the range between ~20-40%. We can control the acceptance rates (and, thus, the mixing of the MCMC) by changing the magnitude of proposed changes to the transition rates (i.e., RateDev parameter). All else being equal, we expect higher Rate Dev values to result in lower acceptance rates because they will propose larger changes to the rate parameters. Accordingly, if acceptance rates are too high, specify a larger value for the RateDev parameter (and vice versa). Experiment with different values until you get the chain to mix well.<br> + <br> + 10. Now we're going to repeat the above Bayesian analyses under a one-rate model. To do this, we're going to use the command {{{restrict q01 q10}}} (just before entering run). We can confirm that this operation was successful by typing {{{info}}}. We should now see that q01 is restricted to be the same as q10 while q10 has no restrictions. Let's now re-run the analysis by typing {{{run}}}.<br> + <br> + If the acceptance rates are too low, we'll need to do things change if we use different priors? Let's try to follow the program authors' advice by using a hyperprior. We can set a hyperprior by re-running the steps above and selecting {{{rjhp exp 0 30}}}. After running this analysis, we should see some lines that look like this:<br> + <br> + <br> + We should also notice that our rate parameters are ridiculously high and that the acceptance rate is too high (&gt;90%; we'd like the acceptance rates to be in the range of ~20-40%).<br> + <br> + **** for for the ]to an exponential) and the</span> </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-13 14:40:42BMoore <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 14: </td> <td> Line 14: </td> </tr> <tr> <td> <span>-</span> 2. Although BayesTraits is available for both Macs and PCs, this tutorial will focus on the Mac OSX version. If you're using a PC you should be able to follow along<span>&nbsp;if you're willing to work through a few tweaks</span>. In OSX, BayesTraits is run through the Terminal application. As with any Terminal-based application, we need to <span>pay careful attention to where on our computer we put</span> the program and associated files. We're going to put the BayesTraits folder in the Applications folder. Because your computer likely has multiple Applications folders, you should be sure to put it in the one that is found in your root directory (the simplest way to get to this directory is to click the Applications link in the Favorites menu that appears in the Finder window (see below)). </td> <td> <span>+</span> 2. Although BayesTraits is available for both Macs and PCs, this tutorial will focus on the Mac OSX version. If you're using a PC you should be able to follow along. In OSX, BayesTraits is run through the Terminal application. As with any Terminal-based application, we need to <span>the locations of</span> the program and associated files. We're going to put the BayesTraits folder in the Applications folder. Because your computer likely has multiple Applications folders, you should be sure to put it in the one that is found in your root directory (the simplest way to get to this directory is to click the Applications link in the Favorites menu that appears in the Finder window (see below)). </td> </tr> <tr> <td> Line 22: </td> <td> Line 22: </td> </tr> <tr> <td> <span>-</span> 3. We're now ready to open BayesTraits and the relevant data. We're going to <span>kick things off with a reconstruc</span>tion of growth form <span>in plants. We're going to focus in on reconstructing two alternative growth forms:</span> (0) woody, and (1) herbaceous<span>. The character data is</span> stored in a comma delimited text file: {{{Adox_trait1.txt}}}. The trees <span>for this analysis, </span>m<span>eanwhile, are going to co</span>m<span>e from the posterior</span> distribution of <span>an analysis in</span> BEAST: {{{Adox.trees}}}. BayesTraits requires a rooted tree with branch lengths. Move both of these files to your BayesTraits folder and navigate to this folder in the Terminal by typing {{{cd ../../Applications/BayesTraits}}}. Now we're ready to run BayesTraits and we can do so by specifying both the tree and the dataset when we call BayesTraits: </td> <td> <span>+</span> 3. We're now ready to open BayesTraits and the relevant data. We're going to <span>explore the evolu</span>tion of growth form <span>[i.e.,</span> (0) woody, and (1) herbaceous<span>] in a group of plants, Adoxaceae. The character data are</span> stored in a comma delimited text file: {{{Adox_trait1.txt}}}. The trees <span>used in this analysis are fro</span>m<span>&nbsp;a </span>m<span>arginal</span> distribution of <span>dated trees inferred using</span> BEAST: {{{Adox.trees}}}. BayesTraits requires a rooted tree with branch lengths<span>/durations</span>. Move both of these files to your BayesTraits folder and navigate to this folder in the Terminal by typing {{{cd ../../Applications/BayesTraits}}}. Now we're ready to run BayesTraits and we can do so by specifying both the tree and the dataset when we call BayesTraits: </td> </tr> <tr> <td> Line 26: </td> <td> Line 26: </td> </tr> <tr> <td> <span>-</span> 4. If your data ha<span>s</span> loaded successfully you should see the following text: </td> <td> <span>+</span> 4. If your data ha<span>ve</span> loaded successfully you should see the following text: </td> </tr> <tr> <td> Line 44: </td> <td> Line 44: </td> </tr> <tr> <td> <span>-</span> We're going to start with ML analyses, even though our ultimate goal is to use Bayesian inference. We're doing this because ML can provide us with a reasonable first approximation of the rate coefficient(s) that might be useful for <span>optimizing our priors for the</span> Bayesian analysis. Type {{{1}}} and hit enter to initiate your Maximum Likelihood analyses. </td> <td> <span>+</span> We're going to start with ML analyses, even though our ultimate goal is to use Bayesian inference. We're doing this because ML can provide us with a reasonable first approximation of the rate coefficient(s) that might be useful for <span>specifying (hyer)priors in the subsequent</span> Bayesian analysis. Type {{{1}}} and hit enter to initiate your Maximum Likelihood analyses. </td> </tr> <tr> <td> Line 70: </td> <td> Line 70: </td> </tr> <tr> <td> <span>-</span> Most of the information we're seeing here has a pretty intuitive interpretation. We have 501 trees with 63 taxa in each tree and 1 character (or site) with two states (i.e., a binary character). We're currently working with two different <span>transition</span> parameters, one for transitions from woody to herbaceous (q01) and <span>another for transitions </span>b<span>etween herbaceous and</span> woody (q10). Let's <span>kick things off by running</span> a basic ML search <span>with two rate parameters the other default sett</span>ings. When doing Maximum Likelihood analyses on a set of more than 1 tree, BayesTraits is going to provide results calculated independently for each of the 501 trees in our dataset. To run your analysis, simply type {{{run}}}. </td> <td> <span>+</span> Most of the information we're seeing here has a pretty intuitive interpretation. We have 501 trees with 63 taxa in each tree and 1 character (or site) with two states (i.e., a binary character). We're currently working with two different <span>rate</span> parameters, one for transitions from woody to herbaceous (q01) and <span>the other for transitions from her</span>b<span>aceous to</span> woody (q10). Let's <span>do</span> a basic ML search <span>under this two-rate model us</span>ing<span>&nbsp;the default settings for other parameter</span>s. When doing Maximum Likelihood analyses on a set of more than 1 tree, BayesTraits is going to provide results calculated independently for each of the 501 trees in our dataset. To run your analysis, simply type {{{run}}}. </td> </tr> <tr> <td> Line 87: </td> <td> Line 87: </td> </tr> <tr> <td> <span>-</span> Let's focus on several p<span>atterns evident in</span> these results. First, we should see that all of our trees produce similar log likelihoods. This<span>&nbsp;is good news, as it</span> suggests that variation among the trees in our posterior distribution is not having a strong impact on <span>inference</span>. Second, the rate for transitions from the woody to herbaceous (q01 = 0.000) is much lower than that of herbaceous to woody (q10 = 0.018-0.022). Finally, the probability of an herbaceous state at the root is substantially higher than the probability of a woody state at the root (0.000 v. 1.000). </td> <td> <span>+</span> Let's focus on several <span>as</span>p<span>ects of</span> these results. First, we should see that all of our trees produce similar log likelihoods. This suggests that variation among the trees in our posterior distribution is not having a strong impact on <span>the inference of evolution in this trait</span>. Second, the rate for transitions from the woody to herbaceous (q01 = 0.000) is much lower than that of herbaceous to woody (q10 = 0.018-0.022). Finally, the probability of an herbaceous state at the root is substantially higher than the probability of a woody state at the root (0.000 v. 1.000). </td> </tr> <tr> <td> Line 89: </td> <td> Line 89: </td> </tr> <tr> <td> <span>-</span> 6. Before we leave likelihood land, <span>lets see if the o</span>b<span>served difference between the two rate parameters is something we should be concerned with. To do this we're going to re-run our analysis after requiring that the two parameters ar</span>e equal to one another. To do this, we're going to use the command {{{restrict q01 q10}}} (just before entering run), remember you have to specify the matrix, data and parameters for each run. We can confirm that this operation was successful by typing {{{info}}}. We should now see that q01 is restricted to be the same as q10 while q10 has no restrictions. Let's now re-run the analysis by typing {{{run}}}. The first ML scores for the first 10 trees look something like this: </td> <td> <span>+</span> 6. Before we leave likelihood land, <span>we could consider whether the difference in the two estimated rate parameters has implications for model selection. To do this we're going to re-run our analysis with the two parameters constrained to </span>be equal to one another. To do this, we're going to use the command {{{restrict q01 q10}}} (just before entering run), remember you have to specify the matrix, data and parameters for each run. We can confirm that this operation was successful by typing {{{info}}}. We should now see that q01 is restricted to be the same as q10 while q10 has no restrictions. Let's now re-run the analysis by typing {{{run}}}. The first ML scores for the first 10 trees look something like this: </td> </tr> <tr> <td> Line 103: </td> <td> Line 103: </td> </tr> <tr> <td> <span>- The fact that the resulting negative log likelihoods are considerable worse in this case suggests that the two rate parameter model is superior to the single rate parameter model. We can formally test this hypothesis using AIC or the likelihood ratio test.</span> </td> <td> <span>+ The fact that the resulting substantial decrease in likelihoods suggests that the two-rate parameter model is superior to the single-rate parameter model. We could formally test this hypothesis using AIC or the likelihood ratio test (with one degree of freedom).</span> </td> </tr> <tr> <td> Line 105: </td> <td> Line 105: </td> </tr> <tr> <td> <span>-</span> 7. Now that we have a rough idea of what our data <span>is </span>look<span>ing</span> like, let's move to MCMC world. <span>Kick things off by rerunning your dataset</span> {{{./BayesTraits Adox.trees Adox_trait1.txt}}}. As <span>we've done </span>before, we're going to select Multistate. However, when we get the next prompt, we're going to choose option 2 (MCMC) rather than option 1 (Maximum Likelihood). When you do this, you get different information on your starting parameters that you do with Maximum Likelihood: </td> <td> <span>+</span> 7. Now that we have a rough idea of what our data look like, let's move to MCMC world. <span>Let's get started with this analysis</span> {{{./BayesTraits Adox.trees Adox_trait1.txt}}}. As before, we're going to select Multistate. However, when we get the next prompt, we're going to choose option 2 (MCMC) rather than option 1 (Maximum Likelihood). When you do this, you get different information on your starting parameters that you do with Maximum Likelihood: </td> </tr> <tr> <td> Line 153: </td> <td> Line 153: </td> </tr> <tr> <td> <span>- Note that this output includes the iteration in the left column as well as the Harmonic Mean -lnL, which we'll need later to calculate Bayes Factor scores. We are also told which tree is being investigated at each iteration. Note that our likelihood scores are considerably worse than they were previously. We should also notice that our rate parameters are ridiculously high and that the acceptance ratio is really bad (&gt;90%). To solve these problems, we're going to tweak the prior and the Rate Dev parameter. All else being equal, we expect higher Rate Dev values to result in lower acceptance rates because they will lead to bigger changes in the rate coefficient from one generation to the next.</span> </td> <td> <span>+ Note that this output includes the iteration in the left column as well as the Harmonic Mean estimate of the marginal log likelihood that we'll need later to calculate Bayes Factor scores. We are also told which tree is being investigated at each iteration. Note that our likelihood scores are considerably worse than they were previously, that's not surprising because we are no longer maximizing the likelihood. We should also notice that our rate parameters are ridiculously high and that the acceptance rate is too high (&gt;90%; we'd like the acceptance rates to be in the range of ~20-40%). To try to address this, we're going to change the prior (from a uniform [0,100] to a uniform [0,1]). This prior is more reasonable in light of the range of MLE values for these parameters (that would make this an 'empirical prior'--one that is informed by a ML 'peek at the data.<br> + <br> + <br> + <br> + **** for for the ]to an exponential) and the magnitude of proposed changes to the transition rates (i.e., Rate Dev parameter). All else being equal, we expect higher Rate Dev values to result in lower acceptance rates because they will propose larger changes to the rate parameters.</span> </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-11 21:03:35glor <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p>No differences found!</div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-11 20:56:49glor <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 20: </td> <td> Line 20: </td> </tr> <tr> <td> <span>-</span> [[Image(profile.jpg)]] </td> <td> <span>+</span> [[Image(profile<span>_fixed</span>.jpg)]] </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-11 20:56:24glorUpload of image <a href="http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%29?action=Files&do=view&target=profile_fixed.jpg">profile_fixed.jpg</a>.BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-11 20:55:36glorUpload of image <a href="http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%29?action=Files&do=view&target=profile.jpg">profile.jpg</a>.BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-11 20:55:36glorImage <a href="http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%29?action=Files&do=view&target=profile.jpg">profile.jpg</a> deleted.BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-11 20:55:10glor <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 20: </td> <td> Line 20: </td> </tr> <tr> <td> <span>-</span> [[<span>i</span>mage(profile.jpg)]] </td> <td> <span>+</span> [[<span>I</span>mage(profile.jpg)]] </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-11 20:54:59glorUpload of image <a href="http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%29?action=Files&do=view&target=profile.jpg">profile.jpg</a>.BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-11 20:54:59glorImage <a href="http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%29?action=Files&do=view&target=profile.jpg">profile.jpg</a> deleted.BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-11 20:52:25glor <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 18: </td> <td> Line 18: </td> </tr> <tr> <td> <span>-</span> We're also going to put the BayesTraits directory in our path. By putting BayesTraits in our path, we're able to tell Terminal where to look for the program. This might seem like a nuisance, but it's going to save us some trouble in the longrun by permitting us to run BayesTraits from anywhere on our computer. To put BayesTraits in our path, you need to open the Terminal application and type {{{vi .profile}}}. This opens a file called ".profile" in the vi editor. Once ".profile" is open, type "i" to begin editing (you should see "--Insert--" at the bottom of the Terminal window). Now simply type {{{export PATH="$PATH:Applications/BayesTraits/BayesTraits<span>"}}} to add BayesTraits to your path and</span> close the ".profile" file by typing {{{:wq}}}. </td> <td> <span>+</span> We're also going to put the BayesTraits directory in our path. By putting BayesTraits in our path, we're able to tell Terminal where to look for the program. This might seem like a nuisance, but it's going to save us some trouble in the longrun by permitting us to run BayesTraits from anywhere on our computer. To put BayesTraits in our path, you need to open the Terminal application and type {{{vi .profile}}}. This opens a file called ".profile" in the vi editor. Once ".profile" is open, type "i" to begin editing (you should see "--Insert--" at the bottom of the Terminal window). Now simply type {{{export PATH="$PATH:<span>/</span>Applications/BayesTraits/<span>"}}} to add </span>BayesTraits<span>&nbsp;to your path. When finished, press {{{esc}}} to stop editing and then</span> close the ".profile" file by typing {{{:wq}}}. </td> </tr> <tr> <td> Line 22: </td> <td> Line 22: </td> </tr> <tr> <td> <span>- 2</span>. We're now ready to open BayesTraits and the relevant data. We're going to kick things off with a reconstruction of growth form in plants. We're going to focus in on reconstructing two alternative growth forms: (0) woody, and (1) herbaceous. The character data is stored in a comma delimited text file: {{{Adox_trait1.txt}}}. The trees for this analysis, meanwhile, are going to come from the posterior distribution of an analysis in BEAST: {{{Adox.trees}}}. BayesTraits requires a rooted tree with branch lengths. <span>We need to s</span>p<span>ecify</span> both the tree and the dataset when we call BayesTraits: </td> <td> <span>+ 3</span>. We're now ready to open BayesTraits and the relevant data. We're going to kick things off with a reconstruction of growth form in plants. We're going to focus in on reconstructing two alternative growth forms: (0) woody, and (1) herbaceous. The character data is stored in a comma delimited text file: {{{Adox_trait1.txt}}}. The trees for this analysis, meanwhile, are going to come from the posterior distribution of an analysis in BEAST: {{{Adox.trees}}}. BayesTraits requires a rooted tree with branch lengths. <span>Move both of these files to your BayesTraits folder and navigate to this folder in the Terminal by ty</span>p<span>ing {{{cd ../../Applications/BayesTraits}}}. Now we're ready to run BayesTraits and we can do so</span> b<span>y specifying b</span>oth the tree and the dataset when we call BayesTraits: </td> </tr> <tr> <td> Line 26: </td> <td> Line 26: </td> </tr> <tr> <td> <span>-</span> <span>3</span>. If your data has loaded successfully you should see the following text: </td> <td> <span>+</span> <span>4</span>. If your data has loaded successfully you should see the following text: </td> </tr> <tr> <td> Line 36: </td> <td> Line 36: </td> </tr> <tr> <td> <span>-</span> This is BayesTraits' way of prompting us to select the type of analysis we'd like to do. Although we're dealing with binary trait, we're going to select the Multistate option because the Discrete option in BayesTraits is designed to investigate character correlations and requires two characters with binary coding (we have only one character with binary coding in our<span>&nbsp;Anolis biogeography</span> dataset). Type {{{1}}} and hit enter to choose the Multistate option. </td> <td> <span>+</span> This is BayesTraits' way of prompting us to select the type of analysis we'd like to do. Although we're dealing with <span>a </span>binary trait, we're going to select the Multistate option because the Discrete option in BayesTraits is designed to investigate character correlations and requires two characters with binary coding (we have only one character with binary coding in our dataset). Type {{{1}}} and hit enter to choose the Multistate option. </td> </tr> <tr> <td> Line 38: </td> <td> Line 38: </td> </tr> <tr> <td> <span>-</span> <span>4</span>. We're now prompted to choose whether we want to do Maximum Likelihood or Bayesian MCMC: </td> <td> <span>+</span> <span>5</span>. We're now prompted to choose whether we want to do Maximum Likelihood or Bayesian MCMC: </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-11 20:30:19glor <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 14: </td> <td> Line 14: </td> </tr> <tr> <td> <span>-</span> 2. Although BayesTraits is available for both Macs and PCs, this tutorial will focus on the Mac OSX version. If you're using a PC you should be able to follow along if you're willing to work through a few tweaks. In OSX, BayesTraits is run through the Terminal application. As with any Terminal-based application, we need to pay careful attention to where on our computer we put the program and associated files. We're going to put the BayesTraits folder in the Applications folder. Because your computer likely has multiple Applications folders, you should be sure to put it in the one that is found in your root directory (the simplest way to get to this directory is to click the Applications link in the Favorites menu that appears in the Finder window (see below). </td> <td> <span>+</span> 2. Although BayesTraits is available for both Macs and PCs, this tutorial will focus on the Mac OSX version. If you're using a PC you should be able to follow along if you're willing to work through a few tweaks. In OSX, BayesTraits is run through the Terminal application. As with any Terminal-based application, we need to pay careful attention to where on our computer we put the program and associated files. We're going to put the BayesTraits folder in the Applications folder. Because your computer likely has multiple Applications folders, you should be sure to put it in the one that is found in your root directory (the simplest way to get to this directory is to click the Applications link in the Favorites menu that appears in the Finder window (see below)<span>)</span>. </td> </tr> <tr> <td> Line 16: </td> <td> Line 16: </td> </tr> <tr> <td> <span>- [image(Applications.jpg)]</span> </td> <td> <span>+ [[image(Applications.jpg)]]<br> + <br> + We're also going to put the BayesTraits directory in our path. By putting BayesTraits in our path, we're able to tell Terminal where to look for the program. This might seem like a nuisance, but it's going to save us some trouble in the longrun by permitting us to run BayesTraits from anywhere on our computer. To put BayesTraits in our path, you need to open the Terminal application and type {{{vi .profile}}}. This opens a file called ".profile" in the vi editor. Once ".profile" is open, type "i" to begin editing (you should see "--Insert--" at the bottom of the Terminal window). Now simply type {{{export PATH="$PATH:Applications/BayesTraits/BayesTraits"}}} to add BayesTraits to your path and close the ".profile" file by typing {{{:wq}}}.<br> + <br> + [[image(profile.jpg)]]</span> </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-11 20:21:17glor <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 14: </td> <td> Line 14: </td> </tr> <tr> <td> <span>-</span> 2. Although BayesTraits is available for both Macs and PCs, this tutorial will focus on the Mac OSX version. If you're using a PC you should be able to follow along if you're willing to work through a few tweaks. In OSX, BayesTraits is run through the Terminal application. As with any Terminal-based application, we need to pay careful attention to where on our computer we put the program and associated files. </td> <td> <span>+</span> 2. Although BayesTraits is available for both Macs and PCs, this tutorial will focus on the Mac OSX version. If you're using a PC you should be able to follow along if you're willing to work through a few tweaks. In OSX, BayesTraits is run through the Terminal application. As with any Terminal-based application, we need to pay careful attention to where on our computer we put the program and associated files.<span>&nbsp;&nbsp;We're going to put the BayesTraits folder in the Applications folder. Because your computer likely has multiple Applications folders, you should be sure to put it in the one that is found in your root directory (the simplest way to get to this directory is to click the Applications link in the Favorites menu that appears in the Finder window (see below).<br> + <br> + [image(Applications.jpg)]</span> </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-11 20:16:51glor <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 12: </td> <td> Line 12: </td> </tr> <tr> <td> <span>- NOTE: This new tutorial is currently under development.</span> </td> <td> <span>+ 1. Download [http://www.evolution.rdg.ac.uk/BayesTraits.html BayesTraits] and uncompress the resulting file.</span> </td> </tr> <tr> <td> Line 14: </td> <td> Line 14: </td> </tr> <tr> <td> <span>- 1. We first need to navigate to the BayesTraits folder. I put my BayesTraits folder on my Desktop, making it easy to get there by typing the following command at the Terminal prompt:<br> - <br> - {{{cd Desktop/BayesTraits/}}}</span> </td> <td> <span>+ 2. Although BayesTraits is available for both Macs and PCs, this tutorial will focus on the Mac OSX version. If you're using a PC you should be able to follow along if you're willing to work through a few tweaks. In OSX, BayesTraits is run through the Terminal application. As with any Terminal-based application, we need to pay careful attention to where on our computer we put the program and associated files.</span> </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-11 16:01:43glorUpload of image <a href="http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%29?action=Files&do=view&target=profile.jpg">profile.jpg</a>.BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-11 15:56:22glorUpload of image <a href="http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%29?action=Files&do=view&target=Applications.jpg">Applications.jpg</a>.BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292012-03-11 15:53:56glorUpload of file <a href="http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%29?action=Files&do=view&target=Applications.tiff">Applications.tiff</a>.BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 18:11:50 <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 85: </td> <td> Line 85: </td> </tr> <tr> <td> <span>-</span> 6. Before we leave likelihood land, lets see if the observed difference between the two rate parameters is something we should be concerned with. To do this we're going to re-run our analysis after requiring that the two parameters are equal to one another. To do this, we're going to use the command {{{restrict q01 q10}}} (just before entering run). We can confirm that this operation was successful by typing {{{info}}}. We should now see that q01 is restricted to be the same as q10 while q10 has no restrictions. Let's now re-run the analysis by typing {{{run}}}. The first ML scores for the first 10 trees look something like this: </td> <td> <span>+</span> 6. Before we leave likelihood land, lets see if the observed difference between the two rate parameters is something we should be concerned with. To do this we're going to re-run our analysis after requiring that the two parameters are equal to one another. To do this, we're going to use the command {{{restrict q01 q10}}} (just before entering run)<span>, remember you have to specify the matrix, data and parameters for each run</span>. We can confirm that this operation was successful by typing {{{info}}}. We should now see that q01 is restricted to be the same as q10 while q10 has no restrictions. Let's now re-run the analysis by typing {{{run}}}. The first ML scores for the first 10 trees look something like this: </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 18:09:05 <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 18: </td> <td> Line 18: </td> </tr> <tr> <td> <span>-</span> 2. We're no<span>t</span> ready to open BayesTraits and the relevant data. We're going to kick things off with a reconstruction of growth form in plants. We're going to focus in on reconstructing two alternative growth forms: (0) woody, and (1) herbaceous. The character data is stored in a comma delimited text file: {{{Adox_trait1.txt}}}. The trees for this analysis, meanwhile, are going to come from the posterior distribution of an analysis in BEAST: {{{Adox.trees}}}. BayesTraits requires a rooted tree with branch lengths. We need to specify both the tree and the dataset when we call BayesTraits: </td> <td> <span>+</span> 2. We're no<span>w</span> ready to open BayesTraits and the relevant data. We're going to kick things off with a reconstruction of growth form in plants. We're going to focus in on reconstructing two alternative growth forms: (0) woody, and (1) herbaceous. The character data is stored in a comma delimited text file: {{{Adox_trait1.txt}}}. The trees for this analysis, meanwhile, are going to come from the posterior distribution of an analysis in BEAST: {{{Adox.trees}}}. BayesTraits requires a rooted tree with branch lengths. We need to specify both the tree and the dataset when we call BayesTraits: </td> </tr> <tr> <td> Line 170: </td> <td> Line 170: </td> </tr> <tr> <td> <span>-</span> 10. Even though we're getting good parameter estimates, our mixing is a bit low (&lt;20%). Let's try to improve mixing by reducing the RateDev parameter. Let's try going from 2 to 0.1. If we do this, we find that we have good mixing by the end of the analysis, but that we have yet to reach stationarity by the previously set burn-in. In this case, therefore, we're going to need to increase the burn-in point to ensure adequate mixing. </td> <td> <span>+</span> 10. Even though we're getting good parameter estimates, our mixing is a bit low (&lt;20%). Let's try to improve mixing by reducing the RateDev parameter. Let's try going from 2 to 0.1<span>&nbsp;{{{RateDev 0.1}}}</span>. If we do this, we find that we have good mixing by the end of the analysis, but that we have yet to reach stationarity by the previously set burn-in. In this case, therefore, we're going to need to increase the burn-in point to ensure adequate mixing. </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 18:08:05 <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 190: </td> <td> Line 190: </td> </tr> <tr> <td> <span>-</span> 11. Suppose we are particularly interested in knowing what the growth form was at the root of our tree. As we've already seen, our analyses strongly favor a herbaceous growth form at the root. We can assess how well supported this outcome is by using the {{{fossil}}} command. By fixing the state at each possible alternative and running the analysis, we can compare the resulting Bayes Factor scores to generate an estimate for the relative support of each alternative hypothesis. Let's fix the root to be a woody form {{{Fossil root 0 1 12}}}, ie set the root to state 0 (<span>herbaceous</span>) between taxa number 1 and 12. The syntax here requires that fossil [node name] [state to fix] [taxon numbers]. Once this operation is complete, we can re-run a second time after fixing a root state of 1. Compare the resulting Harmonic mean likelihoods to see how well supported each alternative state is. </td> <td> <span>+</span> 11. Suppose we are particularly interested in knowing what the growth form was at the root of our tree. As we've already seen, our analyses strongly favor a herbaceous growth form at the root. We can assess how well supported this outcome is by using the {{{fossil}}} command. By fixing the state at each possible alternative and running the analysis, we can compare the resulting Bayes Factor scores to generate an estimate for the relative support of each alternative hypothesis. Let's fix the root to be a woody form {{{Fossil root 0 1 12}}}, ie set the root to state 0 (<span>woody</span>) between taxa number 1 and 12. The syntax here requires that fossil [node name] [state to fix] [taxon numbers]. Once this operation is complete, we can re-run a second time after fixing a root state of 1. Compare the resulting Harmonic mean likelihoods to see how well supported each alternative state is. </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 18:07:25 <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 190: </td> <td> Line 190: </td> </tr> <tr> <td> <span>-</span> 11. Suppose we are particularly interested in knowing what the growth form was at the root of our tree. As we've already seen, our analyses strongly favor a herbaceous growth form at the root. We can assess how well supported this outcome is by using the {{{fossil}}} command. By fixing the state at each possible alternative and running the analysis, we can compare the resulting Bayes Factor scores to generate an estimate for the relative support of each alternative hypothesis. Let's fix the root to be a woody form {{{Fossil root 0 1 <span>53</span>}}}. The syntax here requires that fossil [node name] [state to fix] [taxon numbers]. Once this operation is complete, we can re-run a second time after fixing a root state of 1. Compare the resulting Harmonic mean likelihoods to see how well supported each alternative state is. </td> <td> <span>+</span> 11. Suppose we are particularly interested in knowing what the growth form was at the root of our tree. As we've already seen, our analyses strongly favor a herbaceous growth form at the root. We can assess how well supported this outcome is by using the {{{fossil}}} command. By fixing the state at each possible alternative and running the analysis, we can compare the resulting Bayes Factor scores to generate an estimate for the relative support of each alternative hypothesis. Let's fix the root to be a woody form {{{Fossil root 0 1 <span>12</span>}}}<span>, ie set the root to state 0 (herbaceous) between taxa number 1 and 12</span>. The syntax here requires that fossil [node name] [state to fix] [taxon numbers]. Once this operation is complete, we can re-run a second time after fixing a root state of 1. Compare the resulting Harmonic mean likelihoods to see how well supported each alternative state is. </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 18:00:55(quick edit) <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 85: </td> <td> Line 85: </td> </tr> <tr> <td> <span>-</span> 6. Before we leave likelihood land, lets see if the observed difference between the two rate parameters is something we should be concerned with. To do this we're going to re-run our analysis after requiring that the two parameters are equal to one another. To do this, we're going to use the command {{{restrict q01 q10}}}. We can confirm that this operation was successful by typing {{{info}}}. We should now see that q01 is restricted to be the same as q10 while q10 has no restrictions. Let's now re-run the analysis by typing {{{run}}}. The first ML scores for the first 10 trees look something like this: </td> <td> <span>+</span> 6. Before we leave likelihood land, lets see if the observed difference between the two rate parameters is something we should be concerned with. To do this we're going to re-run our analysis after requiring that the two parameters are equal to one another. To do this, we're going to use the command {{{restrict q01 q10}}}<span>&nbsp;(just before entering run)</span>. We can confirm that this operation was successful by typing {{{info}}}. We should now see that q01 is restricted to be the same as q10 while q10 has no restrictions. Let's now re-run the analysis by typing {{{run}}}. The first ML scores for the first 10 trees look something like this: </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 18:00:52 <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 190: </td> <td> Line 190: </td> </tr> <tr> <td> <span>-</span> 11. Suppose we are particularly interested in knowing what the growth form was at the root of our tree. As we've already seen, our analyses strongly favor a herbaceous growth form at the root. We can assess how well supported this outcome is by using the {{{fossil}}} command. By fixing the state at each possible alternative and running the analysis, we can compare the resulting Bayes Factor scores to generate an estimate for the relative support of each alternative hypothesis. Let's fix the root to be a woody form {{{Fossil root 0 1 <span>187</span>}}}. The syntax here requires that fossil [node name] [state to fix] [taxon numbers]. Once this operation is complete, we can re-run a second time after fixing a root state of 1. Compare the resulting Harmonic mean likelihoods to see how well supported each alternative state is. </td> <td> <span>+</span> 11. Suppose we are particularly interested in knowing what the growth form was at the root of our tree. As we've already seen, our analyses strongly favor a herbaceous growth form at the root. We can assess how well supported this outcome is by using the {{{fossil}}} command. By fixing the state at each possible alternative and running the analysis, we can compare the resulting Bayes Factor scores to generate an estimate for the relative support of each alternative hypothesis. Let's fix the root to be a woody form {{{Fossil root 0 1 <span>53</span>}}}. The syntax here requires that fossil [node name] [state to fix] [taxon numbers]. Once this operation is complete, we can re-run a second time after fixing a root state of 1. Compare the resulting Harmonic mean likelihoods to see how well supported each alternative state is. </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 18:00:43(quick edit) <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p>No differences found!</div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 17:58:41(quick edit) <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 190: </td> <td> Line 190: </td> </tr> <tr> <td> <span>-</span> 11. Suppose we are particularl interested in knowing what the growth form was at the root of our tree. As we've already seen, our analyses strongly favor a herbaceous growth form at the root. We can assess how well supported this outcome is by using the {{{fossil}}} command. By fixing the state at each possible alternative and running the analysis, we can compare the resulting Bayes Factor scores to generate an estimate for the relative support of each alternative hypothesis. Let's fix the root to be a woody form {{{Fossil root 0 1 187}}}. The syntax here requires that fossil [node name] [state to fix] [taxon numbers]. Once this operation is complete, we can re-run a second time after fixing a root state of 1. Compare the resulting Harmonic mean likelihoods to see how well supported each alternative state is. </td> <td> <span>+</span> 11. Suppose we are particularl<span>y</span> interested in knowing what the growth form was at the root of our tree. As we've already seen, our analyses strongly favor a herbaceous growth form at the root. We can assess how well supported this outcome is by using the {{{fossil}}} command. By fixing the state at each possible alternative and running the analysis, we can compare the resulting Bayes Factor scores to generate an estimate for the relative support of each alternative hypothesis. Let's fix the root to be a woody form {{{Fossil root 0 1 187}}}. The syntax here requires that fossil [node name] [state to fix] [taxon numbers]. Once this operation is complete, we can re-run a second time after fixing a root state of 1. Compare the resulting Harmonic mean likelihoods to see how well supported each alternative state is. </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 17:57:08(quick edit) <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 132: </td> <td> Line 132: </td> </tr> <tr> <td> <span>-</span> 8. We're also going to reduce the number of iterations so that things run a bit faster than they would otherwise. Let's drop down to 100,000 iterations by typing {{{<span>iternation</span> 100000}}}. We're going to begin by leaving the prior parameters at their default settings for now and simply run the analysis with uniform rate priors by typing {{{run}}}. The first few lines of the resulting output should look something like this: </td> <td> <span>+</span> 8. We're also going to reduce the number of iterations so that things run a bit faster than they would otherwise. Let's drop down to 100,000 iterations by typing {{{<span>Iterations</span> 100000}}}. We're going to begin by leaving the prior parameters at their default settings for now and simply run the analysis with uniform rate priors by typing {{{run}}}. The first few lines of the resulting output should look something like this: </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 17:56:12(quick edit) <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 83: </td> <td> Line 83: </td> </tr> <tr> <td> <span>-</span> Let's focus on several patterns evident in these results. First, we should see that all of our trees produce similar log likelihoods. This is good news, as it suggests that variation among the trees in our posterior distribution is not having a strong impact on inference. Second, the rate for transitions from the woody to herbaceous (q01 = 0.000) is much lower than that of herbaceous to woody (q10 = 0.018-0.022). Finally, the probability of an herbaceous state at the root is substantially higher than the probability of a <span>mainland</span> state at the root (0.000 v. 1.000). </td> <td> <span>+</span> Let's focus on several patterns evident in these results. First, we should see that all of our trees produce similar log likelihoods. This is good news, as it suggests that variation among the trees in our posterior distribution is not having a strong impact on inference. Second, the rate for transitions from the woody to herbaceous (q01 = 0.000) is much lower than that of herbaceous to woody (q10 = 0.018-0.022). Finally, the probability of an herbaceous state at the root is substantially higher than the probability of a <span>woody</span> state at the root (0.000 v. 1.000). </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 17:54:18(quick edit) <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 66: </td> <td> Line 66: </td> </tr> <tr> <td> <span>-</span> Most of the information we're seeing here has a pretty intuitive interpretation. We have 501 trees with 63 taxa in each tree and 1 character (or site) with two states (i.e., a binary character). We're currently working with two different transition parameters, one for transitions from herbaceous<span>&nbsp;to woody</span> (q01) and another for transitions between <span>woody and </span>herbaceous (q10). Let's kick things off by running a basic ML search with two rate parameters the other default settings. When doing Maximum Likelihood analyses on a set of more than 1 tree, BayesTraits is going to provide results calculated independently for each of the 501 trees in our dataset. To run your analysis, simply type {{{run}}}. </td> <td> <span>+</span> Most of the information we're seeing here has a pretty intuitive interpretation. We have 501 trees with 63 taxa in each tree and 1 character (or site) with two states (i.e., a binary character). We're currently working with two different transition parameters, one for transitions from <span>woody to </span>herbaceous (q01) and another for transitions between herbaceous<span>&nbsp;and woody</span> (q10). Let's kick things off by running a basic ML search with two rate parameters the other default settings. When doing Maximum Likelihood analyses on a set of more than 1 tree, BayesTraits is going to provide results calculated independently for each of the 501 trees in our dataset. To run your analysis, simply type {{{run}}}. </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 17:51:36(quick edit) <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 66: </td> <td> Line 66: </td> </tr> <tr> <td> <span>-</span> Most of the information we're seeing here has a pretty intuitive interpretation. We have 501 trees with 63 taxa in each tree and 1 character (or site) with two states (i.e., a binary character). We're currently working with two different transition parameters, one for transitions from <span>the islands to the mainland</span> (q01) and another for transitions between <span>island and mainland</span> (q10). Let's kick things off by running a basic ML search with two rate parameters the other default settings. When doing Maximum Likelihood analyses on a set of more than 1 tree, BayesTraits is going to provide results calculated independently for each of the 501 trees in our dataset. To run your analysis, simply type {{{run}}}. </td> <td> <span>+</span> Most of the information we're seeing here has a pretty intuitive interpretation. We have 501 trees with 63 taxa in each tree and 1 character (or site) with two states (i.e., a binary character). We're currently working with two different transition parameters, one for transitions from <span>herbaceous to woody</span> (q01) and another for transitions between <span>woody and herbaceous</span> (q10). Let's kick things off by running a basic ML search with two rate parameters the other default settings. When doing Maximum Likelihood analyses on a set of more than 1 tree, BayesTraits is going to provide results calculated independently for each of the 501 trees in our dataset. To run your analysis, simply type {{{run}}}. </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 17:50:54EduardoCastro(quick edit) <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p>No differences found!</div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 17:50:54EduardoCastro(quick edit) <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 99: </td> <td> Line 99: </td> </tr> <tr> <td> <span>-</span> The fact that the resulting negative log likelihoods are considerabl worse in this case suggests that the two rate parameter model is superior to the single rate parameter model. We can formally test this hypothesis using AIC or the likelihood ratio test. </td> <td> <span>+</span> The fact that the resulting negative log likelihoods are considerabl<span>e</span> worse in this case suggests that the two rate parameter model is superior to the single rate parameter model. We can formally test this hypothesis using AIC or the likelihood ratio test. </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 17:49:10(quick edit) <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 132: </td> <td> Line 132: </td> </tr> <tr> <td> <span>-</span> 8. We're also going to reduce the number of iterations so that things run a bit faster than they would otherwise. Let's drop down to 100,000 iter<span>n</span>ations by typing {{{iternation 100000}}}. We're going to begin by leaving the prior parameters at their default settings for now and simply run the analysis with uniform rate priors by typing {{{run}}}. The first few lines of the resulting output should look something like this: </td> <td> <span>+</span> 8. We're also going to reduce the number of iterations so that things run a bit faster than they would otherwise. Let's drop down to 100,000 iterations by typing {{{iternation 100000}}}. We're going to begin by leaving the prior parameters at their default settings for now and simply run the analysis with uniform rate priors by typing {{{run}}}. The first few lines of the resulting output should look something like this: </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 17:41:56(quick edit) <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 132: </td> <td> Line 132: </td> </tr> <tr> <td> <span>-</span> 8. We're also going to reduce the number of iterations so that things run a bit faster than they would otherwise. Let's drop down to 100,000 iternation by typing {{{iternation 100000}}}. We're going to begin by leaving the prior parameters at their default settings for now and simply run the analysis with uniform rate priors by typing {{{run}}}. The first few lines of the resulting output should look something like this: </td> <td> <span>+</span> 8. We're also going to reduce the number of iterations so that things run a bit faster than they would otherwise. Let's drop down to 100,000 iternation<span>s</span> by typing {{{iternation 100000}}}. We're going to begin by leaving the prior parameters at their default settings for now and simply run the analysis with uniform rate priors by typing {{{run}}}. The first few lines of the resulting output should look something like this: </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 17:41:12EduardoCastro(quick edit) <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p>No differences found!</div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 17:40:44 <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 80: </td> <td> Line 80: </td> </tr> <tr> <td> <span>-</span> 10 -10.494423 0.000000 0.020988 0.000000 1.000000 </td> <td> <span>+</span> 10 -10.494423 0.000000 0.020988 0.000000 1.000000<span>}}}</span> </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 17:35:29EduardoCastro(quick edit) <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 32: </td> <td> Line 32: </td> </tr> <tr> <td> <span>-</span> This is BayesTraits' way of prompting us to select the type of analysis we'd like to do. Although we're dealing with binary trait, we're going to select the Multistate option because the Discrete option in BayesTraits is designed to investigate character correlations and requires two characters with binary coding<span>m</span> (we have only one character with binary coding in our Anolis biogeography dataset). Type {{{1}}} and hit enter to choose the Multistate option. </td> <td> <span>+</span> This is BayesTraits' way of prompting us to select the type of analysis we'd like to do. Although we're dealing with binary trait, we're going to select the Multistate option because the Discrete option in BayesTraits is designed to investigate character correlations and requires two characters with binary coding (we have only one character with binary coding in our Anolis biogeography dataset). Type {{{1}}} and hit enter to choose the Multistate option. </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 17:09:06(quick edit) <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 20: </td> <td> Line 20: </td> </tr> <tr> <td> <span>-</span> {{{./BayesTraits Adox.trees Adox<span>_</span>trait1.txt}}} </td> <td> <span>+</span> {{{./BayesTraits Adox.trees Adox<span>.</span>trait1.txt}}} </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 12:41:31glor <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 11: </td> <td> Line 11: </td> </tr> <tr> <td> </td> <td> <span>+ <br> + NOTE: This new tutorial is currently under development.</span> </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 12:40:44glor <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 2: </td> <td> Line 2: </td> </tr> <tr> <td> <span>-</span> ||["glor" Rich Glor]|| </td> <td> <span>+</span> ||["<span>Users/</span>glor" Rich Glor]|| </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 12:40:31glor <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 2: </td> <td> Line 2: </td> </tr> <tr> <td> <span>-</span> ||["<span>Rich G</span>lor" Rich Glor]|| </td> <td> <span>+</span> ||["<span>g</span>lor" Rich Glor]|| </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 12:39:56glorUpload of file <a href="http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%29?action=Files&do=view&target=Adox.trees">Adox.trees</a>.BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 12:39:46glor <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 8: </td> <td> Line 8: </td> </tr> <tr> <td> <span>-</span> ||This tutorial uses two example data file|| </td> <td> <span>+</span> ||This tutorial uses two example data file<span>s</span>|| </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 12:39:13glor <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p>No differences found!</div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 12:39:01glorUpload of file <a href="http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%29?action=Files&do=view&target=Adox.trait1.txt">Adox.trait1.txt</a>.BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 12:38:26glor <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ ||&lt;bgcolor='#E0E0FF'&gt;'''Primary Contact(s)'''||<br> + ||["Rich Glor" Rich Glor]||<br> + ||&lt;bgcolor='#E0E0FF'&gt;'''Created'''||<br> + ||8 March 2011||<br> + ||&lt;bgcolor='#E0E0FF'&gt;'''Required Software'''||<br> + ||[http://www.evolution.rdg.ac.uk/BayesTraits.html BayesTraits]||<br> + ||&lt;bgcolor='#E0E0FF'&gt;'''Example Datafile'''||<br> + ||This tutorial uses two example data file||<br> + ||[[File(Adox.trees)]]||<br> + ||[[File(Adox.trait1.txt)]]||</span> </td> </tr> </table> </div> BayesTraits with Discrete Traits (Glor)http://bodegaphylo.wikispot.org/BayesTraits_with_Discrete_Traits_%28Glor%292011-03-08 12:35:23glor <div id="content" class="wikipage content"> Differences for BayesTraits with Discrete Traits (Glor)<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ <br> + 1. We first need to navigate to the BayesTraits folder. I put my BayesTraits folder on my Desktop, making it easy to get there by typing the following command at the Terminal prompt:<br> + <br> + {{{cd Desktop/BayesTraits/}}}<br> + <br> + 2. We're not ready to open BayesTraits and the relevant data. We're going to kick things off with a reconstruction of growth form in plants. We're going to focus in on reconstructing two alternative growth forms: (0) woody, and (1) herbaceous. The character data is stored in a comma delimited text file: {{{Adox_trait1.txt}}}. The trees for this analysis, meanwhile, are going to come from the posterior distribution of an analysis in BEAST: {{{Adox.trees}}}. BayesTraits requires a rooted tree with branch lengths. We need to specify both the tree and the dataset when we call BayesTraits:<br> + <br> + {{{./BayesTraits Adox.trees Adox_trait1.txt}}}<br> + <br> + 3. If your data has loaded successfully you should see the following text:<br> + <br> + {{{Rand Seed 1299555524<br> + Please Select the model of evolution to use.<br> + 1) MultiState.<br> + 2) Discrete: Independent<br> + 3) Discrete: Depend<br> + 4) Continuous: Random Walk (Model A)<br> + 5) Continuous: Directional (Model B)}}}<br> + <br> + This is BayesTraits' way of prompting us to select the type of analysis we'd like to do. Although we're dealing with binary trait, we're going to select the Multistate option because the Discrete option in BayesTraits is designed to investigate character correlations and requires two characters with binary codingm (we have only one character with binary coding in our Anolis biogeography dataset). Type {{{1}}} and hit enter to choose the Multistate option.<br> + <br> + 4. We're now prompted to choose whether we want to do Maximum Likelihood or Bayesian MCMC:<br> + <br> + {{{Please Select the analsis method to use.<br> + 1) Maximum Likelihood.<br> + 2) MCMC}}}<br> + <br> + We're going to start with ML analyses, even though our ultimate goal is to use Bayesian inference. We're doing this because ML can provide us with a reasonable first approximation of the rate coefficient(s) that might be useful for optimizing our priors for the Bayesian analysis. Type {{{1}}} and hit enter to initiate your Maximum Likelihood analyses.<br> + <br> + 5. BayesTraits should now provide us with some basic information about our dataset and model settings:<br> + <br> + {{{Options:<br> + Options:<br> + Model: Multistates<br> + Tree File Name: Adox.trees<br> + Data File Name: Adox_trait1.txt<br> + Log File Name: Adox_trait1.txt.log.txt<br> + Summary: False<br> + Analsis Type: Maximum Likelihood<br> + ML attempt per tree: 10<br> + No of Rates: 2<br> + Base frequency (PI's) None<br> + Character Symbols 0,1<br> + Using a covarion model: False<br> + Restrictions:<br> + q01 None<br> + q10 None<br> + Tree Information<br> + Trees: 501<br> + Taxa: 63<br> + Sites: 1<br> + States: 2}}}<br> + <br> + Most of the information we're seeing here has a pretty intuitive interpretation. We have 501 trees with 63 taxa in each tree and 1 character (or site) with two states (i.e., a binary character). We're currently working with two different transition parameters, one for transitions from the islands to the mainland (q01) and another for transitions between island and mainland (q10). Let's kick things off by running a basic ML search with two rate parameters the other default settings. When doing Maximum Likelihood analyses on a set of more than 1 tree, BayesTraits is going to provide results calculated independently for each of the 501 trees in our dataset. To run your analysis, simply type {{{run}}}.<br> + <br> + Output for the first 10 trees in our sample should look something like this:<br> + <br> + {{{Tree No Lh q01 q10 Root P(0) Root P(1)<br> + 1 -9.727674 0.000000 0.017002 0.000000 1.000000<br> + 2 -10.138425 0.000000 0.018218 0.000000 1.000000<br> + 3 -10.311666 0.000000 0.017754 0.000000 1.000000<br> + 4 -10.437176 0.000000 0.020893 0.000000 1.000000<br> + 5 -9.824290 0.000000 0.017578 0.000000 1.000000<br> + 6 -9.924709 0.000000 0.019461 0.000000 1.000000<br> + 7 -10.249299 0.000000 0.020936 0.000000 1.000000<br> + 8 -10.254006 0.000000 0.022155 0.000000 1.000000<br> + 9 -10.257945 0.000000 0.020684 0.000000 1.000000<br> + 10 -10.494423 0.000000 0.020988 0.000000 1.000000<br> + <br> + <br> + Let's focus on several patterns evident in these results. First, we should see that all of our trees produce similar log likelihoods. This is good news, as it suggests that variation among the trees in our posterior distribution is not having a strong impact on inference. Second, the rate for transitions from the woody to herbaceous (q01 = 0.000) is much lower than that of herbaceous to woody (q10 = 0.018-0.022). Finally, the probability of an herbaceous state at the root is substantially higher than the probability of a mainland state at the root (0.000 v. 1.000).<br> + <br> + 6. Before we leave likelihood land, lets see if the observed difference between the two rate parameters is something we should be concerned with. To do this we're going to re-run our analysis after requiring that the two parameters are equal to one another. To do this, we're going to use the command {{{restrict q01 q10}}}. We can confirm that this operation was successful by typing {{{info}}}. We should now see that q01 is restricted to be the same as q10 while q10 has no restrictions. Let's now re-run the analysis by typing {{{run}}}. The first ML scores for the first 10 trees look something like this:<br> + <br> + Tree No Lh q01 q10 Root P(0) Root P(1)<br> + 1 -13.946363 0.005398 0.005398 0.454504 0.545496<br> + 2 -14.400731 0.005738 0.005738 0.457616 0.542384<br> + 3 -14.588476 0.005608 0.005608 0.459535 0.540465<br> + 4 -14.873274 0.006408 0.006408 0.445273 0.554727<br> + 5 -14.165872 0.005521 0.005521 0.439266 0.560734<br> + 6 -14.396200 0.005913 0.005913 0.438098 0.561902<br> + 7 -14.479001 0.006861 0.006861 0.439984 0.560016<br> + 8 -14.641807 0.006948 0.006948 0.443282 0.556718<br> + 9 -14.595005 0.006512 0.006512 0.445936 0.554064<br> + 10 -14.833338 0.006706 0.006706 0.427272 0.572728<br> + <br> + The fact that the resulting negative log likelihoods are considerabl worse in this case suggests that the two rate parameter model is superior to the single rate parameter model. We can formally test this hypothesis using AIC or the likelihood ratio test.<br> + <br> + 7. Now that we have a rough idea of what our data is looking like, let's move to MCMC world. Kick things off by rerunning your dataset {{{./BayesTraits Adox.trees Adox_trait1.txt}}}. As we've done before, we're going to select Multistate. However, when we get the next prompt, we're going to choose option 2 (MCMC) rather than option 1 (Maximum Likelihood). When you do this, you get different information on your starting parameters that you do with Maximum Likelihood:<br> + <br> + {{{Options:<br> + Model: Multistates<br> + Tree File Name: Adox.trees<br> + Data File Name: Adox_trait1.txt<br> + Log File Name: Adox_trait1.txt.log.txt<br> + Summary: False<br> + Analysis Type: MCMC<br> + Sample Period: 100<br> + Iterations: 5050000<br> + Burn in: 50000<br> + Rate Dev: 2.000000<br> + No of Rates: 2<br> + Base frequency (PI's) None<br> + Character Symbols 0,1<br> + Using a covarion model: False<br> + Restrictions:<br> + q01 None<br> + q10 None<br> + Prior Information:<br> + Prior Categories: 100<br> + q01 uniform 0.00 100.00<br> + q10 uniform 0.00 100.00<br> + Tree Information<br> + Trees: 501<br> + Taxa: 63<br> + Sites: 1<br> + States: 2<br> + }}}<br> + <br> + 8. We're also going to reduce the number of iterations so that things run a bit faster than they would otherwise. Let's drop down to 100,000 iternation by typing {{{iternation 100000}}}. We're going to begin by leaving the prior parameters at their default settings for now and simply run the analysis with uniform rate priors by typing {{{run}}}. The first few lines of the resulting output should look something like this:<br> + <br> + {{{Iteration Lh Harmonic Mean Tree No q01 q10 Root P(0) Root P(1) Acceptance<br> + 50000 -21.583288 -21.583288 95 10.550017 62.602856 0.500000 0.500000 0.940000<br> + 50100 -21.368018 -21.516551 103 5.856247 55.458663 0.500000 0.500000 0.960000<br> + 50200 -21.340524 -21.454796 313 8.247111 57.741515 0.500000 0.500000 0.950000<br> + 50300 -21.803621 -21.498049 22 4.482239 55.257891 0.500000 0.500000 1.000000<br> + 50400 -21.660432 -21.555659 176 10.657151 61.080610 0.500000 0.500000 0.910000<br> + 50500 -21.453740 -21.556891 390 10.324308 65.802350 0.500000 0.500000 0.980000<br> + 50600 -21.591820 -21.552075 383 11.692942 69.103778 0.500000 0.500000 0.920000<br> + 50700 -21.558930 -21.555231 260 12.985093 77.978155 0.500000 0.500000 0.990000<br> + 50800 -21.781473 -21.570270 455 5.967007 72.842356 0.500000 0.500000 0.890000<br> + 50900 -21.499887 -21.579031 106 6.850427 72.032596 0.500000 0.500000 0.920000<br> + 51000 -22.844072 -21.690110 1 18.280377 76.235973 0.500000 0.500000 0.910000<br> + 51100 -23.511776 -21.967507 232 19.162965 71.179811 0.500000 0.500000 0.870000<br> + }}}<br> + <br> + Note that this output includes the iteration in the left column as well as the Harmonic Mean -lnL, which we'll need later to calculate Bayes Factor scores. We are also told which tree is being investigated at each iteration. Note that our likelihood scores are considerably worse than they were previously. We should also notice that our rate parameters are ridiculously high and that the acceptance ratio is really bad (&gt;90%). To solve these problems, we're going to tweak the prior and the Rate Dev parameter. All else being equal, we expect higher Rate Dev values to result in lower acceptance rates because they will lead to bigger changes in the rate coefficient from one generation to the next.<br> + <br> + 9. How do things change if we use different priors? Let's try to follow the program authors' advice by using a hyperprior. We can set a hyperprior by re-running the steps above and selecting {{{rjhp exp 0 30}}}. After running this analysis, we should see some lines that look like this:<br> + <br> + {{{Iteration Lh Harmonic Mean Tree No No Off Paramiters Model string q01 q10 Root P(0) Root P(1) RJ Prior Mean Acceptance<br> + 50000 -10.345161 -10.345161 207 1 'Z0 0.000000 0.010113 0.000000 1.000000 3.301091 0.090000<br> + 50100 -9.419777 -10.120508 260 1 'Z0 0.000000 0.025599 0.000000 1.000000 0.703027 0.120000<br> + 50200 -9.617302 -9.922255 455 1 'Z0 0.000000 0.021933 0.000000 1.000000 0.907404 0.080000<br> + 50300 -10.040932 -9.902513 124 1 'Z0 0.000000 0.021933 0.000000 1.000000 0.998135 0.080000<br> + 50400 -10.507461 -10.005833 199 1 'Z0 0.000000 0.031622 0.000000 1.000000 0.210905 0.160000<br> + 50500 -10.099262 -10.071735 116 1 'Z0 0.000000 0.012638 0.000000 1.000000 0.303869 0.090000<br> + 50600 -9.741163 -10.052036 117 1 'Z0 0.000000 0.014276 0.000000 1.000000 0.261923 0.090000<br> + 50700 -10.413453 -10.063185 306 1 'Z0 0.000000 0.032846 0.000000 1.000000 0.287645 0.120000<br> + 50800 -11.500539 -10.256669 349 1 'Z0 0.000000 0.039525 0.000000 1.000000 2.166462 0.100000<br> + 50900 -10.339216 -10.382841 94 1 'Z0 0.000000 0.014670 0.000000 1.000000 3.414595 0.120000<br> + 51000 -10.450154 -10.384123 87 1 'Z0 0.000000 0.008764 0.000000 1.000000 4.106023 0.090000<br> + 51100 -11.107678 -10.432085 249 1 'Z0 0.000000 0.040083 0.000000 1.000000 9.399662 0.150000<br> + }}}<br> + <br> + Changing the prior results in a major improvement in likelihood scores and recovery of rate parameters that are more in line with the MLE estimates. This dataset therefore provides an indication of how strong an impact the priors can have on Bayesian inference of character reconstruction.<br> + <br> + 10. Even though we're getting good parameter estimates, our mixing is a bit low (&lt;20%). Let's try to improve mixing by reducing the RateDev parameter. Let's try going from 2 to 0.1. If we do this, we find that we have good mixing by the end of the analysis, but that we have yet to reach stationarity by the previously set burn-in. In this case, therefore, we're going to need to increase the burn-in point to ensure adequate mixing.<br> + <br> + {{{Iteration Lh Harmonic Mean Tree No No Off Paramiters Model string q01 q10 Root P(0) Root P(1) RJ Prior Mean Acceptance<br> + 50000 -21.746725 -21.746725 377 2 '01 0.865084 4.784077 0.500000 0.500000 3.008918 0.870000<br> + 50100 -21.549190 -21.685116 33 2 '01 0.778098 4.692790 0.500000 0.500000 3.066121 0.820000<br> + 50200 -21.350093 -21.599172 336 2 '01 0.639613 4.431222 0.500000 0.500000 4.419139 0.820000<br> + 50300 -21.303282 -21.528656 203 2 '01 0.599025 4.426538 0.500000 0.500000 1.618403 0.830000<br> + 50400 -21.286093 -21.481195 20 2 '01 0.594383 4.614545 0.500000 0.500000 2.442129 0.860000<br> + 50500 -21.487544 -21.465539 38 2 '01 0.746834 4.661760 0.500000 0.500000 2.790109 0.810000<br> + ...<br> + 99400 -9.979530 -23.099905 303 1 'Z0 0.000000 0.013126 0.000000 1.000000 0.116057 0.480000<br> + 99500 -11.423252 -23.097885 334 1 'Z0 0.000000 0.053344 0.000000 1.000000 1.404885 0.340000<br> + 99600 -11.333112 -23.095868 247 1 'Z0 0.000000 0.052508 0.000000 1.000000 0.057220 0.390000<br> + 99700 -10.792404 -23.093856 449 1 'Z0 0.000000 0.044798 0.000000 1.000000 0.243009 0.360000<br> + 99800 -10.967647 -23.091848 372 1 'Z0 0.000000 0.035442 0.000000 1.000000 2.761527 0.360000<br> + 99900 -10.462960 -23.089844 312 1 'Z0 0.000000 0.010897 0.000000 1.000000 2.425204 0.530000<br> + 100000 -12.391982 -23.087844 158 1 'Z0 0.000000 0.003631 0.000000 1.000000 0.085852 0.360000}}}<br> + <br> + We can increase the burnin of subsequent runs using the {{{burnin}}} command. Try increasing the burnin so that it is beyond the point of burnin in the analysis you just ran.<br> + <br> + 11. Suppose we are particularl interested in knowing what the growth form was at the root of our tree. As we've already seen, our analyses strongly favor a herbaceous growth form at the root. We can assess how well supported this outcome is by using the {{{fossil}}} command. By fixing the state at each possible alternative and running the analysis, we can compare the resulting Bayes Factor scores to generate an estimate for the relative support of each alternative hypothesis. Let's fix the root to be a woody form {{{Fossil root 0 1 187}}}. The syntax here requires that fossil [node name] [state to fix] [taxon numbers]. Once this operation is complete, we can re-run a second time after fixing a root state of 1. Compare the resulting Harmonic mean likelihoods to see how well supported each alternative state is.</span> </td> </tr> </table> </div>