@staticmethod<EOL><INDENT>def _rts_smoother_update_step(k, p_m , p_P, p_m_pred, p_P_pred, p_m_prev_step,<EOL>p_P_prev_step, p_dynamic_callables):<DEDENT>
A = p_dynamic_callables.Ak(k,p_m,p_P) <EOL>tmp = np.dot( A, p_P.T)<EOL>if A.shape[<NUM_LIT:0>] == <NUM_LIT:1>: <EOL><INDENT>G = tmp.T / p_P_pred <EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>LL,islower = linalg.cho_factor(p_P_pred)<EOL>G = linalg.cho_solve((LL,islower),tmp).T<EOL><DEDENT>except:<EOL><INDENT>res = sp.linalg.lstsq(p_P_pred, tmp)<EOL>G = res[<NUM_LIT:0>].T<EOL><DEDENT><DEDENT>m_upd = p_m + G.dot( p_m_prev_step-p_m_pred )<EOL>P_upd = p_P + G.dot( p_P_prev_step-p_P_pred).dot(G.T)<EOL>P_upd = <NUM_LIT:0.5>*(P_upd + P_upd.T)<EOL>return m_upd, P_upd, G<EOL>
Rauch–Tung–Striebel(RTS) update step

Input:
-----------------------------
k: int
      Iteration No. Starts at 0. Total number of iterations equal to the
      number of measurements.

p_m: matrix of size (state_dim, time_series_no)
     Filter mean on step k

p_P:  matrix of size (state_dim,state_dim)
     Filter Covariance on step k

p_m_pred: matrix of size (state_dim, time_series_no)
     Means from the smoother prediction step.

p_P_pred:
     Covariance from the smoother prediction step.

p_m_prev_step
    Smoother mean from the previous step.

p_P_prev_step:
    Smoother covariance from the previous step.

p_f_A: function (k, m, P) return Jacobian of dynamic function, it is
    passed into p_a.
    k (iteration number), starts at 0
    m: point where Jacobian is evaluated
    P: parameter for Jacobian, usually covariance matrix.