Skip to content

Better confidence bounds for mutation ages from "exact" convolution #514

@nspope

Description

@nspope

We're outputting mean/variance for mutation ages that come from convolving the EP joint distribution (two gamma distributions and a coupling Poisson likelihood) with a uniform distribution for the temporal position of the mutation on the branch. The subtext is that these moments can be projected to a gamma distribution, for getting quantiles etc.

However, it's generally preferable to get quantiles from the "exact" convolution (scare quotes because the parent/node posteriors are approximate). That is, for a given edge: (a) simulate parent/child node ages from their gamma approximations, (b) reject if parent age < child age, and otherwise (c) simulate the mutation age uniformly between the sampled bounds.

The reason is that there's often a large "slab" from the uniform component, if the parent/child ages are at all precise (they often are). The gamma projection makes this distribution too "peaky":

Image

By contrast, the gamma approximation for the node age distributions is close to exact (not shown in fig above). This is not a code fix (the moments we output are the same regardless) but rather something that needs to be made clear in the docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions