Calculates the estimated states for the next time step k + 1 by using the corrected state estimate the CD Discrete Recursive Kalman Corrector VI calculates.

![]() |
Output y(k) specifies measurements made on the Stochastic State-Space Model. You can use the Discrete Stochastic State-Space (Internal) function to simulate the model and obtain this parameter. You also can wire in measurements made from a hardware sensor. | ||||||
![]() |
Initialize is TRUE if you want to restart the calculation from any initial values you provide. Initialize is FALSE if you do not want to restart this VI. The default value is FALSE. | ||||||
![]() |
Input u(k) specifies the control action this VI applies to the model. If you specify a vector of zeros for Input u(k) or do not wire a value to this parameter, this VI does not apply a control action. | ||||||
![]() |
Stochastic State-Space Model specifies a mathematical representation of a stochastic system. | ||||||
![]() |
Second-Order Statistics Noise Model specifies a mathematical representation of the noise model of a stochastic state-space model. | ||||||
![]() |
Initial State Estimate xhat(0|-1) specifies the initial states from which this VI begins estimating the model states. If you do not specify a value for this parameter, Initial State Estimate xhat(0|-1) is a vector of zeros. | ||||||
![]() |
error in describes error conditions that occur before this VI or function runs.
The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
| ||||||
![]() |
Initial Estimation Error Covariance P(0|-1) specifies the initial covariance of the estimation error associated with the Initial State Estimate xhat(0|-1). | ||||||
![]() |
State Estimate xhat(k|k-1) specifies the state estimate this VI calculated at the previous time step k – 1. | ||||||
![]() |
Estimation Error Covariance P(k|k-1) specifies the covariance of the estimation error associated with the State Estimate xhat(k|k-1). | ||||||
![]() |
Estimated Output yhat(k) returns the estimated model output at time k. | ||||||
![]() |
Predicted State Estimate xhat(k+1|k) returns the Kalman one-step-ahead states this VI estimates, given all observations up to and including time k. The length of this vector is equal to the number of model states. | ||||||
![]() |
Kalman Prediction Gain L(k) returns the gain matrix this VI uses to calculate the Predicted State Estimate xhat(k+1|k). | ||||||
![]() |
Prediction Error Covariance P(k+1|k) returns the covariance matrix of the estimation error associated with the Predicted State Estimate xhat(k+1|k), given all observations up to and including time k. |
This VI uses the following equations to calculate the outputs.
Predicted State Estimate xhat(k+1|k) = A(k) · State Estimate xhat(k|k-1) + B(k) · Input u(k) + Kalman Prediction Gain L(k) · [Output y(k) – Estimated Output y(k)]
Estimated Output yhat(k) = C · State Estimate xhat(k|k-1) + D · Input u(k)
Kalman Prediction Gain L(k) = [A(k) · Prediction Error Covariance P(k|k-1) · CT(k) + G(k)Q(k)HT(k) + G(k)N(k)] · [C(k) · Prediction Error Covariance P(k|k-1) · CT(k) + H(k)Q(k)HT(k) + H(k)N(k) + NT(k)HT(k) + R(k)]–1
Prediction Error Covariance P(k+1|k) = [A(k) · Prediction Error Covariance P(k|k-1) · AT(k) + G(k)Q(k)GT(k)] – Kalman Prediction Gain L(k) · [A(k) · Prediction Error Covariance P(k|k-1) · CT(k) + G(k)Q(k)HT(k) + G(k)N(k)]T
This VI adapts to changes in the Stochastic State-Space Model and the Second-Order Statistics Noise Model as long as the model dimensions do not change. Therefore, you can use this VI with LTV models.
This VI uses the Second-Order Statistics Noise Model to obtain the values of E{w(k)}, E{v(k)}, Q(k), R(k), and N(k). The following equations define these terms:

| where | δkl is the Kronecker delta function. The following equations defines this function: δkl = 1 when k = l; δkl = 0 when k ≠ l. |
| w(k) is the process noise vector. | |
| v(k) is the measurement noise vector. | |
| Q(k) is the covariance matrix of w(k). | |
| R(k) is the covariance matrix of v(k). | |
| N(k) is the cross-covariance matrix between w(k) and v(k). If these noise vectors are uncorrelated, N(k) is a matrix of zeros. | |
| E{} denotes the expected value or the mean of the enclosed term(s). |
The noise covariance matrices must satisfy the following conditions:
Q(k) = QT(k) ≥ 0
R(k) = RT(k) ≥ 0



This VI assumes these noise vectors are temporally uncorrelated between time steps. This VI also assumes the Initial State Estimate xhat(0|–1) is uncorrelated with the noise vectors. If the noise vectors are Gaussian-distributed, this VI is an optimal minimum mean square error (MMSE) estimator. However, if these vectors are not Gaussian-distributed, this VI is an optimal affine MMSE estimator.