Skip to content

Commit b48dad3

Browse files
authored
Describe the actual time values
Prompted by a question from @gregorgorjanc
1 parent 77aa230 commit b48dad3

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

docs/tutorial.rst

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,40 @@ The above example shows the basic use of ``tsdate``, using default parameters. T
7575
software has parameters the user can access through the :meth:`tsdate.build_prior_grid()`
7676
function which may affect the runtime and accuracy of the algorithm.
7777

78+
.. _sec_tutorial_returned_dates:
79+
80+
++++++++++++++
81+
Returned dates
82+
++++++++++++++
83+
84+
Several different node time estimates are returned by :func:`tsdate.date()`. In particular,
85+
to conform to the requirements of a valid tree sequence, child nodes must always be strictly
86+
younger than their parents. In the unusual case that a child has an estimated time which is
87+
older than its parent, ``tsdate`` increases the node time of the parent in the tree
88+
sequence so that it is constrained to be fractionally older than its oldest child.
89+
90+
In the case of the inside-outside method (see below), the estimated time is based on the
91+
posterior mean node time. The true posterior mean time (unconstrained by the tree sequence
92+
requirements above) is stored in the node metadata. This can be consulted if you want to
93+
obtain the raw mean times from the posterior.
94+
95+
For even greater detail about the posterior time estimates for each node, you can use the
96+
``return_posteriors`` option, which will return the full distribution of posterior
97+
probabilities in each time slice.
7898

7999
.. _sec_tutorial_inside_outside_v_maximization:
80100

81-
++++++++++++++++++++++++++++++
101+
------------------------------
82102
Inside Outside vs Maximization
83-
++++++++++++++++++++++++++++++
103+
------------------------------
84104

85105
One of the most important parameters to consider is whether ``tsdate`` should use the
86106
inside-outside or the maximization algorithms to perform inference. A detailed
87107
description of the algorithms will be presented in our preprint, but from the users
88-
perspective, the inside-outside approach performs better empirically but has issues with
89-
numerical stability, while the maximization approach is slightly less accurate
90-
empirically, but is numerically stable.
108+
perspective, the inside-outside approach performs better empirically, and returns
109+
a full posterior distribution, but occasionally has issues with numerical stability. In
110+
contrast, the maximization approach is slightly less accurate empirically, and will
111+
not return true posteriors, but has the advantage of always being numerically stable.
91112

92113
.. _command_line_interface:
93114

0 commit comments

Comments
 (0)