当前位置:网站首页>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 ------
边栏推荐
- @Autowired 和 @Resource 的区别
- How to add music playback function to Arduino project
- (四)R语言的数据可视化——矩阵图、柱状图、饼图、散点图与线性回归、带状图
- Servlet
- It has been solved by personal practice: MySQL row size too large (> 8126) Changing some columns to TEXT or BLOB or using ROW_ FORMAT
- Minio文件下载问题——inputstream:closed
- The master of double non planning left the real estate company and became a programmer with an annual salary of 25W. There are too many life choices at the age of 25
- FairyGUI简单背包的制作
- Expected value (EV)
- [offer18] delete the node of the linked list
猜你喜欢
Single chip Bluetooth wireless burning
idea中导包方法
Problèmes avec MySQL time, fuseau horaire, remplissage automatique 0
Pytorch: tensor operation (I) contiguous
Fairygui gain buff value change display
The master of double non planning left the real estate company and became a programmer with an annual salary of 25W. There are too many life choices at the age of 25
Affichage du changement de valeur du Buff de gain de l'interface graphique de défaillance
Symbolic representation of functions in deep learning papers
SVN更新后不出现红色感叹号
FairyGUI增益BUFF數值改變的顯示
随机推荐
FairyGUI按钮动效的混用
idea中导包方法
Classification, understanding and application of common methods of JS array
Mysql database reports an error: row size too large (> 8126) Changing some columns to TEXT or BLOB or using ROW_ FORMAT=DY
Problèmes avec MySQL time, fuseau horaire, remplissage automatique 0
[offer9] implement queues with two stacks
ORA-02030: can only select from fixed tables/views
Combination of fairygui check box and progress bar
[Clickhouse kernel principle graphic explanation] about the collaborative work of partitioning, indexing, marking and compressed data
Teach you to release a DeNO module hand in hand
Générateur d'identification distribué basé sur redis
[offer18] delete the node of the linked list
编译原理:源程序的预处理及词法分析程序的设计与实现(含代码)
It has been solved by personal practice: MySQL row size too large (> 8126) Changing some columns to TEXT or BLOB or using ROW_ FORMAT
Mysql database index
Common DOS commands
Fabrication d'un sac à dos simple fairygui
如何给Arduino项目添加音乐播放功能
Theoretical derivation of support vector machine
FairyGUI人物状态弹窗