NeuroLab
NoiseSource Class Reference

A set of mutually correlated noise sources (Wiener, Poisson and Ornstein-Uhlenbeck processes). More...

Inheritance diagram for NoiseSource:

Public Member Functions

 NoiseSource (Time *time, int n)
 Construct. More...
 
 NoiseSource (Time *time, Matrix a)
 Construct. More...
 
 ~NoiseSource ()
 Destruct.
 
NoisecreateNoise (int n, const string &t)
 Set/Get a noise object. More...
 
Noiseoperator[] (int n)
 Get a noise object. More...
 
void setMixingMatrix (Matrix a)
 Set the mixing matrix. More...
 
double getIndicatorVariance (int n)
 Get variance.
 
double getCovariationCoeff (int n, int m)
 Get covariation coefficient. More...
 
void destructionNotify (int n)
 Callback for Noise objects. More...
 
virtual void prepareNextState ()
 Compute next value. More...
 
virtual void proceedToNextState ()
 Set next time step. More...
 
- Public Member Functions inherited from StochasticProcess
 StochasticProcess (class Time *time, const string &name="", const string &type="Stochastic")
 Create.
 
virtual ~StochasticProcess ()
 Destroy.
 
bool isNextStatePrepared ()
 Whether.
 
virtual double getIncrement ()
 Returns the increment. More...
 
virtual double getCurrentValue ()
 Returns the value of the process. More...
 
virtual double getNextValue ()
 Returns the next value of the process. More...
 
virtual void setNextValue (double d)
 Set the next value of the process. More...
 
virtual void setCurrentValue (double d)
 Set the current value of the process. More...
 
void setDescription (string s)
 Set stochastic description.
 
virtual void init ()
 Initialise time-dependent values.
 
string getDescription ()
 Get the name. More...
 
- Public Member Functions inherited from Parametric
string getType () const
 Type of object.
 
string getName () const
 Name of object.
 
void setName (const string &name)
 Name of object.
 
string getConfiguration () const
 Returns the configuration of the object. More...
 
string getAllParameters () const
 String with all parameter settings.
 
void addParameter (const string &name)
 Add a parameter. More...
 
void rmParameter (const string &name)
 Remove a parameter. More...
 
virtual void setParameter (const string &name, const string &value)
 Set parameter. More...
 
virtual string getParameter (const string &name) const
 Get parameter. More...
 
- Public Member Functions inherited from TimeDependent
 TimeDependent (class Time *time)
 Construct. More...
 
virtual class TimegetTime () const
 Return pointer to the time object.
 
- Public Member Functions inherited from Physical
 Physical ()
 Construct.
 
 Physical (const Physical &)
 Copy.
 
 Physical (string name)
 Construct.
 
 Physical (string name, string unitPrefix, string unitSymbol)
 Construct.
 
 Physical (string name, Unit unit)
 Construct.
 
virtual string getPhysicalDescription ()
 Returns the physical description. More...
 
virtual string getUnitName ()
 Returns the unit name.
 
virtual string getUnitSymbol ()
 Returns the unit name.
 
virtual void setPhysicalDescription (string name)
 Set the name. Same as setDescription(). More...
 
virtual void setUnit (Unit u)
 Set the unit.
 
virtual void setUnitPrefix (int n)
 Set unit prefix. More...
 
virtual Unit getUnit () const
 Retrieve the unit.
 
- Public Member Functions inherited from RandN
 RandN ()
 Construct.
 
 ~RandN ()
 Destruct.
 
double dRandN ()
 Retrieve random variable. More...
 
double dRandE ()
 Retrieve random variable. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Parametric
 Parametric (const string &name, const string &type)
 Create object of type and name.
 
virtual ~Parametric ()
 Destroy object.
 
- Protected Attributes inherited from StochasticProcess
double stochCurrentValue
 the current value
 
double stochNextValue
 the next value (direct future)
 
bool stochNextStateIsPrepared
 whether prepareNextState() was successful
 
string stochDescription
 the name of the quantity
 

Detailed Description

A set of mutually correlated noise sources (Wiener, Poisson and Ornstein-Uhlenbeck processes).

An object of this class creates various noise source which may be correlated. The correlation is achieved by mixing independent noise sources with a mixing matrix (details below).

Construction and usage: The constructor will set up an object with n noise sources. They can be used straight away. The mixing matrix, as well as type and parameters for each process can be set at runtime. Mean, variance and covariation processes can also be obtained at runtime.

Method:

\[ \omega -> funtionInput -> dPt / dWt \]

\[ \left<\left[G^i,G^j\right]\right> = \sigma_jc_{ij} c_j w_j\lambda_j \]

with

\[ c_j = \sqrt{\frac{2}{\pi}} \frac {e^{-\frac{\lambda_j^2dt}{2\mbox{Var}\left\{dX^i_t\right\}}}} {\left(1-\mbox{erf}{\frac{\lambda_j\sqrt{dt}}{\sqrt{2\mbox{Var}\left\{dX^i_t\right\}}}}\right)\sqrt{\mbox{Var}\left\{dX^i_t\right\}}}. \]

Constructor & Destructor Documentation

NoiseSource::NoiseSource ( Time time,
int  n 
)

Construct.

Constructs a NoiseSource object, which produces n noise processes. The default mixing matrix is the identity matrix (Zeros with diagonal Ones). Use setMixingMatrix() to change.

Parameters
timeAdress of a (central) time object.
nNumber of processes.
NoiseSource::NoiseSource ( Time time,
Matrix  a 
)

Construct.

Constructs a NoiseSource object, where the processes are mixed as stated in the given mixing matrix.

Parameters
timeAdress of a (central) time object.
aMixing matrix.

Member Function Documentation

Noise* NoiseSource::createNoise ( int  n,
const string &  t 
)

Set/Get a noise object.

This will retrieve the address of a noise object. If the object is not existent, or of a different type as stated by the p, it will be created.

Parameters
nThe index of the noise.
tThe type of the noise (can be "Correlated Wiender Process", "Correlated Poisson Process", "Correlated Ornstein-Uhlenbeck Process").
void NoiseSource::destructionNotify ( int  n)

Callback for Noise objects.

Called by a noise object n, to notify its parent that it has died.

double NoiseSource::getCovariationCoeff ( int  n,
int  m 
)

Get covariation coefficient.

The covariation process (see Covariation) is in many cases just time multiplied by a scalar. The method retrieves this scalar.

Returns
The scalar s, so that $ \left[X^n,X^m\right]_t = st$
Parameters
nIndex of first noise process.
mIndex of second noise process.
Noise* NoiseSource::operator[] ( int  n)

Get a noise object.

This returns only existent noise objects.

Parameters
nThe index of the noise.
virtual void NoiseSource::prepareNextState ( )
virtual

Compute next value.

This will compute the next value of all indicator variables. The values of the noises are not affected.

Reimplemented from StochasticProcess.

virtual void NoiseSource::proceedToNextState ( )
virtual

Set next time step.

This will set all noises to the next time step.

Reimplemented from StochasticProcess.

void NoiseSource::setMixingMatrix ( Matrix  a)

Set the mixing matrix.

Just sets a new mixing matrix to a given set of noises. Note that the dimensions of the matrix must match (i.e. for n noise sources, you want an nxn Matrix.

Parameters
aThe mixing matrix.