Solvers
CommonSolve.solve — Function
solve(bp::T, alg::A; kwargs...) where {T<:ConstantRateBranchingProblem, A<:Union{SciMLBase.AbstractSciMLAlgorithm,Nothing}}Solve a branching stochastic process with constant branching rate defined by the ConstantRateBranchingProblem bp. The positional argument alg and optional keyword arguments kwargs... are passed to the solver used to sample trajectories of the underlying SDE problem.
Returns a BranchingProcessSolution containing the problem definition and the resulting tree structure.
See also: ConstantRateBranchingProblem, solve_and_split, common solver options
BranchingProcesses.solve_and_split — Function
solve_and_split(prob::T, lifetime::L, nchild::O, alg::A; kwargs...) where {T<:SciMLBase.AbstractDEProblem, L<:UnivariateDistribution, O<:Union{Integer,DiscreteUnivariateDistribution}, A<:Union{SciMLBase.AbstractSciMLAlgorithm,Nothing}}Recursively solve a branching stochastic process where the single-particle dynamics is defined by the SDE problem prob, the lifetime distribution is lifetime, and the number of children nchild of each particle is either a non-negative integer or a discrete distribution from which the number of children is sampled. The positional argument alg and optional keyword arguments kwargs... are passed to the solver used to sample the trajectory of each particle.
The timespan of the problem prob defines the total time interval for the branching process. A lifetime for the first particle is sampled from the provided lifetime distribution. If the lifetime is larger than the total time interval, the problem is solved until the end of the original interval and a solution node is returned without children. If the lifetime is smaller than the total time interval, the problem is solved until the sampled lifetime, and a solution node is returned with recursively solved children for the remaining time interval.
Returns a BranchingProcessNode representing the tree structure.
See also: SDE problems, sample_lifetime, common solver options
BranchingProcesses.sample_lifetime — Function
sample_lifetime(lifetime::T) where T <: UnivariateDistributionSample the lifetime of a particle from the provided lifetime distribution. This function draws a random sample from the given distribution.
For backward compatibility, when a ConstantRateBranchingProblem is constructed with a positive real number λ as the second argument, it is interpreted as a branch rate and converted to an exponential distribution with parameter 1/λ.
BranchingProcesses.sample_offspring — Function
sample_offspring(nchild::O) where O<:Union{Integer,DiscreteUnivariateDistribution}Sample the number of offspring for a particle. If the input nchild is an integer, that integer is returned. If nchild is a discrete distribution, a sample from that distribution is returned.
BranchingProcesses.remake_initial_condition — Function
remake_initial_condition(prob::P, tspan, u0=nothing) where P<:SciMLBase.AbstractDEProblemRemake the problem prob with a new timespan tspan and, optionally, a new initial condition u0. Works for SDEProblems and JumpProblems. Throws an error for NoiseProblems.
BranchingProcesses.get_timespan — Function
get_timespan(prob::P) where P<:SciMLBase.AbstractDEProblemGet the timespan of the problem prob. Works for SDEProblems and JumpProblems. Throws an error for NoiseProblems.
get_timespan(tree::BranchingProcessSolution)Get the timespan of a BranchingProcessSolution tree, defined as the time from the initial time of the root to the latest final time of any of the leaves.