2 %runs predict portion of update of the dd-ekf
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 11 % X_0: estimate of x at start_time 13 % P_0_sqrt: square root factor of covariance P at 14 % start_time. P_0 = P_0_sqrt*(P_0_sqrt')
16 % Q_root: square root of process noise covariance matrix
17 % Q where Q = Q_root*(Q_root
'); 20 % estimate: estimate of x after predict phase 22 % covariance_sqrt: square root of covariance P after predict phase 23 % P = covariance_sqrt*(covariance_sqrt')
26 state_count = length(x);
28 sigma_points = zeros(state_count,state_count*2);
29 sigma_points(:,1:state_count) = x_0 + P_0_sqrt*sqrt(state_count).*eye(state_count,state_count);
30 sigma_points(:,(state_count+1):end) = x_0 - P_0_sqrt*sqrt(state_count).*eye(state_count,state_count);
32 for i=1:(2*state_count)
33 sigma_points(:,i) = f_func(sigma_points(:,i),t);
36 estimate = (1/(2*state_count))*sum(sigma_points,2);
38 covariance = zeros(state_count,state_count);
39 for i=1:(2*state_count)
40 covariance = covariance + (sigma_points(:,i)-estimate)*(sigma_points(:,i)-estimate)
'; 42 covariance = 1/(2*state_count) * covariance + Q_root*Q_root';
44 covariance_sqrt = chol(covariance)
'; function cubature_predict_phase(in f_func, in t, in P_0_sqrt, in x_0, in Q_root)