KalmanFilter
ddekf_predict_phase.m
Go to the documentation of this file.
1 function [estimate, covariance_sqrt] = ddekf_predict_phase(f_func,jacobian_func,t,P_0_sqrt,x_0,Q_root)
2 %runs predict portion of update of the dd-ekf
3 %[estimate, covariance_sqrt] ddekf_predict_phase(f_func,jacobian_func,t,P_0_sqrt,x_0,Q_root)
4 %INPUT:
5 % f_func: x_{k+1} = f_func(x_k,t) where x_k is the state. The
6 % function's second argument is time t for cases when the function
7 % changes with time.
8 %
9 % jacobian_func: the jacobian of f_func at state x and time t
10 % jacobian_func(x,t)
11 %
12 % t: current time
13 %
14 % X_0: estimate of x at start_time
15 %
16 % P_0_sqrt: square root factor of covariance P at
17 % start_time. P_0 = P_0_sqrt*(P_0_sqrt')
18 %
19 % Q_root: square root of process noise covariance matrix
20 % Q where Q = Q_root*(Q_root');
21 %
22 %OUTPUT:
23 % estimate: estimate of x after predict phase
24 %
25 % covariance_sqrt: square root of covariance P after predict phase
26 % P = covariance_sqrt*(covariance_sqrt')
27 
28  x = x_0;
29  state_count = length(x);
30 
31  estimate = f_func(x,t);
32  jac = jacobian_func(x,t);
33  [~, covariance_sqrt] = qr([jac*P_0_sqrt,Q_root]');
34  covariance_sqrt = covariance_sqrt';
35  covariance_sqrt = covariance_sqrt(1:state_count,1:state_count);
36 end
function ddekf_predict_phase(in f_func, in jacobian_func, in t, in P_0_sqrt, in x_0, in Q_root)