当前位置:网站首页>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 ------
边栏推荐
- JS regular expression basic knowledge learning
- [Red Treasure Book Notes simplified version] Chapter 12 BOM
- 2021.11.10 compilation examination
- Detailed explanation of truncate usage
- (3) Introduction to bioinformatics of R language - function, data Frame, simple DNA reading and analysis
- level16
- About using @controller in gateway
- Gateway fails to route according to the service name, and reports an error service unavailable, status=503
- Office prompts that your license is not genuine pop-up box solution
- Flink late data processing (3)
猜你喜欢
Easy to use shortcut keys in idea
Générateur d'identification distribué basé sur redis
Gravure sans fil Bluetooth sur micro - ordinateur à puce unique
Lock wait timeout exceeded try restarting transaction
Database course design: college educational administration management system (including code)
Whistle+switchyomega configure web proxy
FairyGUI增益BUFF数值改变的显示
[Nodejs] 20. Koa2 onion ring model ----- code demonstration
SVN更新后不出现红色感叹号
Idea problem record
随机推荐
Page performance optimization of video scene
Basic operations of databases and tables ----- modifying data tables
Gravure sans fil Bluetooth sur micro - ordinateur à puce unique
ESP8266连接onenet(旧版MQTT方式)
[Leetcode15]三数之和
Symbolic representation of functions in deep learning papers
基於Redis的分布式ID生成器
[Nodejs] 20. Koa2 onion ring model ----- code demonstration
dosbox第一次使用
2021.11.10汇编考试
Force buckle 1189 Maximum number of "balloons"
It has been solved by personal practice: MySQL row size too large (> 8126) Changing some columns to TEXT or BLOB or using ROW_ FORMAT
Unity3D基础入门之粒子系统(属性介绍+火焰粒子系统案例制作)
Gateway 根据服务名路由失败,报错 Service Unavailable, status=503
Programming homework: educational administration management system (C language)
Générateur d'identification distribué basé sur redis
Unity3D摄像机,键盘控制前后左右上下移动,鼠标控制旋转、放缩
(1) Introduction Guide to R language - the first step of data analysis
JS variable types and common type conversions
(4) Data visualization of R language -- matrix chart, histogram, pie chart, scatter chart, linear regression and strip chart