当前位置:网站首页>KF UD分解之伪代码实现进阶篇【2】
KF UD分解之伪代码实现进阶篇【2】
2022-07-06 09:18:00 【Proletarians】
废话不多说,直接上伪代码,matlab版,易于阅读。
基于UD的KF分为两部分:
第一部分实现对残差和v的更新;
第二部分实现对D\U\b三部分的更新。
%% 基于UD分解的KF仿真代码
% ------ Part One Start ------
% 这部分实现 J>1 残差计算和v的更新
for J=n:-1:2
z=z-a(J)*x(J); % residual=delta_z
for K=1:J-1
a(J)=a(J)+U(K,J)*a(K); % f=U^T*a, 赋值后的a(J)就是f
end
v(J)=U(J,J)*a(J);% vi=di*fi
end
% 这部分实现 J=1 残差计算和v的更新
z=z-a(1)*x(1);
v(1)=U(1,1)*a(1);
% ------ Part One Last ------
% ------ Part Two Start------
% 这部分实现 J=1 矩阵D、矩阵U、未加权的KF增益b三部分更新
alpha=r+v(1)*a(1);
gamma=1.0/alpha;
U(1,1)=U(1,1)*r*gamma;
b(1)=v(1);
% 这部分实现 J>1 矩阵D、矩阵U、未加权的KF增益b三部分更新
for J=2:N
beta=alpha; % 将alpha(J-1)代入
alpha=alpha+v(J)*a(J); % 更新alpha(J)
p=-a(J)*gamma; % 将gamma(J-1)代入
gamma=1.0/alpha; % 更新gamma(J)
U(J,J)=U(J,J)*beta*gamma; % 更新D
b(J)=v(J);
for I=1:J-1
beta=U(I,J);
U(I,J)=beta+b(I)*p; % 更新U
b(I)=b(I)+v(J)*beta;% 更新b
end
end
z=z/alpha; % delta_z=delta_z/alpha,即delta_z为加权后的残差
for J=1:N
x(J)=x(J)+b(J)*z; % x_=x+(k)*delta_z=x+(b/alpha)*delta_z,即k=b/alpha,实现了对b的加权
end
% ------ Part Two Last ------
边栏推荐
- Solution to the problem of automatic login in Yanshan University Campus Network
- (课设第一套)1-4 消息传递接口 (100 分)(模拟:线程)
- (4) Data visualization of R language -- matrix chart, histogram, pie chart, scatter chart, linear regression and strip chart
- (一)R语言入门指南——数据分析的第一步
- (四)R语言的数据可视化——矩阵图、柱状图、饼图、散点图与线性回归、带状图
- Redis based distributed ID generator
- [leetcode19] delete the penultimate node in the linked list
- Unity3d camera, the keyboard controls the front and rear left and right up and down movement, and the mouse controls the rotation, zoom in and out
- JS function promotion and declaration promotion of VaR variable
- 1041 Be Unique (20 point(s))(哈希:找第一个出现一次的数)
猜你喜欢

FairyGUI摇杆

JS function promotion and declaration promotion of VaR variable

(4) Data visualization of R language -- matrix chart, histogram, pie chart, scatter chart, linear regression and strip chart

The dolphin scheduler remotely executes shell scripts through the expect command

Conditional probability

FairyGUI循环列表

dosbox第一次使用

Walk into WPF's drawing Bing Dwen Dwen

Compilation principle: preprocessing of source program and design and implementation of lexical analysis program (including code)

CUDA C programming authoritative guide Grossman Chapter 4 global memory
随机推荐
JS變量類型以及常用類型轉換
(1) Introduction Guide to R language - the first step of data analysis
Talking about the startup of Oracle Database
It has been solved by personal practice: MySQL row size too large (> 8126) Changing some columns to TEXT or BLOB or using ROW_ FORMAT
Special palindromes of daily practice of Blue Bridge Cup
Fairygui character status Popup
MySQL error warning: a long semaphore wait
JS Title: input array, exchange the largest with the first element, exchange the smallest with the last element, and output array.
Programming homework: educational administration management system (C language)
The service robots that have been hyped by capital and the Winter Olympics are not just a flash in the pan
FairyGUI增益BUFF數值改變的顯示
[offer29] sorted circular linked list
@Autowired 和 @Resource 的区别
FairyGUI簡單背包的制作
dosbox第一次使用
FairyGUI简单背包的制作
[golang] leetcode intermediate - fill in the next right node pointer of each node & the k-smallest element in the binary search tree
程序设计大作业:教务管理系统(C语言)
How to improve the deletion speed of sequential class containers?
Fairygui joystick