Implementation of a stationary gauss-markov process, also known as a Ornstein Ulenbeck process. More...
#include <gz/math/GaussMarkovProcess.hh>
Public Member Functions | |
GaussMarkovProcess () | |
GaussMarkovProcess (double _start, double _theta, double _mu, double _sigma) | |
Create a process with the provided process parameters. This will also call Set(), and in turn Reset(). | |
double | Mu () const |
Get the mu ( \(\mu\)) value. | |
void | Reset () |
Reset the process. This will set the current process value to the start value. | |
void | Set (double _start, double _theta, double _mu, double _sigma) |
Set the process parameters. This will also call Reset(). | |
double | Sigma () const |
Get the sigma ( \(\sigma\)) value. | |
double | Start () const |
Get the start value. | |
double | Theta () const |
Get the theta ( \(\theta\)) value. | |
double | Update (const clock::duration &_dt) |
Update the process and get the new value. | |
double | Update (double _dt) |
double | Value () const |
Get the current process value. | |
Detailed Description
Implementation of a stationary gauss-markov process, also known as a Ornstein Ulenbeck process.
See the Update(const clock::duration &) for details on the forumla used to update the process.
Example usage
Constructor & Destructor Documentation
◆ GaussMarkovProcess() [1/2]
◆ GaussMarkovProcess() [2/2]
GaussMarkovProcess | ( | double | _start, |
double | _theta, | ||
double | _mu, | ||
double | _sigma | ||
) |
Create a process with the provided process parameters. This will also call Set(), and in turn Reset().
- Parameters
-
[in] _start The start value of the process. [in] _theta The theta ( \(\theta\)) parameter. A value of zero will be used if this parameter is negative. [in] _mu The mu ( \(\mu\)) parameter. [in] _sigma The sigma ( \(\sigma\)) parameter. A value of zero will be used if this parameter is negative.
- See also
- Update(const clock::duration &)
Member Function Documentation
◆ Mu()
double Mu | ( | ) | const |
◆ Reset()
void Reset | ( | ) |
Reset the process. This will set the current process value to the start value.
◆ Set()
Set the process parameters. This will also call Reset().
- Parameters
-
[in] _start The start value of the process. [in] _theta The theta ( \(\theta\)) parameter. [in] _mu The mu ( \(\mu\)) parameter. [in] _sigma The sigma ( \(\sigma\)) parameter.
- See also
- Update(const clock::duration &)
◆ Sigma()
double Sigma | ( | ) | const |
Get the sigma ( \(\sigma\)) value.
- Returns
- The sigma value.
◆ Start()
double Start | ( | ) | const |
◆ Theta()
double Theta | ( | ) | const |
Get the theta ( \(\theta\)) value.
- Returns
- The theta value.
◆ Update() [1/2]
Update the process and get the new value.
The following equation is computed:
\(x_{t+1} += \theta * (\mu - x_t) * dt + \sigma * dW_t\)
where
- \(\theta, \mu, \sigma\) are parameters specified by the user. In order, the parameters are theta, mu, and sigma. Theta and sigma must be greater than or equal to zero. You can think of mu as representing the mean or equilibrium value, sigma as the degree of volatility, and theta as the rate by which changes dissipate and revert towards the mean.
- \(dt\) is the time step in seconds.
- \(dW_t\) is a random number drawm from a normal distribution with mean of zero and variance of 1.
- \(x_t\) is the current value of the Gauss-Markov process
- \(x_{t+1}\) is the new value of the Gauss-Markvov process
See also: https://en.wikipedia.org/wiki/Ornstein%E2%80%93Uhlenbeck_process
This implementation include a drift parameter, mu. In financial mathematics, this is known as a Vasicek model.
- Parameters
-
[in] _dt Length of the timestep after which a new sample should be taken.
- Returns
- The new value of this process.
◆ Update() [2/2]
◆ Value()
double Value | ( | ) | const |
Get the current process value.
- Returns
- The value of the process.
The documentation for this class was generated from the following file: