Hi all.

Here is a link to code that does what Brian suggests:

http://blog.phytools.org/2014/10/optimizing-tree-transformations-for.html

Note that (as noted in the blog post) I have arbitrarily used ace internally to compute the discrete character log-likelihood, because it is fast. You could instead change the code in minor ways and use fitDiscrete, which is slower but should be more robust.

The demo is fairly explicit, but let us know if it works or if I have made any errors.

All the best, Liam

Liam J. Revell, Assistant Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://blog.phytools.org

On 10/27/2014 7:54 AM, Brian O'Meara wrote:
You can calculate the likelihood of the data under a given transformation:
transform the tree with a delta of 0.3 or whatever, then calculate the
likelihood of the data under a Brownian motion model using this transformed
tree. This is the same likelihood as calculating the likelihood of the data
under a delta model directly (assuming the same delta). However, what you
can do is apply the same transformation to all your datasets and add the
likelihood. This becomes a new likelihood function. You can then optimize
this (optim, nloptr, etc.). I can rig up a working example later tonight --
off to teach now.

Brian

_______________________________________
Brian O'Meara
Assistant Professor
Dept. of Ecology & Evolutionary Biology
U. of Tennessee, Knoxville
http://www.brianomeara.info

Postdoc collaborators wanted: http://nimbios.org/postdocs/
Calendar: http://www.brianomeara.info/calendars/omeara

On Mon, Oct 27, 2014 at 9:34 AM, Luke Matthews <
lmatth...@activatenetworks.net> wrote:

HI Ben,
I too am curious if anyone has an R answer to this question you pose.  One
non-R way I can think of is to put the data into MrBayes, which has a
number of different models available.  You could probably effectively test
some models not baked in MrBayes by systematically manipulating the
branchlengths you submit to it.  MrBayes provides various options for how
tightly coupled the parameter estimates should be across the different
genes.  It would seem something similar might exist within R but I'm not
aware of any.
Best
Luke

Luke J. Matthews | Senior Scientific Director | Activate Networks, Inc.

------------------------------

Message: 2
Date: Fri, 24 Oct 2014 16:23:58 -0400
From: Benjamin Furman <benjamin.ls.fur...@gmail.com>
To: r-sig-phylo@r-project.org
Subject: [R-sig-phylo] fitDiscrete across multiple datasets
Message-ID:
         <CACyKK5XATvW36iW_MfAR5x7LZzZjG+AAN+rtY2V7jO5VPBY5=
g...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

Hello Everyone,

     I have a tree and discrete data (number of gene copies, for many
genes) and would like to use the fitDiscrete function in geiger, or
something similar. However, I would like to estimate the parameters given
all of the datasets, not just with the data for each gene. For instance, if
I was using the "delta" model to vary rates across the tree, I would like
this delta value to reflect some sort of summary value across all datasets.
Does anyone have an idea as to how this could be accomplished or perhaps
point me in the right direction?

Thank you for any guidance,
Ben


--
Benjamin Furman, B.Sc. Specialization
Ph.D. Candidate, Evans Lab <http://benevanslab.wordpress.com>
McMaster University
Twitter: @Xen_Ben
Email: benjamin.ls.fur...@gmail.com, furma...@mcmaster.ca
website: http://benjaminfurman.wordpress.com

         [[alternative HTML version deleted]]



------------------------------

_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


End of R-sig-phylo Digest, Vol 81, Issue 12

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at
http://www.mail-archive.com/r-sig-phylo@r-project.org/


        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to