lds

lds #

Linear Dynamical Systems (LDS) namespace.

Namespaces #

Name
lds::gaussian
Linear Dynamical Systems with Gaussian observations.
lds::poisson
Linear Dynamical Systems with Poisson observations.

Classes #

Name
class lds::Controller
class lds::EM
class lds::Fit
LDS Fit Type.
class lds::SSID
class lds::SwitchedController
SwitchedController Type.
class lds::System
Linear Dynamical System Type.
class lds::UniformMatrixList
class lds::UniformSystemList
class lds::UniformVectorList

Types #

Name
enum SSIDWt { kSSIDNone, kSSIDMOESP, kSSIDCVA}
weighting options for SSID
enum MatrixListFreeDim { kMatFreeDimNone, kMatFreeDim1, kMatFreeDim2}
using double data_t
using arma::Col< data_t > Vector
using arma::Mat< data_t > Matrix
using arma::Cube< data_t > Cube
using arma::subview< data_t > View

Functions #

Name
void Limit(std::vector< data_t > & x, data_t lb, data_t ub)
void Limit(Vector & x, data_t lb, data_t ub)
void Limit(Matrix & x, data_t lb, data_t ub)
void Reassign(Vector & some, const Vector & other, const std::string & parenthetical =“Reassign”)
reassigns contents of some Vector in place
void Reassign(Matrix & some, const Matrix & other, const std::string & parenthetical =“Reassign”)
reassigns contents of some Matrix in place
void ForceSymPD(Matrix & X)
forces matrix to be symmetric positive-definite
void ForceSymMinEig(Matrix & X, data_t eig_min =0)
forces matrix to be symmetric and have a minimum eigenvalue
void lq(Matrix & L, Matrix & Qt, const Matrix & X)
LQ decomposition.
Matrix calcCov(const Matrix & A, const Matrix & B)
Calculate covariance matrix.

Attributes #

Name
const std::size_t kControlTypeDeltaU
control designed to penalize change in input
const std::size_t kControlTypeIntY
control using integral action
const std::size_t kControlTypeAdaptM
adapt control setpoint with re-estimated disturbance m
const data_t kInf
Some useful numbers.
const data_t kPi
const data_t kDefaultP0
default state estimate covar
const data_t kDefaultQ0
default process noise covar
const data_t kDefaultR0
default output noise covar

Type Details #

SSIDWt #

Enumerator Value Description
kSSIDNone None.
kSSIDMOESP MOESP (AKA “robust method” in van Overschee 1996)
kSSIDCVA CVA “Canonical Variate Analysis”.

Weighting options for singular value decomposition performed during subspace identification (SSID)

Reference:

van Overschee, de Moor. 1996. Subspace Identification for Linear Systems.

MatrixListFreeDim #

Enumerator Value Description
kMatFreeDimNone neither dim free to be hetero in mat list
kMatFreeDim1 allow 1st dim of mats in list to be hetero
kMatFreeDim2 allow 2nd dim of mats in list to be hetero

data_t #

using lds::data_t = typedef double;

Type of all data in library. If need 32b, change double to float. This could be potentially useful for large scale problems where there are memory constraints.

Vector #

using lds::Vector = typedef arma::Col<data_t>;

Matrix #

using lds::Matrix = typedef arma::Mat<data_t>;

Cube #

using lds::Cube = typedef arma::Cube<data_t>;

View #

using lds::View = typedef arma::subview<data_t>;

Function Details #

Limit #

inline void Limit(
    std::vector< data_t > & x,
    data_t lb,
    data_t ub
)

Limit #

inline void Limit(
    Vector & x,
    data_t lb,
    data_t ub
)

Limit #

inline void Limit(
    Matrix & x,
    data_t lb,
    data_t ub
)

Reassign #

inline void Reassign(
    Vector & some,
    const Vector & other,
    const std::string & parenthetical ="Reassign"
)

Parameters:

  • some some Vector
  • other other Vector
  • parenthetical optional description provided by caller to ease debugging

Reassign #

inline void Reassign(
    Matrix & some,
    const Matrix & other,
    const std::string & parenthetical ="Reassign"
)

Parameters:

  • some some Matrix
  • other other Matrix
  • parenthetical optional description provided by caller to ease debugging

ForceSymPD #

void ForceSymPD(
    Matrix & X
)

Parameters:

  • X mutated matrix

ForceSymMinEig #

void ForceSymMinEig(
    Matrix & X,
    data_t eig_min =0
)

Parameters:

  • X mutated matrix
  • eig_min [optional] minimum eigen value

lq #

void lq(
    Matrix & L,
    Matrix & Qt,
    const Matrix & X
)

Parameters:

  • L lower triangle matrix
  • Qt orthonormal matrix (transposed cf QR decomp)
  • X matrix being decomposed

calcCov #

Matrix calcCov(
    const Matrix & A,
    const Matrix & B
)

Parameters:

  • A some matrix
  • B some other matrix

Return: covariance

Attribute Details #

kControlTypeDeltaU #

static const std::size_t kControlTypeDeltaU = 0x1;

Control was designed to penalize change in input (i.e., the state was augmented with input u)

kControlTypeIntY #

static const std::size_t kControlTypeIntY = kControlTypeDeltaU << 1;

Control using integral action (i.e., the state was augmented with output y during design)

kControlTypeAdaptM #

static const std::size_t kControlTypeAdaptM = kControlTypeDeltaU << 2;

Adapt control setpoint adapted with re-estimated process disturbance m.

kInf #

static const data_t kInf = std::numeric_limits<data_t>::infinity();

kPi #

static const data_t kPi = arma::datum::pi;

kDefaultP0 #

static const data_t kDefaultP0 = 1e-6;

kDefaultQ0 #

static const data_t kDefaultQ0 = 1e-6;

kDefaultR0 #

static const data_t kDefaultR0 = 1e-2;

Updated on 19 May 2022 at 17:16:03 Eastern Daylight Time