-
Notifications
You must be signed in to change notification settings - Fork 8
Loggers
PhyDyn is equipped with two types of loggers, TrajectoryLogger and STreeRootLogger.
The TrajectoryLogger records the population sizes of deme and non-demes along the population trajectories generated during an MCMC run, as well as birth and migration rates (optional). In addition to the fileName and logEvery standard Logger arguments, the TrajectoryLogger uses the following:
-
popModel(BEAST object): reference to the PhyDyn population model BEAST object to log. -
pointFrequency(integer, default=1): frequency between points in time series to be logged.
Given a trajectory with n points [1,..,n], where point 1 corresponds to inital time t0 and point n to end time t1, the logger will log population (and rate) values for points [1,f+1,2f+1,....,n], where f denotespointFrequency. -
logrates(string, default=''): Indicates birth and migration rates (matrix equation entries) to log.
Syntax:
<logrates>::=<matrix-rate>*|all
<matrix-rate>::=F(<deme> , <deme>)|G(<deme>, <deme>)| F | G
whereX* denotes a space-separated sequence ofXs, and - c c
- z
The number of points recorded per trajectory depends on the value of the pointFrequency parameter, and the number of points used to approximate the trajectory the PopModelODE solver; the latter is specified by the integrationSteps argument in TrajectoryParameters. For example, the logger defined by:
<logger id = "popModelLogger" fileName="model.traj" logEvery="100">
<log id="trajectoryLogger" spec="TrajectoryLogger" popModel="@sirmodel" pointFrequency="1"></log>
</logger>
will log every point of the trajectory - since the point frequency is one - into file model.traj. A pointFrequency of 10 combined with a popModel trajectory computed with 200 integration steps will log points 0,9,19,29,...,199 and 200, the last-point. The logger produces a tab-separated table where each row corresponds to a time-point, which can be plotted by running the plot_trajectory.R script.
The logger defined by:
<logger id = "popModelLogger" fileName="model.traj" logEvery="100">
<log id="trajectoryLogger" spec="TrajectoryLogger" popModel="@sirmodel"
pointFrequency="1" ></log>
</logger>
The STreeRootLogger logs the state probabilities at the root of the trees sampled during an MCMC run. It is defined as follows:
<logger id="probtreelog" fileName="rootStateProbabilities.log" logEvery="1" mode="tree">
<log id="logTrees" spec="STreeRootLogger" tree="@tree" density="@stlikelihood"/>
</logger>