StochasticDifferentialModel Class Template Reference

List of all members.


Detailed Description

template<class DT = indii::ml::aux::matrix, class DDT = indii::ml::aux::zero_matrix>
class indii::ml::sde::StochasticDifferentialModel< DT, DDT >

StochasticAdaptiveRungeKutta compatible model.

Author:
Lawrence Murray <lawrence@indii.org>
Version:
Rev
Date:
Date
Parameters:
DT Type of the diffusion matrix.
DDT Type of the diffusion partial derivative matrices.
The model is of the form:

\[ d\mathbf{y} = \mathbf{a}(\mathbf{y},t)\,dt + B(\mathbf{y},t)\,d\mathbf{W}, \]

where $\mathbf{a}(\mathbf{y},t)$ is the drift term and $B(\mathbf{y},t)$ the diffusion term. At any time $t$, the time derivatives may be calculated as:

\[ \frac{dy_k}{dt} = a_k(\mathbf{y},t) - \frac{1}{2}\sum_{ij}B_{ij}(\mathbf{y},t)\frac{\partial B_{kj}(\mathbf{y},t)}{\partial y_i} + \frac{1}{\Delta t}\sum_{i}B_{ki}(\mathbf{y},t)\Delta W_i, \]

or in matrix form:

\[ \frac{d\mathbf{y}}{dt} = \mathbf{a}(\mathbf{y},t) - \frac{1}{2}\sum_i \frac{\partial B(\mathbf{y},t)}{\partial y_i}B_{i,*}(\mathbf{y},t)^T + \frac{1}{\Delta t} B(\mathbf{y},t)\Delta \mathbf{W}, \]

where $\Delta t$ is the time step, $\Delta \mathbf{W}$ the Wiener increment and $B_{i,*}(\mathbf{y},t)$ the $i$th row of $B(\mathbf{y},t)$.

This is all calculated by StochasticAdaptiveRungeKutta, although the model must provide $\mathbf{a}(\mathbf{y},t)$, $B(\mathbf{y},t)$ and optionally $\frac{\partial B_{kj}(\mathbf{y},t)}{\partial y_i}$ 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.

Constructor & Destructor Documentation

StochasticDifferentialModel (  )  [inline]

Default constructor for restoring from serialization.

Definition at line 238 of file StochasticDifferentialModel.hpp.

StochasticDifferentialModel ( const unsigned int  dimensions  )  [inline]

Constructor.

Parameters:
dimensions Number of state variables in the system.
The Wiener process noise is assumed to have the same dimensionality as the state.

Definition at line 244 of file StochasticDifferentialModel.hpp.

StochasticDifferentialModel ( const unsigned int  dimensions,
const unsigned int  noiseDimensions 
) [inline]

Constructor.

Parameters:
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]

Destructor.

Definition at line 258 of file StochasticDifferentialModel.hpp.


Member Function Documentation

unsigned int getDimensions (  )  [inline]

Number of state variables in the system.

Returns:
the 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.

Returns:
the 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.

Parameters:
ts $t_s$; the proposed new time.
y $\mathbf{y}(t)$; the values of all state variables at time $t$.
a $\mathbf{a}(\mathbf{y}, t)$; vector into which to write the drift term at time $t$. This is uninitialised.
Default implementation calls the older, now deprecated method calculateDrift(const double, const indii::ml::aux::vector&).

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.

Parameters:
ts $t_s$; the proposed new time.
y $\mathbf{y}(t)$; the values of all state variables at time $t$.
B $B(\mathbf{y}, t)$; matrix into which to write the diffusion term at time $t$. This is either cleared or contains the last diffusion calculation when called.
Default implementation calls the older, now deprecated method calculateDiffusion(const double, const indii::ml::aux::vector&).

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.

Parameters:
ts $t_s$; the proposed new time.
y $\mathbf{y}(t)$; the values of all state variables at time $t$.
dBdy A vector of $N$ matrices into which to write the result, where matrix $i$ is $\frac{\partial B(\mathbf{y},t)}{\partial y_i}$ at time $t$. 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.

Parameters:
ts $t_s$; the proposed new time.
y $\mathbf{y}(t)$; the values of all state variables at time $t$.
Returns:
$\mathbf{a}(\mathbf{y}, t)$; the drift term at time $t$.
Deprecated:
Use calculateDrift(const double, const indii::ml::aux::vector&, indii::ml::aux::vector&)

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.

Parameters:
ts $t_s$; the proposed new time.
y $\mathbf{y}(t)$; the values of all state variables at time $t$.
Returns:
$B(\mathbf{y}, t)$; the diffusion term at time $t$.
Deprecated:
Use calculateDiffusion(const double, const indii::ml::aux::vector&, DT&)

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.

Parameters:
ts $t_s$; the proposed new time.
y $\mathbf{y}(t)$; the values of all state variables at time $t$.
Returns:
A vector of $N$ matrices, where matrix $i$ is $\frac{\partial B(\mathbf{y},t)}{\partial y_i}$ at time $t$. In the special case that $B(\mathbf{y}, t)$ is not dependent on $\mathbf{y}$, 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 $N$ zero matrices.
Deprecated:
Use calculateDiffusionDerivatives(const double, const indii::ml::aux::vector&, std::vector<DDT>)

Definition at line 313 of file StochasticDifferentialModel.hpp.


Generated on Wed Dec 17 15:11:58 2008 for dysii Dynamical Systems Library by  doxygen 1.5.3