LinearModel Class Reference

Inheritance diagram for LinearModel:

Inheritance graph
[legend]

List of all members.


Detailed Description

Simple linear model.

Author:
Lawrence Murray <lawrence@indii.org>
Version:
Rev
Date:
Date
The system model takes the form:

\[\mathbf{x}_{t+1} = A\mathbf{x}_t + G\mathbf{w}_t\]

where $\mathbf{w}_t$ is Gaussian noise with zero mean and covariance matrix $Q$.

The measurement model takes the form:

\[\mathbf{y}_t = C\mathbf{x}_t + \mathbf{v}_t\]

where $\mathbf{v}_t$ is Gaussian noise with zero mean and covariance matrix $R$.

For notational convenience, we define $\hat{\mathbf{x}}_{t|t}$ as the expected value and $P_{t|t}$ as the covariance matrix of the distribution $P\big(x_t\,|\,y_1,\ldots,y_t\big)$.

Definition at line 39 of file LinearModel.hpp.


Public Member Functions

 LinearModel (indii::ml::aux::matrix &A, indii::ml::aux::matrix &G, indii::ml::aux::symmetric_matrix &Q, indii::ml::aux::matrix &C, indii::ml::aux::symmetric_matrix &R)
 Create new linear model.
virtual ~LinearModel ()
 Destructor.
virtual
indii::ml::aux::GaussianPdf 
p_xtnp1_ytn (const indii::ml::aux::GaussianPdf &p_xtn_ytn, const unsigned int delta)
 Predict next system state.
virtual
indii::ml::aux::GaussianPdf 
p_xtnp1_ytnp1 (const indii::ml::aux::GaussianPdf &p_xtnp1_ytn, const indii::ml::aux::vector &ytnp1, const unsigned int delta)
 Refine prediction of next system state using next measurement.
virtual
indii::ml::aux::GaussianPdf 
p_y_x (const indii::ml::aux::GaussianPdf &p_x)
 Predict measurement from system state.
virtual
indii::ml::aux::GaussianPdf 
p_xtn_ytT (const indii::ml::aux::GaussianPdf &p_xtnp1_ytT, const indii::ml::aux::GaussianPdf &p_xtnp1_ytn, const indii::ml::aux::GaussianPdf &p_xtn_ytn, const unsigned int delta)
 Perform smoothing update.
virtual
indii::ml::aux::GaussianPdf 
p_xtnm1_ytn (const indii::ml::aux::GaussianPdf &p_xtn_ytn, const unsigned int delta)
 Predict previous system state.
virtual
indii::ml::aux::GaussianPdf 
p_xtnm1_ytnm1 (const indii::ml::aux::GaussianPdf &p_xtnm1_ytn, const indii::ml::aux::vector &ytnm1, const unsigned int delta)
 Refine prediction of previous system state using previous measurement.

Constructor & Destructor Documentation

LinearModel ( indii::ml::aux::matrix A,
indii::ml::aux::matrix G,
indii::ml::aux::symmetric_matrix Q,
indii::ml::aux::matrix C,
indii::ml::aux::symmetric_matrix R 
)

Create new linear model.

Parameters:
A $A$
G $G$
Q $Q$
C $C$
R $R$
Todo:
System noise needn't have the same number of dimensions at the state, and likewise G may be N*P, not N*N, where P is the number of dimensions of the noise.

Definition at line 16 of file LinearModel.cpp.

~LinearModel (  )  [virtual]

Destructor.

Definition at line 39 of file LinearModel.cpp.


Member Function Documentation

aux::GaussianPdf p_xtnp1_ytn ( const indii::ml::aux::GaussianPdf p_xtn_ytn,
const unsigned int  delta 
) [virtual]

Predict next system state.

\begin{eqnarray*} \hat{\mathbf{x}}_{t+1|t} & = & A\hat{\mathbf{x}}_{t|t} \\ P_{t+1|t} & = & AP_{t|t}A^T + GQG^T \\ \end{eqnarray*}

Implements KalmanFilterModel< unsigned int >.

Definition at line 43 of file LinearModel.cpp.

aux::GaussianPdf p_xtnp1_ytnp1 ( const indii::ml::aux::GaussianPdf p_xtnp1_ytn,
const indii::ml::aux::vector ytnp1,
const unsigned int  delta 
) [virtual]

Refine prediction of next system state using next measurement.

Let the Kalman gain be defined as:

\[K_{t+1} = P_{t+1|t}C^T(CP_{t+1|t}C^T + R)^{-1}\]

Then the measurement update proceeds as follows:

\begin{eqnarray*} \hat{\mathbf{x}}_{t+1|t+1} & = & \hat{\mathbf{x}}_{t+1|t} + K_{t+1}(\mathbf{y}_{t+1} - C\hat{\mathbf{x}}_{t+1|t}) \\ P_{t+1|t+1} & = & P_{t+1|t} - K_{t+1}CP_{t+1|t} \\ \end{eqnarray*}

Todo:
Doesn't consider delta currently. Should iterate as many times as specified by delta, for example, in the case that there is a missing observation. Just do this using recursion.

Implements KalmanFilterModel< unsigned int >.

Definition at line 65 of file LinearModel.cpp.

aux::GaussianPdf p_y_x ( const indii::ml::aux::GaussianPdf p_x  )  [virtual]

Predict measurement from system state.

If p_x has mean $\hat{\mathbf{x}}$ and covariance $P_x$, the return value has mean $\hat{\mathbf{y}}$ and covariance $P_y$ defined by:

\begin{eqnarray*} \hat{\mathbf{y}} & = & C\hat{\mathbf{x}} \\ P_y & = & C P_x C^T + R \\ \end{eqnarray*}

Implements KalmanFilterModel< unsigned int >.

Definition at line 89 of file LinearModel.cpp.

aux::GaussianPdf p_xtn_ytT ( const indii::ml::aux::GaussianPdf p_xtnp1_ytT,
const indii::ml::aux::GaussianPdf p_xtnp1_ytn,
const indii::ml::aux::GaussianPdf p_xtn_ytn,
const unsigned int  delta 
) [virtual]

Perform smoothing update.

Let:

\[L_t = P_{t|t}A^TP_{t+1|t}^{-1}\]

The smoothing update proceeds as follows:

\begin{eqnarray*} \hat{\mathbf{x}}_{t|T} & = & \hat{\mathbf{x}}_{t|t} + L_t(\hat{\mathbf{x}}_{t+1|T} - \hat{\mathbf{x}}_{t+1|t}) \\ P_{t|T} & = & P_{t|t} + L_t(P_{t+1|T} - P_{t+1|t})L_t^T \\ \end{eqnarray*}

Implements RauchTungStriebelSmootherModel< unsigned int >.

Definition at line 104 of file LinearModel.cpp.

aux::GaussianPdf p_xtnm1_ytn ( const indii::ml::aux::GaussianPdf p_xtn_ytn,
const unsigned int  delta 
) [virtual]

Predict previous system state.

Parameters:
p_xtn_ytn $P\big(\mathbf{x}(t_n)\, | \,\mathbf{y}(t_n),\ldots,\mathbf{y}(t_T)\big)$; distribution over states at the current time given present and future measurements.
delta $\Delta t$; time step.
Returns:
$P\big(\mathbf{x}(t_n - \Delta t)\, | \,\mathbf{y}(t_n),\ldots,\mathbf{y}(t_T)\big)$; predicted distribution over states at time $t_n - \Delta t$ given future measurements.

Implements KalmanSmootherModel< unsigned int >.

Definition at line 131 of file LinearModel.cpp.

aux::GaussianPdf p_xtnm1_ytnm1 ( const indii::ml::aux::GaussianPdf p_xtnm1_ytn,
const indii::ml::aux::vector ytnm1,
const unsigned int  delta 
) [virtual]

Refine prediction of previous system state using previous measurement.

Parameters:
p_xtnm1_ytn $P\big(\mathbf{x}(t_n - \Delta t)\,|\,\mathbf{y}(t_n),\ldots,\mathbf{y}(t_T)\big)$; predicted distribution over states at time $t_n - \Delta t$ given the history of measurements. Typically obtained from prior call to p_xtnm1_ytn.
ytnm1 $\mathbf{y}(t_n - \Delta t)$; the measurement at time $t_n - \Delta t$.
delta $\Delta t$; time step.
Returns:
$P\big(\mathbf{x}(t_n - \Delta t)\, | \,\mathbf{y}(t_n - \Delta),\ldots,\mathbf{y}(t_T)\big)$; distribution over states at time $t_n - \Delta t$ given the present and future measurements.

Implements KalmanSmootherModel< unsigned int >.

Definition at line 182 of file LinearModel.cpp.


Generated on Wed Dec 17 15:11:58 2008 for dysii Dynamical Systems Library by  doxygen 1.5.3