gauss_markov

Variables

static double DEFAULT_BOUND = -1.0

Default bound for the Gauss-Markov model.

static double MIN_STATE_FACTOR = 1E-10

Minimum state factor for the Gauss-Markov model.

class GaussMarkov
#include <gauss_markov.h>

This module is used to apply a second-order bounded Gauss-Markov random walk on top of an upper level process. The intent is that the caller will perform the set methods (setUpperBounds, setNoiseMatrix, setPropMatrix) as often as they need to, call computeNextState, and then call getCurrentState cyclically.

Public Functions

GaussMarkov()

The constructor initialies the random number generator used for the walks

GaussMarkov(uint64_t size, uint64_t newSeed = 0x1badcad1)

class constructor

~GaussMarkov()

The destructor is a placeholder for one that might do something

void computeNextState()

This method performs almost all of the work for the Gauss Markov random walk. It uses the current random walk configuration, propagates the current state, and then applies appropriate errors to the states to set the current error level.

inline void setRNGSeed(uint64_t newSeed)

Method does just what it says, seeds the random number generator.

Parameters:

newSeed – The seed to use in the random number generator

inline const Eigen::VectorXd &getCurrentState() const

Method returns the current random walk state from the model.

Returns:

Reference to the vector of random walk values.

inline void setUpperBounds(const Eigen::Ref<const Eigen::VectorXd> &newBounds)

Set the upper bounds on the random walk.

Parameters:

newBounds – Bounds to put on the random walk states.

inline void setNoiseMatrix(const Eigen::Ref<const Eigen::MatrixXd> &noise)

Set the matrix used to define error sigmas.

Parameters:

noise – New value for the noise matrix.

inline void setPropMatrix(const Eigen::Ref<const Eigen::MatrixXd> &prop)

Set the matrix used to propagate the state.

Parameters:

prop – New value for the state propagation matrix.

Public Members

Eigen::VectorXd stateBounds

&#8212; Upper bounds to use for markov

Eigen::VectorXd currentState

&#8212; State of the markov model

Eigen::MatrixXd propMatrix

&#8212; Matrix to propagate error state with

Eigen::MatrixXd noiseMatrix

&#8212; Cholesky-decomposition or matrix square root of the covariance matrix to apply errors with

BSKLogger bskLogger

&#8212; BSK Logging

Private Functions

void initializeRNG()

Private Members

Eigen::VectorXd randomValues

&#8212; Reusable standard-normal samples

Eigen::VectorXd stateNoise

&#8212; Reusable process-noise workspace

Eigen::VectorXd propagatedState

&#8212; Reusable propagation workspace

uint64_t RNGSeed

&#8212; Seed for random number generator

std::minstd_rand rGen

&#8212; Random number generator for model

std::normal_distribution<double> rNum

&#8212; Random number distribution for model

uint64_t numStates

&#8212; Number of states to generate noise for