@staticmethod<EOL><INDENT>def _kalman_prediction_step_SVD(k, p_m , p_P, p_dyn_model_callable, calc_grad_log_likelihood=False,<EOL>p_dm = None, p_dP = None):<DEDENT>
<EOL>Prev_cov, S_old, V_old = p_P<EOL>A = p_dyn_model_callable.Ak(k,p_m,Prev_cov) <EOL>Q = p_dyn_model_callable.Qk(k) <EOL>Q_sr = p_dyn_model_callable.Q_srk(k)<EOL>m_pred = p_dyn_model_callable.f_a(k, p_m, A) <EOL>svd_1_matr = np.vstack( ( (np.sqrt(S_old)* np.dot(A,V_old)).T , Q_sr.T) )<EOL>(U,S,Vh) = sp.linalg.svd( svd_1_matr,full_matrices=False, compute_uv=True,<EOL>overwrite_a=False,check_finite=True)<EOL>V_new = Vh.T<EOL>S_new = S**<NUM_LIT:2><EOL>P_pred = np.dot(V_new * S_new, V_new.T) <EOL>P_pred = (P_pred, S_new, Vh.T)<EOL>if calc_grad_log_likelihood:<EOL><INDENT>dA_all_params = p_dyn_model_callable.dAk(k) <EOL>dQ_all_params = p_dyn_model_callable.dQk(k) <EOL>param_number = p_dP.shape[<NUM_LIT:2>]<EOL>dm_pred = np.empty(p_dm.shape)<EOL>dP_pred = np.empty(p_dP.shape)<EOL>for j in range(param_number):<EOL><INDENT>dA = dA_all_params[:,:,j]<EOL>dQ = dQ_all_params[:,:,j]<EOL>dm_pred[:,:,j] = np.dot(dA, p_m) + np.dot(A, p_dm[:,:,j])<EOL>dP_pred[:,:,j] = np.dot( dA ,np.dot(Prev_cov, A.T))<EOL>dP_pred[:,:,j] += dP_pred[:,:,j].T<EOL>dP_pred[:,:,j] += np.dot( A ,np.dot(p_dP[:,:,j], A.T)) + dQ<EOL>dP_pred[:,:,j] = <NUM_LIT:0.5>*(dP_pred[:,:,j] + dP_pred[:,:,j].T) <EOL><DEDENT><DEDENT>else:<EOL><INDENT>dm_pred = None<EOL>dP_pred = None<EOL><DEDENT>return m_pred, P_pred, dm_pred, dP_pred<EOL>
Desctrete prediction function

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)
        Mean value from the previous step. For "multiple time series mode"
        it is matrix, second dimension of which correspond to different
        time series.

    p_P: tuple (Prev_cov, S, V)
        Covariance matrix from the previous step and its SVD decomposition.
        Prev_cov = V * S * V.T The tuple is (Prev_cov, S, V)

    p_dyn_model_callable: object

    calc_grad_log_likelihood: boolean
        Whether to calculate gradient of the marginal likelihood
        of the state-space model. If true then the next parameter must
        provide the extra parameters for gradient calculation.

    p_dm: 3D array (state_dim, time_series_no, parameters_no)
        Mean derivatives from the previous step. For "multiple time series mode"
        it is 3D array, second dimension of which correspond to different
        time series.

    p_dP: 3D array (state_dim, state_dim, parameters_no)
        Mean derivatives from the previous step

Output:
----------------------------
m_pred, P_pred, dm_pred, dP_pred: metrices, 3D objects
    Results of the prediction steps.