当前位置:网站首页>Fundamentals of UD decomposition of KF UD decomposition [1]
Fundamentals of UD decomposition of KF UD decomposition [1]
2022-07-06 12:54:00 【Proletarians】
It's going on KF UD When decomposing , Variance of state vector - Covariance matrix P Yes, it is UD In the form of ,UD Decomposition is its foundation , The purpose of this article is to reduce the number of UD Decomposed learning time , If it can play the role of throwing bricks and attracting jade, it would be better .
One 、 The purpose of this chapter is three :
First , Let's be clear , What kind of matrix is a symmetric positive definite matrix ?
secondly , We need to know ,UD The form of decomposition is as follows :P=UDU^T, among ,U Is a unit upper triangular matrix ,D It's a diagonal matrix .
Last , We need to be able to code , That is, given a symmetric positive definite matrix P, You get the matrix U and D.
The following is lazy operation , Put the screenshot of the document directly ...
stay matlab Chinese handwriting UD The decomposed code is as follows , Please ignore code robustness :
% Realize the symmetric positive definite matrix UD decompose
% demo
% U = 1 2 3 4 D = 1 0 0 0 P = 95 66 38 16
% 0 1 2 3 0 3 0 0 66 47 28 12
% 0 0 1 2 0 0 2 0 38 28 18 8
% 0 0 0 1 0 0 0 4 16 12 8 4
P=[95 66 38 16;
66 47 28 12;
38 28 18 8;
16 12 8 4];
% P=[ 220 166 113 66 25
% 166 127 88 52 20
% 113 88 63 38 15
% 66 52 38 24 10
% 25 20 15 10 5];
% UD Principle of decomposition ( From right to left , From bottom to top , List before you go )
% because P Is a symmetric positive definite matrix , Only need to P The upper triangular element of
% 1、 Calculation P Number of matrix columns of
[pi,pj]=size(P);
U=diag(ones(pi,1));
D=diag(ones(pi,1));
if pj>1
disp('matrix P is ok!')
for i=pj:-1:1
Pii=P(i,i);
P_D_num=pj-i; % according to Pii To calculate Dii when , need D Number of elements
u2d=0.0;
if P_D_num>0
ip1=i+1;
for k=ip1:pj
u2d=u2d+D(k,k)*U(i,k)*U(i,k);
end
end
D(i,i)=Pii-u2d; % dii
disp(['P_col= ',num2str(i)])
if i==1
disp('UD over!') % First column
elseif i==pj
for j=1:pj-1
U(j,pj)=P(j,pj)/D(i,i); % The last column
end
else
ip1=i+1; % plus 1
im1=i-1; % minus 1
for k=1:im1;
disp(['P_row= ',num2str(k)])
udu=0.0;
for j=ip1:pj
udu=udu+U(k,j)*U(i,j)*D(j,j);
end
if j==pj
U(k,i)=(P(k,i)-udu)/D(i,i);
end
end
end
disp('-----------')
end
end
disp('D')
D
disp('U')
U
边栏推荐
- [algorithm] sword finger offer2 golang interview question 10: subarray with sum K
- Code example of MATLAB reading GNSS observation value o file
- C code implementation of robust estimation in rtklib's pntpos function (standard single point positioning spp)
- Idea problem record
- Unity3D,阿里云服务器,平台配置
- [GNSS] robust estimation (robust estimation) principle and program implementation
- GNSS定位精度指标计算
- [rtklib 2.4.3 B34] version update introduction I
- [算法] 剑指offer2 golang 面试题10:和为k的子数组
- Naive Bayesian theory derivation
猜你喜欢
FairyGUI复选框与进度条的组合使用
FairyGUI簡單背包的制作
[algorithm] sword finger offer2 golang interview question 12: the sum of the left and right sub arrays is equal
FairyGUI人物状态弹窗
Office prompts that your license is not genuine pop-up box solution
Design and implementation of general interface open platform - (39) simple and crude implementation of API services
FairyGUI简单背包的制作
Idea problem record
Guided package method in idea
[算法] 剑指offer2 golang 面试题2:二进制加法
随机推荐
Database course design: college educational administration management system (including code)
Fairygui character status Popup
地球围绕太阳转
FairyGUI人物状态弹窗
Problems and solutions of robust estimation in rtklib single point location spp
Matlab读取GNSS 观测值o文件代码示例
[leetcode19] delete the penultimate node in the linked list
Fairygui joystick
编辑距离(多源BFS)
Easy to use shortcut keys in idea
KF UD分解之伪代码实现进阶篇【2】
isEmpty 和 isBlank 的用法区别
[offer29] sorted circular linked list
Excel导入,导出功能实现
[rtklib 2.4.3 B34] version update introduction I
FairyGUI按钮动效的混用
Game 280 weekly
FairyGUI增益BUFF數值改變的顯示
[algorithm] sword finger offer2 golang interview question 7: 3 numbers with 0 in the array
1041 be unique (20 points (s)) (hash: find the first number that occurs once)