Luke's points are correct. However, if we wanted to estimate a common transition matrix across characters we could just substitute optim.pml for a phyDat object of type="USER" for ace internally; and if we wanted to estimate different parameter values across different data columns, we could just run fitTransform separately on each column of X and sum the log-likelihoods. I don't know whether either of these things (or the main exercise) are a good idea, but they are all certainly possible.

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 2:57 PM, Benjamin Furman wrote:
Hello All,

     I would also like to echo a thank you for the responses. They have
been helpful. As for your summary Luke, I'll have to let the experts
comment on that.

Ben

On Mon, Oct 27, 2014 at 1:49 PM, Luke Matthews
<lmatth...@activatenetworks.net <mailto:lmatth...@activatenetworks.net>>
wrote:

    Hi all,
    Thanks Brian and Liam for these very cool responses.  It does make
    sense that one should be able to iterate through the characters and
    add the likelihoods, which is elegant and seems appropriate.  It
    seems to me what this process accomplishes is:

    1. Completely couples the estimation of delta across the characters
    - thus we are now picking the value for delta that maximizes the
    likelihood across all characters not allowing any variation in delta
    across them.

    2. Leaves completely uncoupled the transition rate estimates across
    the different characters.  Thus, the different characters are freely
    estimating rates of transition from 2 to 3 gene copies, etc. such
    that the rate for one gene has no influence on the rate for another.

    Do I have that right?  Depending on Ben's hypothesized processes
    those may be reasonable assumptions.  I can also imagine processes
    where somewhat decoupling the delta estimation or somewhat coupling
    the rate estimations would be reasonable.

    Best
    Luke

    -----Original Message-----
    From: Liam J. Revell [mailto:liam.rev...@umb.edu
    <mailto:liam.rev...@umb.edu>]
    Sent: Monday, October 27, 2014 1:26 PM
    To: omeara.br...@gmail.com <mailto:omeara.br...@gmail.com>; Luke
    Matthews
    Cc: r-sig-phylo@r-project.org <mailto:r-sig-phylo@r-project.org>
    Subject: Re: [R-sig-phylo] fitDiscrete across multiple datasets

    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 <mailto: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
    <mailto: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
    <mailto:benjamin.ls.fur...@gmail.com>>
     >> To: r-sig-phylo@r-project.org <mailto:r-sig-phylo@r-project.org>
     >> Subject: [R-sig-phylo] fitDiscrete across multiple datasets
     >> Message-ID:
     >>          <CACyKK5XATvW36iW_MfAR5x7LZzZjG+AAN+rtY2V7jO5VPBY5=
     >> g...@mail.gmail.com <mailto: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
    <mailto:benjamin.ls.fur...@gmail.com>, furma...@mcmaster.ca
    <mailto:furma...@mcmaster.ca>
     >> website: http://benjaminfurman.wordpress.com
     >>
     >>          [[alternative HTML version deleted]]
     >>
     >>
     >>
     >> ------------------------------
     >>
     >> _______________________________________________
     >> R-sig-phylo mailing list
     >> R-sig-phylo@r-project.org <mailto: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
    <mailto: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
    <mailto: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
    <mailto: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/




--
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
<mailto:benjamin.ls.fur...@gmail.com>, furma...@mcmaster.ca
<mailto:furma...@mcmaster.ca>
website: http://benjaminfurman.wordpress.com

_______________________________________________
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