当前位置:网站首页>Using MATLAB to realize: power method, inverse power method (origin displacement)
Using MATLAB to realize: power method, inverse power method (origin displacement)
2022-07-02 07:23:00 【Drizzle】
Use Matlab Realization : Power law 、 Inverse power method ( Origin displacement )
Power law
Example
Use power method , Calculate the main eigenvalue of the following matrix and the corresponding eigenvector .
A = [ 2 − 1 0 − 1 2 − 1 0 − 1 2 ] A= \left[\begin{array}{ccc} 2 & -1 & 0\\ -1 & 2 & -1\\ 0 & -1 & 2 \end{array}\right] A=⎣⎡2−10−12−10−12⎦⎤
Realization
The mathematical iteration formula of power method is :
take v ( 0 ) ≠ 0 , α ≠ 0 , Make u ( 0 ) = v ( 0 ) take v^{(0)} \neq 0,\alpha \neq 0, Make u^{(0)} = v^{(0)} take v(0)̸=0,α̸=0, Make u(0)=v(0)
v ( 1 ) = A v ( 0 ) = A u ( 0 ) v^{(1)} = A v^{(0)} = A u^{(0)} v(1)=Av(0)=Au(0)
u ( 1 ) = v ( 1 ) m a x ( v ( 1 ) ) = A v ( 0 ) m a x ( A v ( 0 ) ) u^{(1)} = \frac{v^{(1)}}{max(v^{(1)})} = \frac{A v^{(0)}}{max(A v^{(0)})} u(1)=max(v(1))v(1)=max(Av(0))Av(0)
v ( 2 ) = A u ( 1 ) = A v ( 1 ) m a x ( A v ( 0 ) ) = A 2 v ( 0 ) m a x ( A 2 v ( 0 ) ) v^{(2)} = A u^{(1)} = \frac{Av^{(1)}}{max(A v^{(0)})} = \frac{A^2 v^{(0)}}{max(A^2 v^{(0)})} v(2)=Au(1)=max(Av(0))Av(1)=max(A2v(0))A2v(0)
u ( 2 ) = v ( 2 ) m a x ( v ( 2 ) ) = A 2 v ( 0 ) m a x ( A 2 v ( 0 ) ) u^{(2)} = \frac{v^{(2)}}{max(v^{(2)})} = \frac{A^2 v^{(0)}}{max(A^2 v^{(0)})} u(2)=max(v(2))v(2)=max(A2v(0))A2v(0)
By analogy .
Use Matlab Realization :
format long g;
v0 = [1;1;1];
u0 = [1;1;1];
A = [2,-1,0;-1,2,-1;0,-1,2];
v = A * u0;
u = v / norm(v, inf);
i = 0;
while norm(u - u0, inf) >= 1e-5
u0 = u;
v = A * u0;
u = v / norm(v, inf);
i ++;
end;
norm(v, inf)
i
u
To solve the need to :
i = 8 , u ( 9 ) = ( 0.70711 , − 1 , 0.70711 ) T , λ = m a x ( v ( 9 ) ) = 3.41422 i = 8,u^{(9)} = (0.70711, -1, 0.70711)^T,\lambda = max(v^{(9)}) = 3.41422 i=8,u(9)=(0.70711,−1,0.70711)T,λ=max(v(9))=3.41422
Inverse power method
Example
The following matrices are known to have eigenvalues λ \lambda λ Approximate value p = 4.3 p = 4.3 p=4.3 , Use the inverse power method of origin displacement , Find the corresponding eigenvector u u u , And improve λ \lambda λ .
A = [ 3 0 − 10 − 1 3 4 0 1 − 2 ] A= \left[\begin{array}{ccc} 3 & 0 & -10\\ -1 & 3 & 4\\ 0 & 1 & -2 \end{array}\right] A=⎣⎡3−10031−104−2⎦⎤
Realization
Inverse power method , Is based on the power method , A method for finding the minimum eigenvalue is derived . Due to the nature of eigenvalues , It can be used to find the exact eigenvalue of an approximate value .
The mathematical iteration method is as follows :
First , The matrix A − p I A - p I A−pI Triangulate , It is convenient to find the solution of the equations later .
A − p I = L U A - p I = L U A−pI=LU
seek v ( k ) v^{(k)} v(k) when , It is equivalent to finding two trigonometric equations .
{ L y ( k ) = u ( k − 1 ) U v ( k ) = y ( k ) \begin{cases} L y^{(k)} = u^{(k - 1)}\\ U v^{(k)} = y^{(k)}\\ \end{cases} { Ly(k)=u(k−1)Uv(k)=y(k)
And then there is :
u ( k ) = v ( k ) m a x ( v ( k ) ) u^{(k)} = \frac{v^{(k)}}{max(v^{(k)})} u(k)=max(v(k))v(k)
Use Matlab Realization :
A = [3,0,-10;-1,3,4;0,1,-2];
I = eye(3,3);
p = 4.3;
u0 = [1;1;1];
v = inv(A - p * I) * u0;
u = v / norm(v, inf);
i = 0;
while norm(u - u0, inf) > 1e-5
u0 = u;
v = inv(A - p * I) * u0;
u = v / norm(v, inf);
i ++;
end;
i
u
x = p + 1 / norm(v, inf)
To solve the need to :
i = 6 , u ( 7 ) = ( − 0.96606 , 1 , 0.15210 ) T , λ = p + 1 m a x ( v ( k ) ) = 4.57447 i = 6,u^{(7)} = (-0.96606, 1, 0.15210)^T,\lambda = p + \frac{1}{max(v^{(k)})} = 4.57447 i=6,u(7)=(−0.96606,1,0.15210)T,λ=p+max(v(k))1=4.57447
边栏推荐
- Oracle rman自动恢复脚本(生产数据向测试迁移)
- Conda 创建,复制,分享虚拟环境
- Oracle 11g sysaux table space full processing and the difference between move and shrink
- 【信息检索导论】第一章 布尔检索
- ORACLE EBS接口开发-json格式数据快捷生成
- 【Torch】解决tensor参数有梯度,weight不更新的若干思路
- 解决万恶的open failed: ENOENT (No such file or directory)/(Operation not permitted)
- ssm超市订单管理系统
- [introduction to information retrieval] Chapter 1 Boolean retrieval
- How to efficiently develop a wechat applet
猜你喜欢

中年人的认知科普

Proteus -- RS-232 dual computer communication

Check log4j problems using stain analysis

离线数仓和bi开发的实践和思考

2021-07-05c /cad secondary development create arc (4)
![[paper introduction] r-drop: regulated dropout for neural networks](/img/09/4755e094b789b560c6b10323ebd5c1.png)
[paper introduction] r-drop: regulated dropout for neural networks

ORACLE 11G利用 ORDS+pljson来实现json_table 效果

Sparksql data skew

第一个快应用(quickapp)demo

SSM学生成绩信息管理系统
随机推荐
oracle-外币记账时总账余额表gl_balance变化(上)
[introduction to information retrieval] Chapter 3 fault tolerant retrieval
Oracle apex Ajax process + dy verification
矩阵的Jordan分解实例
PHP uses the method of collecting to insert a value into the specified position in the array
view的绘制机制(三)
SSM student achievement information management system
数仓模型事实表模型设计
ORACLE APEX 21.2安装及一键部署
【调参Tricks】WhiteningBERT: An Easy Unsupervised Sentence Embedding Approach
A summary of a middle-aged programmer's study of modern Chinese history
CSRF attack
Feeling after reading "agile and tidy way: return to origin"
How to call WebService in PHP development environment?
【论文介绍】R-Drop: Regularized Dropout for Neural Networks
MySQL composite index with or without ID
sparksql数据倾斜那些事儿
Check log4j problems using stain analysis
Yolov5 practice: teach object detection by hand
[medical] participants to medical ontologies: Content Selection for Clinical Abstract Summarization