bdd2.tppl
function bdd2
Model function for BDD2
model function bdd2(tree: Tree, rho: Real, numIntervals: Int) => Real[]
function bddCase
Help function to determine BDD case
function bddCase(timeSegment: Real, waitingTime: Real, deltaT: Real) => BDDCase
type BDDCase
Type for capturing BDD time segment cases
type BDDCase =
| DeltaT {timeSegment:Real}
| Event {timeSegment:Real}
| EndOfBranch {timeSegment:Real}
type Globals
Type for global model parameters
type Globals = Globals {
lambda : Real,
mu : Real,
sigma : Real,
logAlpha : Real,
rho : Real,
deltaT : Real
}
function isDetected
Forward simulation determining whether a tree survives and is detected (sampled)
function isDetected(g: Globals, multiplier: Real, tBegin: Real) => Bool
function numTrialsUntilMRCADetection
Get an estimate of the probability of the MRCA being detected under given parameter values
function numTrialsUntilMRCADetection(g: Globals, tRoot: Real, mMax: Int) => Int
function predictUndetectedProb
Help function to predict the prob that a tree goes undetected
function predictUndetectedProb(g: Globals, multiplier: Real, time: Real) => Real
function shiftDivRates
Help function to let lambda and mu change according to Brownian motion on the log scale
function shiftDivRates(g: Globals, timeSegment: Real) => Real
function simHiddenSpeciation
Simulate hidden speciation process along a branch in the reconstructed tree
function simHiddenSpeciation(g: Globals, multiplier: Real, tBegin:Real, tEnd: Real) => Real
type alias Tree
We use clock tree representation
type alias Tree = ClockTree
function walk
Simulate ("walk") along the reconstructed tree
function walk(g: Globals, multiplier: Real, parentAge: Real, node: Tree)