lds::Fit

lds::Fit #

LDS Fit Type.
#include <lds_fit.h>

Inherited by lds::gaussian::Fit, lds::poisson::Fit

Public Functions #

Name
Fit() =default
Constructs a new Fit.
Fit(size_t n_u, size_t n_x, size_t n_y, data_t dt)
Constructs a new Fit.
virtual ~Fit() =default
size_t n_u() const
gets number of inputs
size_t n_x() const
gets number of states
size_t n_y() const
gets number of outputs
data_t dt() const
gets sample period
const Matrix & A() const
gets state matrix
const Matrix & B() const
gets input matrix
const Vector & g() const
gets input gain
const Vector & m() const
gets process disturbance
const Matrix & Q() const
gets process noise covariance
const Vector & x0() const
gets initial state estimate
const Matrix & P0() const
gets covariance of initial state estimate
const Matrix & C() const
gets output matrix
const Vector & d() const
gets output bias
virtual const Matrix & R() const =0
void set_A(const Matrix & A)
sets state matrix
void set_B(const Matrix & B)
sets input matrix
void set_g(const Vector & g)
sets input gain/conversion factor
void set_m(const Vector & m)
sets process disturbance
void set_Q(const Matrix & Q)
sets process noise covariance
virtual void set_R(const Matrix & R) =0
sets output noise covariance (if any)
void set_x0(const Vector & x0)
sets initial state estimate
void set_P0(const Matrix & P0)
sets initial state estimate covariance
void set_C(const Matrix & C)
sets output matrix
void set_d(const Vector & d)
sets output bias
View f(Matrix & x, const Matrix & u, size_t t)
system dynamics function
View f(Matrix & x_pre, const Matrix & x_post, const Matrix & u, size_t t)
system dynamics function
virtual View h(Matrix & y, const Matrix & x, size_t t) =0
output function

Protected Attributes #

Name
data_t dt_
sample period
Matrix A_
state matrix
Matrix B_
input matrix
Vector g_
input gain
Vector m_
process noise mean
Matrix Q_
process noise cov
Matrix C_
output matrix
Vector d_
output bias
Matrix R_
measurement noise
Vector x0_
initial state
Matrix P0_
initial covar
size_t n_u_
number of inputs
size_t n_x_
number of states
size_t n_y_
number of outputs


Public Function Details #

Fit #

Fit() =default

Fit #

Fit(
    size_t n_u,
    size_t n_x,
    size_t n_y,
    data_t dt
)

Parameters:

  • n_u number of inputs
  • n_x number of states
  • n_y number of outputs
  • dt sample period

~Fit #

virtual ~Fit() =default

n_u #

inline size_t n_u() const

n_x #

inline size_t n_x() const

n_y #

inline size_t n_y() const

dt #

inline data_t dt() const

A #

inline const Matrix & A() const

B #

inline const Matrix & B() const

g #

inline const Vector & g() const

m #

inline const Vector & m() const

Q #

inline const Matrix & Q() const

x0 #

inline const Vector & x0() const

P0 #

inline const Matrix & P0() const

C #

inline const Matrix & C() const

d #

inline const Vector & d() const

R #

virtual const Matrix & R() const =0

Reimplemented by: lds::gaussian::Fit::R, lds::poisson::Fit::R


set_A #

inline void set_A(
    const Matrix & A
)

set_B #

inline void set_B(
    const Matrix & B
)

set_g #

inline void set_g(
    const Vector & g
)

set_m #

inline void set_m(
    const Vector & m
)

set_Q #

inline void set_Q(
    const Matrix & Q
)

set_R #

virtual void set_R(
    const Matrix & R
) =0

Reimplemented by: lds::gaussian::Fit::set_R, lds::poisson::Fit::set_R


set_x0 #

inline void set_x0(
    const Vector & x0
)

set_P0 #

inline void set_P0(
    const Matrix & P0
)

set_C #

inline void set_C(
    const Matrix & C
)

set_d #

inline void set_d(
    const Vector & d
)

f #

inline View f(
    Matrix & x,
    const Matrix & u,
    size_t t
)

Parameters:

  • x state estimate (over time)
  • u input (over time)
  • t time index

Return: view of updated state


f #

inline View f(
    Matrix & x_pre,
    const Matrix & x_post,
    const Matrix & u,
    size_t t
)

Parameters:

  • x_pre predicted state est.
  • x_post posterior state est.
  • u input (over time)
  • t time index

Return: view of predicted state


h #

virtual View h(
    Matrix & y,
    const Matrix & x,
    size_t t
) =0

Parameters:

  • y output estimate (over time)
  • x state estimate (over time)
  • t time index

Return: output

Reimplemented by: lds::poisson::Fit::h, lds::gaussian::Fit::h


Protected Attribute Details #

**dt_** #

data_t dt_ {};

**A_** #

Matrix A_;

**B_** #

Matrix B_;

**g_** #

Vector g_;

**m_** #

Vector m_;

**Q_** #

Matrix Q_;

**C_** #

Matrix C_;

**d_** #

Vector d_;

**R_** #

Matrix R_;

**x0_** #

Vector x0_;

**P0_** #

Matrix P0_;

**n_u_** #

size_t n_u_ {};

**n_x_** #

size_t n_x_ {};

**n_y_** #

size_t n_y_ {};


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