| DT | Type of the diffusion matrix. | |
| DDT | Type of the diffusion partial derivative matrices. |
where
is the drift term and
the diffusion term. At any time
, the time derivatives may be calculated as:
or in matrix form:
where
is the time step,
the Wiener increment and
the
th row of
.
This is all calculated by StochasticAdaptiveRungeKutta, although the model must provide
,
and optionally
through implementations of the calculateDrift(), calculateDiffusion() and calculateDiffusionDerivatives() functions, respectively.
Definition at line 63 of file StochasticDifferentialModel.hpp.
Public Member Functions | |
| StochasticDifferentialModel () | |
| Default constructor for restoring from serialization. | |
| StochasticDifferentialModel (const unsigned int dimensions) | |
| Constructor. | |
| StochasticDifferentialModel (const unsigned int dimensions, const unsigned int noiseDimensions) | |
| Constructor. | |
| virtual | ~StochasticDifferentialModel () |
| Destructor. | |
| unsigned int | getDimensions () |
| Number of state variables in the system. | |
| unsigned int | getNoiseDimensions () |
| Number of noise variables in the system. | |
| virtual void | calculateDrift (const double ts, const indii::ml::aux::vector &y, indii::ml::aux::vector &a) |
| Calculate drift term of the system at a given time. | |
| virtual void | calculateDiffusion (const double ts, const indii::ml::aux::vector &y, DT &B) |
| Calculate diffusion term of the system at a given time. | |
| virtual void | calculateDiffusionDerivatives (const double ts, const indii::ml::aux::vector &y, std::vector< DDT > &dBdy) |
| Calculate the partial derivatives of the diffusion term with respect to each state variable at a given time. | |
| virtual indii::ml::aux::vector | calculateDrift (const double ts, const indii::ml::aux::vector &y) |
| Calculate drift term of the system at a given time. | |
| virtual DT | calculateDiffusion (const double ts, const indii::ml::aux::vector &y) |
| Calculate diffusion term of the system at a given time. | |
| virtual std::vector < DDT > | calculateDiffusionDerivatives (const double ts, const indii::ml::aux::vector &y) |
| Calculate the partial derivatives of the diffusion term with respect to each state variable at a given time. | |
| StochasticDifferentialModel | ( | ) | [inline] |
Default constructor for restoring from serialization.
Definition at line 238 of file StochasticDifferentialModel.hpp.
| StochasticDifferentialModel | ( | const unsigned int | dimensions | ) | [inline] |
Constructor.
| dimensions | Number of state variables in the system. |
Definition at line 244 of file StochasticDifferentialModel.hpp.
| StochasticDifferentialModel | ( | const unsigned int | dimensions, | |
| const unsigned int | noiseDimensions | |||
| ) | [inline] |
Constructor.
| dimensions | Number of state variables in the system. | |
| noiseDimensions | Number of noise variables in the system. |
Definition at line 251 of file StochasticDifferentialModel.hpp.
| ~StochasticDifferentialModel | ( | ) | [inline, virtual] |
| unsigned int getDimensions | ( | ) | [inline] |
Number of state variables in the system.
Definition at line 264 of file StochasticDifferentialModel.hpp.
| unsigned int getNoiseDimensions | ( | ) | [inline] |
Number of noise variables in the system.
Definition at line 269 of file StochasticDifferentialModel.hpp.
| void calculateDrift | ( | const double | ts, | |
| const indii::ml::aux::vector & | y, | |||
| indii::ml::aux::vector & | a | |||
| ) | [inline, virtual] |
Calculate drift term of the system at a given time.
| ts | ; the proposed new time. | |
| y | ; the values of all state variables at time . | |
| a | ; vector into which to write the drift term at time . This is uninitialised. |
Definition at line 274 of file StochasticDifferentialModel.hpp.
| void calculateDiffusion | ( | const double | ts, | |
| const indii::ml::aux::vector & | y, | |||
| DT & | B | |||
| ) | [inline, virtual] |
Calculate diffusion term of the system at a given time.
| ts | ; the proposed new time. | |
| y | ; the values of all state variables at time . | |
| B | ; matrix into which to write the diffusion term at time . This is either cleared or contains the last diffusion calculation when called. |
Definition at line 281 of file StochasticDifferentialModel.hpp.
| void calculateDiffusionDerivatives | ( | const double | ts, | |
| const indii::ml::aux::vector & | y, | |||
| std::vector< DDT > & | dBdy | |||
| ) | [inline, virtual] |
Calculate the partial derivatives of the diffusion term with respect to each state variable at a given time.
| ts | ; the proposed new time. | |
| y | ; the values of all state variables at time . | |
| dBdy | A vector of matrices into which to write the result, where matrix is at time . Each matrix is either cleared or contains the last partial derivative calculation when called. |
Definition at line 287 of file StochasticDifferentialModel.hpp.
| indii::ml::aux::vector calculateDrift | ( | const double | ts, | |
| const indii::ml::aux::vector & | y | |||
| ) | [inline, virtual] |
Calculate drift term of the system at a given time.
| ts | ; the proposed new time. | |
| y | ; the values of all state variables at time . |
; the drift term at time
.Definition at line 295 of file StochasticDifferentialModel.hpp.
| DT calculateDiffusion | ( | const double | ts, | |
| const indii::ml::aux::vector & | y | |||
| ) | [inline, virtual] |
Calculate diffusion term of the system at a given time.
| ts | ; the proposed new time. | |
| y | ; the values of all state variables at time . |
; the diffusion term at time
.Definition at line 304 of file StochasticDifferentialModel.hpp.
| std::vector< DDT > calculateDiffusionDerivatives | ( | const double | ts, | |
| const indii::ml::aux::vector & | y | |||
| ) | [inline, virtual] |
Calculate the partial derivatives of the diffusion term with respect to each state variable at a given time.
| ts | ; the proposed new time. | |
| y | ; the values of all state variables at time . |
matrices, where matrix
is
at time
. In the special case that
is not dependent on
, may return an empty std::vector<aux::matrix>. This is the behaviour of the default implementation and has the same effect as returning a vector of
zero matrices.Definition at line 313 of file StochasticDifferentialModel.hpp.
1.5.3