Forward sensitivity analysis

Forward Sensitivity FSP variant specification

NumCME.AdaptiveForwardSensFspSparse โ€” Type
struct AdaptiveForwardSensFspSparse <: ForwardSensCmeAlgorithm

Type to store algorithmic options for solving a Foward Sensitivity CME problem.

Fields

  • space_adapter: Method to adapt state space when the current solution error exceeds tolerance.
  • ode_method: An ODE solver from DifferentialEquations.jl to integrate the FSP-truncated problem.

See also

ForwardSensRStepAdapter

source

State space adaptation policy

NumCME.ForwardSensRStepAdapter โ€” Type

Simple adapter based on reachability. Whenever the current FSP solution error is found to exceed the acceptable tolerance, the adapter will expand the state space by exploring all states that could be reached from the current state space within a set number of reaction events.

This adapter only works with StateSpaceSparse.

source
NumCME.adapt! โ€” Method

adapt!(statespace::StateSpaceSparse, adapter::RStepAdapter, p::Vector{RealT}, sinks::Vector{RealT}, t::RealT, fsptol::RealT; integrator::Union{DEIntegrator, Nothing}=nothing) where {RealT <: AbstractFloat}

Adapt the state space, probability vector and sensitivity vectors based on current error recorded in the sinks vector.

source
NumCME.init! โ€” Method

init!(statespace::StateSpaceSparse, adapter::RStepAdapter, p::Vector{RealT}, S::Vector{Vector{RealT}}, t::RealT, fsptol::RealT) where {RealT <: AbstractFloat}

Initialize the state space, solution vector and sensitivity indices for FSP integration.

source

Forward sensitivity FSP output format

NumCME.ForwardSensFspOutputSparse โ€” Type
ForwardSensFspOutputSparse{NS,IntT<:Integer,RealT<:AbstractFloat}

Struct to store Forward Sensitivity Finite State Projection outputs based on the sparse representation of the FSP solution.

Fields

  • t: Array of solution output times.
  • p: Array of FspVectorSparse instances. p[i] is the CME solution at time t[i].
  • 'S': Array of arrays of FspVectorSparse instances. S[j][i] is the j-th partial derivative of p[i].
  • sinks: Probability mass accumulated at the sink states over time. sinks[i] is the vector of sink state probabilities at time t[i].
  • dsinks: Partial derivatives of sink probabilties. dsinks[j][i] is the j-th partial derivative of sinks[i].

Usage

If sol is of type FspOutputSparse, sol[i] will return a slice, of type FspOutputSliceSparse of the solution set at the i-th index.

See also

ForwardSensFspOutputSliceSparse.

source

solve() method

NumCME.ForwardSensFspInitialConditionSparse โ€” Type
struct ForwardSensFspInitialConditionSparse{NS, IntT<:Integer, RealT<:AbstractFloat}

Initial condition for Foward Sensitivity FSP in sparse format.

Fields

  • states: List of states with nonzero initial probabilities.
  • p: List of nonzero probabilities, with p[i] being the probability of state states[i].
  • S: List of partial derivatives, with S[j][i] being the j-th partial derivative of p[i].
source
CommonSolve.solve โ€” Method
solve(
    model::CmeModelWithSensitivity,
    initial_condition::ForwardSensFspInitialConditionSparse{NS, IntT<:Integer, RealT<:AbstractFloat},
    tspan::Tuple{AbstractFloat, AbstractFloat},
    sensfspalgorithm::AdaptiveForwardSensFspSparse;
    saveat,
    fsptol,
    odeatol,
    odertol,
    verbose
) -> Any

Foward sensitivity Finite State Projection to compute the time-dependent probability distributions of a stochastic reaction network along with their partial derivatives with respect to model parameters.

Arguments

  • model: Stochastic reaction network model with propensity sensitivities.
  • initial_condition: Initial condition.
  • tspan: Time span.
  • sensfspalgorithm: Forward Sesitivity FSP method, a combination of space adaptation strategy and the ODE method to integrate the FSP-truncated problem.
  • saveat: timepoints to save the intermediate solutions. If left empty, all timesteps computed by the ODE solver is saved.
  • fsptol: FSP error tolerance. The solver dynamically adapts the projection space so that the sum of probability mass in the truncated solution is above 1.0 - fsptol. Default: 1.0E-6.
  • odeatol: Absolute tolerance for the ODE solver. Default: 1.0E-10.
  • odertol: Relative tolerance for the ODE solver. Default: 1.0E-4.
  • verbose: Whether to print status when adapting state space. Default: false.

Returns

A ForwardSensFspOutputSparse instance.

See also

FspVectorSparse, ForwardSensFspOutputSparse, AdaptiveForwardSensFspSparse.

source
NumCME.forwardsens_initial_condition โ€” Method
forwardsens_initial_condition(
    states::Array{var"#s73", 1} where var"#s73"<:AbstractArray{IntT<:Integer, 1},
    probabilities::Array{RealT<:AbstractFloat, 1},
    sensitivity::Array{Array{RealT<:AbstractFloat, 1}, 1}
) -> ForwardSensFspInitialConditionSparse

Return a ForwardSensFspInitialConditionSparse instance from a list of initial states states, initial probabilities probabilities and initial sensitivities sensitivity.

source