Index-> contents reference index search external Previous Next Up-> ckbs utility ckbs_process_grad ckbs-> license ckbs_t_general ckbs_nonlinear ckbs_L1_nonlinear ckbs_affine ckbs_affine_singular ckbs_L1_affine utility all_ok.m whatsnew wishlist bib utility-> ckbs_t_obj ckbs_t_grad ckbs_t_hess ckbs_diag_solve ckbs_bidiag_solve ckbs_bidiag_solve_t ckbs_blkbidiag_symm_mul ckbs_blkdiag_mul ckbs_blkdiag_mul_t ckbs_blkbidiag_mul_t ckbs_blkbidiag_mul ckbs_blktridiag_mul ckbs_sumsq_obj ckbs_L2L1_obj ckbs_sumsq_grad ckbs_process_grad ckbs_sumsq_hes ckbs_process_hes ckbs_tridiag_solve ckbs_tridiag_solve_b ckbs_tridiag_solve_pcg ckbs_newton_step ckbs_newton_step_L1 ckbs_kuhn_tucker ckbs_kuhn_tucker_L1 ckbs_process_grad-> process_grad_ok.m Headings-> Syntax Purpose Notation Gradient x g dg qinv grad Example

Affine Residual Process Sum of Squares Gradient

Syntax
[grad] = ckbs_process_grad(       x, g, dg, qinv)

Purpose
This computes the gradient of the of the affine Kalman-Bucy smoother process residual sum of squares.

Notation
The affine Kalman-Bucy smoother process residual sum of squares is defined by   $\begin{array}{rcl} S ( x_1 , \ldots , x_N ) & = & \sum_{k=1}^N S_k ( x_k , x_{k-1} ) \\ S_k ( x_k , x_{k-1} ) & = & \frac{1}{2} ( x_k - g_k - G_k * x_{k-1} )^\R{T} * Q_k^{-1} * ( x_k - g_k - G_k * x_{k-1} ) \end{array}$  where the matrix   Q_k is symmetric positive definite and   x_0 is the constant zero.

We define   Q_{N+1} to be the   n \times n identity matrix and   G_{N+1} to be zero,   $\begin{array}{rcl} \nabla_k S_k^{(1)} ( x_k , x_{k-1} ) & = & Q_k^{-1} * ( x_k - g_k - G_k * x_{k-1} ) \\ \nabla_k S_{k+1}^{(1)} ( x_{k+1} , x_k ) & = & G_{k+1}^\R{T} * Q_{k+1}^{-1} * ( g_{k+1} + G_{k+1} * x_k - x_{k+1} ) \end{array}$  It follows that the gradient of the affine Kalman-Bucy smoother residual sum of squares is   $\begin{array}{rcl} \nabla S ( x_1 , \ldots , x_N ) & = & \left( \begin{array}{c} d_1 \\ \vdots \\ d_N \end{array} \right) \\ d_k & = & \nabla_k S_k^{(1)} ( x_k , x_{k-1} ) + \nabla_k S_{k+1}^{(1)} ( x_{k+1} , x_k ) \end{array}$  where   S_{N+1} ( x_{N+1} , x_N ) is defined as identically zero.

x
The argument x is a two dimensional array, for   k = 1 , \ldots , N   $x_k = x(:, k)$ and x has size   n \times N .

g
The argument g is a two dimensional array, for   k = 1 , \ldots , N   $g_k = g(:, k)$ and g has size   n \times N .

dg
The argument dg is a three dimensional array, for   k = 1 , \ldots , N   $G_k = dg(:,:,k)$ and dg has size   n \times n \times N .

qinv
The argument qinv is a three dimensional array, for   k = 1 , \ldots , N   $Q_k^{-1} = qinv(:,:,k)$ and qinv has size   n \times n \times N .

The result grad is a two dimensional array, for   k = 1 , \ldots , N   $d_k = grad(:, k)$ and grad has size   n \times N .
The file process_grad_ok.m contains an example and test of ckbs_process_grad. It returns true if ckbs_process_grad passes the test and false otherwise.