SlideShare a Scribd company logo
1 of 24
Download to read offline
Spectral Decomposition and its Applications
Senthil Kumarasamy
Gyan Data Private Limited
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 1 / 23
Contents
1 Eigen values and Eigen vectors
2 Spectral decomposition
3 Gram Schmidt orthogonalization
4 QR factorization
5 QR algorithm for finding Eigen values
6 Gaussian elimination to find Eigen vectors
7 Implementation in Matlab
8 Applications
Decoupling of linear differential equations
Dimensionality reduction
Filtering
Identification of linear model from data
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 2 / 23
Eigen values and Eigen vectors
Given a matrix A ∈ Rn×n
Ax = λx
where x ∈ Rn and λ ∈ R. λ is called Eigen value of A, and x is
called the Eigen vector of A corresponding to λ
To find Eigen values,
Ax = λx
Ax − λx = 0
(A − λI)x = 0
In order to have non trival solution to the above equation, matrix
A − λI must be singular. Hence |A − λI| = 0
|A − λI| = 0 is called characteristic equation of A. This is a
polynomial of degree n in λ, and it has n solutions namely λ1 . . . λn
Corresponding to each λi, there is an Eigen vector xi
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 3 / 23
Spectral Decomposition
Ax1 = λ1x1
...
Axn = λnxn
A


| |
x1 . . . xn
| |

 =


| |
x1 . . . xn
| |





λ1
...
λn



A =


| |
x1 . . . xn
| |


P



λ1
...
λn



Σ


| |
x1 . . . xn
| |


−1
P−1
A = PΣP−1
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 4 / 23
Examples
Find eigen values of A =


0 −1 −3
2 3 3
−2 1 1


Solution
|A − λI| =
0 − λ −1 −3
2 3 − λ 3
−2 1 1 − λ
= −λ
3 − λ 3
1 1 − λ
+ 1
2 3
−2 1 − λ
− 3
2 3 − λ
−2 1
= λ3
− 4λ2
− 4λ + 16
Solving λ3 − 4λ2 − 4λ + 16 = 0, we get λ = 2, −2, 4
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 5 / 23
Examples contd.
Find eigen values of A =


3 2 1
0 2 3
0 0 5


Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 6 / 23
Examples contd.
Find eigen values of A =


3 2 1
0 2 3
0 0 5


Solution
|A − λI| =
3 − λ 2 1
0 2 − λ 3
0 0 5 − λ
= (3 − λ)
2 − λ 3
0 5 − λ
− 2
0 3
0 5 − λ
+ 1
0 2 − λ
0 0
= (3 − λ)(2 − λ)(5 − λ)
Solving (3 − λ)(2 − λ)(5 − λ) = 0, we get λ = 3, 2, 5
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 6 / 23
Examples contd.
Find eigen values of A =


3 2 1
0 2 3
0 0 5


Solution
|A − λI| =
3 − λ 2 1
0 2 − λ 3
0 0 5 − λ
= (3 − λ)
2 − λ 3
0 5 − λ
− 2
0 3
0 5 − λ
+ 1
0 2 − λ
0 0
= (3 − λ)(2 − λ)(5 − λ)
Solving (3 − λ)(2 − λ)(5 − λ) = 0, we get λ = 3, 2, 5
Observation: If A is a triangular (Upper or Lower or Diagonal)
matrix, then Eigen values of A are its diagonal elements.
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 6 / 23
Introduction to QR algorithm
QR algorithm applies Similarity transformations iteratively to
reduce the given matrix to a diagonal matrix
Similarity transformations are those that preserve Eigen values of
the matrix
To get a similarity transformation, QR factorization is employed.
QR factorization uses Gram Schmidt orthogonalization
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 7 / 23
Gram Schmidt orthogonalization
A =
3 2
1 2
v1 =
3
1
, v2 =
2
2
u1 = v1
e1 = u1
u1
=
3 2
T
√
32+12
= 1√
10
3
1
u2 = v2− (vT
2 e1)e1
Proj of v2 on e1
= 1
5
−2
6
e2 = u2
u2
= 1√
10
−1
3
Q = 1√
10
3 −1
1 3
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 8 / 23
QR factorization
A = QR
A, Q, R are n × n matrices
QT Q = I
R is upper triangular matrix
Example

0 1 1
1 1 2
0 0 3


A
=


0 1 0
1 0 0
0 0 1


Q


1 1 2
0 1 1
0 0 3


R
QT Q =


0 1 0
1 0 0
0 0 1


T 

0 1 0
1 0 0
0 0 1

 =


1 0 0
0 1 0
0 0 1


Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 9 / 23
QR factorization
A = v1 v2 v3 where v1, v2, v3 are columns of matrix A
Apply Gram Schmidt Orthogonalization to A matrix
u1 = v1
e1 = v1
v1
u2 = v2 − (vT
2 e1)e1
e2 = u2
u2
u3 = v3 − (vT
3 e1)e1 − (vT
3 e2)e2
e3 = u3
u3
QR factorization
A = e1 e2 e3
Q


v1 vT
2 e1 vT
3 e1
0 v2 vT
2 e1
0 0 v3


R
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 10 / 23
Matlab code for QR factorization
function [ Q , R ] = qr_factorization1(A)
[ r , c ] = size (A) ;
Q = zeros (r , r) ;
R = zeros (r , r) ;
R(1 ,1) = sqrt (sum(A ( : , 1 ) . * A ( : , 1 ) ) ) ;
i f abs (R(1 ,1) ) > 1e−5
Q ( : , 1 ) = A ( : , 1 ) / R(1 ,1) ;
else
Q ( : , 1 ) = 0;
end
f o r i = 2:r
Q ( : , i) = A ( : , i) ;
f o r j = 1:i−1
R(j , i) = sum(A ( : , i) . * Q ( : , j) ) ;
Q ( : , i) = Q ( : , i) − R(j , i) * Q ( : , j) ;
end
R(i , i) = sqrt (sum(Q ( : , i) . * Q ( : , i) ) ) ;
i f abs (R(i , i) ) > 1e−5
Q ( : , i) = Q ( : , i) / R(i , i) ;
else
Q ( : , i) = 0;
end
end
end
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 11 / 23
QR Algorithm
Algorithm
1 Set Ai = A, the given matrix
2 Q, R = qr factorization(Ai)
3 Set Ai = RQ
4 Perform steps 2 and 3 until convergence
RQ transformation
A = QR
QT A = QT QR = R
RQ = QT
AQ
Similarity transform
Properties of similarity transform
1 Preserve the Eigen values (λ) of A
2 Kill the off diagonal elements of A
Preserves λ
|QT AQ − λI| =
|QT AQ − λQT IQ| =
|QT (A − λI)Q| =
|QT | × |A − λI| × |Q| =
|Q−1| × |A − λI| × |Q| =
|A−λI|×|Q|
|Q| =
|A − λI|
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 12 / 23
Matlab code for finding Eigen values
function eig = eigen_values(A)
M = A ;
f o r i = 1:60
[ Q , R ] = qr_factorization(M) ;
M = R*Q ;
end
eig = diag (M) ;
[ eig1 , ind ] = sort ( abs ( eig ) , ' descend ' ) ;
eig = eig (ind) ;
end
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 13 / 23
Eigen Vectors
(A − λI)
¯A
x = 0
¯Ax = 0
¯Q ¯Rx = 0
¯QT ¯Q ¯Rx = 0
¯Rx = 0
Example:
A =


0 1 1
1 1 2
0 0 3


λ =
−0.62, 1.62, 3.0
For λ = 3

0 1 1
1 1 2
0 0 3

 − 3


1 0 0
0 1 0
0 0 1

 x = 0


−3 1 1
1 −2 2
0 0 0

 x = 0


−0.949 −0.316 0
0.316 −0.949 0
0 0 0




3.162 −1.581 −0.316
0 1.581 −2.214
0 0 0

 x = 0
pre-multiplying both sides by QT , we get


3.162 −1.581 −0.316
0 1.581 −2.214
0 0 0

 x = 0
Slove for x by back substitution
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 14 / 23
Matlab code for Back Substitution
function x = back_substitution(R)
[ r , c ] = size (R) ;
x = zeros (r) ;
f o r i = r:−1:1
i f abs (R(i , i) ) < 1e−5
x(i) = 1;
continue ;
end
summ = 0.0;
f o r j = r: −1:i
summ = summ + R(i , j) * x(j) ;
end
x(i) = −summ / R(i , i) ;
end
end
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 15 / 23
Matlab code for finding Eigen vectors
function [ vec , val ] = eigen_val_vec(M)
[ r , c ] = size (M) ;
val = eigen_values(M) ;
vec = zeros (r) ;
f o r i = 1:r
A = M − eye (r) * val(i) ;
[ Q , R ] = qr_factorization(A) ;
x = back_substitution(R) ;
vec ( : , i) = x / sqrt (sum(x . * x) ) ;
end
end
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 16 / 23
Applications
Decoupling of differential equations
Consider systems of equations
dx1
dt
= 2x1 + 3x2
dx2
dt
= 2x1 + x2
˙x1
˙x2
˙X
=
2 3
2 1
A
x1
x2
X
˙X = AX
˙X = PΣP−1X
substituting X = PY
P ˙Y = PΣP−1PY
P ˙Y = PΣY
pre-multiplying both side with P−1
P−1
P ˙Y = P−1PΣY
˙Y = ΣY
˙y1
˙y2
=
4 0
0 −1
y1
y2
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 17 / 23
Applications
Data compression, filtering, model identification (PCA)




1 −1 −1 0 0 0
0 1 0 −1 0 0
0 1 0 0 −1 0
0 0 0 1 1 −1












x1
x2
x3
x4
x5
x6








=




0
0
0
0




Data
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 18 / 23
Applications
Steps to data compression, filtering, model identification (PCA)
Let Z be data matrix. Each column of Z represents a flow variable
Compute S = 1
N ZT Z where N is no. of data points
Find Eigen values, and Eigen vectors of S
Let columns of U1 consists of Eigen vectos corresponding
significant Eigen values
Let columns of U2 consists of Eigen vectors corresponding to
insignificant Eigen values.
Then UT
2 represents the underlying model equations
Compressed data is C = ZU1
Filtered data is F = CUT
1
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 19 / 23
(Applications)
Matlab code for compression, filtering, and model identification
clear a l l ;
clc ;
M = csvread ( ” flow_with_noise . csv ” ) ;
[ r , c ] = size (M) ;
S = M ' * M / r ;
[ eig_vec , eig_val ] = eigen_val_vec(S) ;
basis = eig_vec ( : , 5 : 6 ) ;
model = eig_vec ( : , 1 : 4 ) ' ;
compressed_data = M * basis ;
filtered_data = compressed_data * basis ' ;
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 20 / 23
Exercises
Limitations of our code
Extend QR factorization code for rectangular matrices
Modify QR Algorithm code for finding out complex Eigen values
Back substitution code can be extended for handling repeated
Eigen values
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 21 / 23
Thank you
Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 22 / 23

More Related Content

What's hot

Statistical signal processing(1)
Statistical signal processing(1)Statistical signal processing(1)
Statistical signal processing(1)Gopi Saiteja
 
Kalman filter for Beginners
Kalman filter for BeginnersKalman filter for Beginners
Kalman filter for Beginnerswinfred lu
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effectsPeriyanayagiS
 
Discrete Fourier Transform
Discrete Fourier TransformDiscrete Fourier Transform
Discrete Fourier TransformAbhishek Choksi
 
Fuzzy relations
Fuzzy relationsFuzzy relations
Fuzzy relationsnaugariya
 
An introduction to discrete wavelet transforms
An introduction to discrete wavelet transformsAn introduction to discrete wavelet transforms
An introduction to discrete wavelet transformsLily Rose
 
Properties of fourier transform
Properties of fourier transformProperties of fourier transform
Properties of fourier transformNisarg Amin
 
Optical Network Survivability
Optical Network SurvivabilityOptical Network Survivability
Optical Network SurvivabilityBecky Jia
 
Bartlett's method pp ts
Bartlett's method pp tsBartlett's method pp ts
Bartlett's method pp tsDiwaker Pant
 
Presentation
PresentationPresentation
PresentationVirak Sou
 
Orthogonal Frequency Division Multiplexing (OFDM)
Orthogonal Frequency Division Multiplexing (OFDM)Orthogonal Frequency Division Multiplexing (OFDM)
Orthogonal Frequency Division Multiplexing (OFDM)ashishsoni1505
 
Kalman filters
Kalman filtersKalman filters
Kalman filtersAJAL A J
 

What's hot (20)

Statistical signal processing(1)
Statistical signal processing(1)Statistical signal processing(1)
Statistical signal processing(1)
 
Dif fft
Dif fftDif fft
Dif fft
 
Kalman filter for Beginners
Kalman filter for BeginnersKalman filter for Beginners
Kalman filter for Beginners
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
 
NON PARAMETRIC METHOD
NON PARAMETRIC METHODNON PARAMETRIC METHOD
NON PARAMETRIC METHOD
 
Discrete Fourier Transform
Discrete Fourier TransformDiscrete Fourier Transform
Discrete Fourier Transform
 
Fuzzy relations
Fuzzy relationsFuzzy relations
Fuzzy relations
 
wavelet packets
wavelet packetswavelet packets
wavelet packets
 
Design of Filters PPT
Design of Filters PPTDesign of Filters PPT
Design of Filters PPT
 
An introduction to discrete wavelet transforms
An introduction to discrete wavelet transformsAn introduction to discrete wavelet transforms
An introduction to discrete wavelet transforms
 
Properties of fourier transform
Properties of fourier transformProperties of fourier transform
Properties of fourier transform
 
Pn sequence
Pn sequencePn sequence
Pn sequence
 
Optical Network Survivability
Optical Network SurvivabilityOptical Network Survivability
Optical Network Survivability
 
Spread spectrum modulation
Spread spectrum modulationSpread spectrum modulation
Spread spectrum modulation
 
Bartlett's method pp ts
Bartlett's method pp tsBartlett's method pp ts
Bartlett's method pp ts
 
Presentation
PresentationPresentation
Presentation
 
Orthogonal Frequency Division Multiplexing (OFDM)
Orthogonal Frequency Division Multiplexing (OFDM)Orthogonal Frequency Division Multiplexing (OFDM)
Orthogonal Frequency Division Multiplexing (OFDM)
 
Bit Error rate of QAM
Bit Error rate of QAMBit Error rate of QAM
Bit Error rate of QAM
 
Quadrature amplitude modulation
Quadrature amplitude modulationQuadrature amplitude modulation
Quadrature amplitude modulation
 
Kalman filters
Kalman filtersKalman filters
Kalman filters
 

Similar to Spectral factorization

Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGAScientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGAAhmed Gamal Abdel Gawad
 
Is unit 4_number_theory
Is unit 4_number_theoryIs unit 4_number_theory
Is unit 4_number_theorySarthak Patel
 
A kernel-free particle method: Smile Problem Resolved
A kernel-free particle method: Smile Problem ResolvedA kernel-free particle method: Smile Problem Resolved
A kernel-free particle method: Smile Problem ResolvedKaiju Capital Management
 
Lecture 2: Stochastic Hydrology
Lecture 2: Stochastic Hydrology Lecture 2: Stochastic Hydrology
Lecture 2: Stochastic Hydrology Amro Elfeki
 
IRJET - Some Results on Fuzzy Semi-Super Modular Lattices
IRJET - Some Results on Fuzzy Semi-Super Modular LatticesIRJET - Some Results on Fuzzy Semi-Super Modular Lattices
IRJET - Some Results on Fuzzy Semi-Super Modular LatticesIRJET Journal
 
A Study of Training and Blind Equalization Algorithms for Quadrature Amplitud...
A Study of Training and Blind Equalization Algorithms for Quadrature Amplitud...A Study of Training and Blind Equalization Algorithms for Quadrature Amplitud...
A Study of Training and Blind Equalization Algorithms for Quadrature Amplitud...IRJET Journal
 
Linear models
Linear modelsLinear models
Linear modelsFAO
 
LOGNORMAL ORDINARY KRIGING METAMODEL IN SIMULATION OPTIMIZATION
LOGNORMAL ORDINARY KRIGING METAMODEL IN SIMULATION OPTIMIZATIONLOGNORMAL ORDINARY KRIGING METAMODEL IN SIMULATION OPTIMIZATION
LOGNORMAL ORDINARY KRIGING METAMODEL IN SIMULATION OPTIMIZATIONorajjournal
 
Machine hw3
Machine hw3Machine hw3
Machine hw3Yi Cui
 
Novel Methods of Generating Self-Invertible Matrix for Hill Cipher Algorithm.
Novel Methods of Generating Self-Invertible Matrix for Hill Cipher Algorithm.Novel Methods of Generating Self-Invertible Matrix for Hill Cipher Algorithm.
Novel Methods of Generating Self-Invertible Matrix for Hill Cipher Algorithm.CSCJournals
 
Linear Regression
Linear RegressionLinear Regression
Linear RegressionVARUN KUMAR
 

Similar to Spectral factorization (20)

Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGAScientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
Scientific Computing II Numerical Tools & Algorithms - CEI40 - AGA
 
Shors'algorithm simplified.pptx
Shors'algorithm simplified.pptxShors'algorithm simplified.pptx
Shors'algorithm simplified.pptx
 
12. Linear models
12. Linear models12. Linear models
12. Linear models
 
Is unit 4_number_theory
Is unit 4_number_theoryIs unit 4_number_theory
Is unit 4_number_theory
 
A kernel-free particle method: Smile Problem Resolved
A kernel-free particle method: Smile Problem ResolvedA kernel-free particle method: Smile Problem Resolved
A kernel-free particle method: Smile Problem Resolved
 
MUMS: Transition & SPUQ Workshop - Practical Bayesian Optimization for Urban ...
MUMS: Transition & SPUQ Workshop - Practical Bayesian Optimization for Urban ...MUMS: Transition & SPUQ Workshop - Practical Bayesian Optimization for Urban ...
MUMS: Transition & SPUQ Workshop - Practical Bayesian Optimization for Urban ...
 
Lecture 2: Stochastic Hydrology
Lecture 2: Stochastic Hydrology Lecture 2: Stochastic Hydrology
Lecture 2: Stochastic Hydrology
 
IRJET - Some Results on Fuzzy Semi-Super Modular Lattices
IRJET - Some Results on Fuzzy Semi-Super Modular LatticesIRJET - Some Results on Fuzzy Semi-Super Modular Lattices
IRJET - Some Results on Fuzzy Semi-Super Modular Lattices
 
Ullmayer_Rodriguez_Presentation
Ullmayer_Rodriguez_PresentationUllmayer_Rodriguez_Presentation
Ullmayer_Rodriguez_Presentation
 
A Study of Training and Blind Equalization Algorithms for Quadrature Amplitud...
A Study of Training and Blind Equalization Algorithms for Quadrature Amplitud...A Study of Training and Blind Equalization Algorithms for Quadrature Amplitud...
A Study of Training and Blind Equalization Algorithms for Quadrature Amplitud...
 
Linear models
Linear modelsLinear models
Linear models
 
Basics Of Kalman Filter And Position Estimation Of Front Wheel Automatic Stee...
Basics Of Kalman Filter And Position Estimation Of Front Wheel Automatic Stee...Basics Of Kalman Filter And Position Estimation Of Front Wheel Automatic Stee...
Basics Of Kalman Filter And Position Estimation Of Front Wheel Automatic Stee...
 
LOGNORMAL ORDINARY KRIGING METAMODEL IN SIMULATION OPTIMIZATION
LOGNORMAL ORDINARY KRIGING METAMODEL IN SIMULATION OPTIMIZATIONLOGNORMAL ORDINARY KRIGING METAMODEL IN SIMULATION OPTIMIZATION
LOGNORMAL ORDINARY KRIGING METAMODEL IN SIMULATION OPTIMIZATION
 
MUMS: Bayesian, Fiducial, and Frequentist Conference - Model Selection in the...
MUMS: Bayesian, Fiducial, and Frequentist Conference - Model Selection in the...MUMS: Bayesian, Fiducial, and Frequentist Conference - Model Selection in the...
MUMS: Bayesian, Fiducial, and Frequentist Conference - Model Selection in the...
 
Machine hw3
Machine hw3Machine hw3
Machine hw3
 
Novel Methods of Generating Self-Invertible Matrix for Hill Cipher Algorithm.
Novel Methods of Generating Self-Invertible Matrix for Hill Cipher Algorithm.Novel Methods of Generating Self-Invertible Matrix for Hill Cipher Algorithm.
Novel Methods of Generating Self-Invertible Matrix for Hill Cipher Algorithm.
 
frozen_lake_rl_report.pdf
frozen_lake_rl_report.pdffrozen_lake_rl_report.pdf
frozen_lake_rl_report.pdf
 
Section6 stochastic
Section6 stochasticSection6 stochastic
Section6 stochastic
 
PCA and SVD in brief
PCA and SVD in briefPCA and SVD in brief
PCA and SVD in brief
 
Linear Regression
Linear RegressionLinear Regression
Linear Regression
 

Recently uploaded

Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Delhi Call girls
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...SUHANI PANDEY
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...shambhavirathore45
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 

Recently uploaded (20)

Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 

Spectral factorization

  • 1. Spectral Decomposition and its Applications Senthil Kumarasamy Gyan Data Private Limited Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 1 / 23
  • 2. Contents 1 Eigen values and Eigen vectors 2 Spectral decomposition 3 Gram Schmidt orthogonalization 4 QR factorization 5 QR algorithm for finding Eigen values 6 Gaussian elimination to find Eigen vectors 7 Implementation in Matlab 8 Applications Decoupling of linear differential equations Dimensionality reduction Filtering Identification of linear model from data Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 2 / 23
  • 3. Eigen values and Eigen vectors Given a matrix A ∈ Rn×n Ax = λx where x ∈ Rn and λ ∈ R. λ is called Eigen value of A, and x is called the Eigen vector of A corresponding to λ To find Eigen values, Ax = λx Ax − λx = 0 (A − λI)x = 0 In order to have non trival solution to the above equation, matrix A − λI must be singular. Hence |A − λI| = 0 |A − λI| = 0 is called characteristic equation of A. This is a polynomial of degree n in λ, and it has n solutions namely λ1 . . . λn Corresponding to each λi, there is an Eigen vector xi Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 3 / 23
  • 4. Spectral Decomposition Ax1 = λ1x1 ... Axn = λnxn A   | | x1 . . . xn | |   =   | | x1 . . . xn | |      λ1 ... λn    A =   | | x1 . . . xn | |   P    λ1 ... λn    Σ   | | x1 . . . xn | |   −1 P−1 A = PΣP−1 Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 4 / 23
  • 5. Examples Find eigen values of A =   0 −1 −3 2 3 3 −2 1 1   Solution |A − λI| = 0 − λ −1 −3 2 3 − λ 3 −2 1 1 − λ = −λ 3 − λ 3 1 1 − λ + 1 2 3 −2 1 − λ − 3 2 3 − λ −2 1 = λ3 − 4λ2 − 4λ + 16 Solving λ3 − 4λ2 − 4λ + 16 = 0, we get λ = 2, −2, 4 Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 5 / 23
  • 6. Examples contd. Find eigen values of A =   3 2 1 0 2 3 0 0 5   Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 6 / 23
  • 7. Examples contd. Find eigen values of A =   3 2 1 0 2 3 0 0 5   Solution |A − λI| = 3 − λ 2 1 0 2 − λ 3 0 0 5 − λ = (3 − λ) 2 − λ 3 0 5 − λ − 2 0 3 0 5 − λ + 1 0 2 − λ 0 0 = (3 − λ)(2 − λ)(5 − λ) Solving (3 − λ)(2 − λ)(5 − λ) = 0, we get λ = 3, 2, 5 Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 6 / 23
  • 8. Examples contd. Find eigen values of A =   3 2 1 0 2 3 0 0 5   Solution |A − λI| = 3 − λ 2 1 0 2 − λ 3 0 0 5 − λ = (3 − λ) 2 − λ 3 0 5 − λ − 2 0 3 0 5 − λ + 1 0 2 − λ 0 0 = (3 − λ)(2 − λ)(5 − λ) Solving (3 − λ)(2 − λ)(5 − λ) = 0, we get λ = 3, 2, 5 Observation: If A is a triangular (Upper or Lower or Diagonal) matrix, then Eigen values of A are its diagonal elements. Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 6 / 23
  • 9. Introduction to QR algorithm QR algorithm applies Similarity transformations iteratively to reduce the given matrix to a diagonal matrix Similarity transformations are those that preserve Eigen values of the matrix To get a similarity transformation, QR factorization is employed. QR factorization uses Gram Schmidt orthogonalization Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 7 / 23
  • 10. Gram Schmidt orthogonalization A = 3 2 1 2 v1 = 3 1 , v2 = 2 2 u1 = v1 e1 = u1 u1 = 3 2 T √ 32+12 = 1√ 10 3 1 u2 = v2− (vT 2 e1)e1 Proj of v2 on e1 = 1 5 −2 6 e2 = u2 u2 = 1√ 10 −1 3 Q = 1√ 10 3 −1 1 3 Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 8 / 23
  • 11. QR factorization A = QR A, Q, R are n × n matrices QT Q = I R is upper triangular matrix Example  0 1 1 1 1 2 0 0 3   A =   0 1 0 1 0 0 0 0 1   Q   1 1 2 0 1 1 0 0 3   R QT Q =   0 1 0 1 0 0 0 0 1   T   0 1 0 1 0 0 0 0 1   =   1 0 0 0 1 0 0 0 1   Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 9 / 23
  • 12. QR factorization A = v1 v2 v3 where v1, v2, v3 are columns of matrix A Apply Gram Schmidt Orthogonalization to A matrix u1 = v1 e1 = v1 v1 u2 = v2 − (vT 2 e1)e1 e2 = u2 u2 u3 = v3 − (vT 3 e1)e1 − (vT 3 e2)e2 e3 = u3 u3 QR factorization A = e1 e2 e3 Q   v1 vT 2 e1 vT 3 e1 0 v2 vT 2 e1 0 0 v3   R Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 10 / 23
  • 13. Matlab code for QR factorization function [ Q , R ] = qr_factorization1(A) [ r , c ] = size (A) ; Q = zeros (r , r) ; R = zeros (r , r) ; R(1 ,1) = sqrt (sum(A ( : , 1 ) . * A ( : , 1 ) ) ) ; i f abs (R(1 ,1) ) > 1e−5 Q ( : , 1 ) = A ( : , 1 ) / R(1 ,1) ; else Q ( : , 1 ) = 0; end f o r i = 2:r Q ( : , i) = A ( : , i) ; f o r j = 1:i−1 R(j , i) = sum(A ( : , i) . * Q ( : , j) ) ; Q ( : , i) = Q ( : , i) − R(j , i) * Q ( : , j) ; end R(i , i) = sqrt (sum(Q ( : , i) . * Q ( : , i) ) ) ; i f abs (R(i , i) ) > 1e−5 Q ( : , i) = Q ( : , i) / R(i , i) ; else Q ( : , i) = 0; end end end Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 11 / 23
  • 14. QR Algorithm Algorithm 1 Set Ai = A, the given matrix 2 Q, R = qr factorization(Ai) 3 Set Ai = RQ 4 Perform steps 2 and 3 until convergence RQ transformation A = QR QT A = QT QR = R RQ = QT AQ Similarity transform Properties of similarity transform 1 Preserve the Eigen values (λ) of A 2 Kill the off diagonal elements of A Preserves λ |QT AQ − λI| = |QT AQ − λQT IQ| = |QT (A − λI)Q| = |QT | × |A − λI| × |Q| = |Q−1| × |A − λI| × |Q| = |A−λI|×|Q| |Q| = |A − λI| Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 12 / 23
  • 15. Matlab code for finding Eigen values function eig = eigen_values(A) M = A ; f o r i = 1:60 [ Q , R ] = qr_factorization(M) ; M = R*Q ; end eig = diag (M) ; [ eig1 , ind ] = sort ( abs ( eig ) , ' descend ' ) ; eig = eig (ind) ; end Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 13 / 23
  • 16. Eigen Vectors (A − λI) ¯A x = 0 ¯Ax = 0 ¯Q ¯Rx = 0 ¯QT ¯Q ¯Rx = 0 ¯Rx = 0 Example: A =   0 1 1 1 1 2 0 0 3   λ = −0.62, 1.62, 3.0 For λ = 3  0 1 1 1 1 2 0 0 3   − 3   1 0 0 0 1 0 0 0 1   x = 0   −3 1 1 1 −2 2 0 0 0   x = 0   −0.949 −0.316 0 0.316 −0.949 0 0 0 0     3.162 −1.581 −0.316 0 1.581 −2.214 0 0 0   x = 0 pre-multiplying both sides by QT , we get   3.162 −1.581 −0.316 0 1.581 −2.214 0 0 0   x = 0 Slove for x by back substitution Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 14 / 23
  • 17. Matlab code for Back Substitution function x = back_substitution(R) [ r , c ] = size (R) ; x = zeros (r) ; f o r i = r:−1:1 i f abs (R(i , i) ) < 1e−5 x(i) = 1; continue ; end summ = 0.0; f o r j = r: −1:i summ = summ + R(i , j) * x(j) ; end x(i) = −summ / R(i , i) ; end end Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 15 / 23
  • 18. Matlab code for finding Eigen vectors function [ vec , val ] = eigen_val_vec(M) [ r , c ] = size (M) ; val = eigen_values(M) ; vec = zeros (r) ; f o r i = 1:r A = M − eye (r) * val(i) ; [ Q , R ] = qr_factorization(A) ; x = back_substitution(R) ; vec ( : , i) = x / sqrt (sum(x . * x) ) ; end end Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 16 / 23
  • 19. Applications Decoupling of differential equations Consider systems of equations dx1 dt = 2x1 + 3x2 dx2 dt = 2x1 + x2 ˙x1 ˙x2 ˙X = 2 3 2 1 A x1 x2 X ˙X = AX ˙X = PΣP−1X substituting X = PY P ˙Y = PΣP−1PY P ˙Y = PΣY pre-multiplying both side with P−1 P−1 P ˙Y = P−1PΣY ˙Y = ΣY ˙y1 ˙y2 = 4 0 0 −1 y1 y2 Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 17 / 23
  • 20. Applications Data compression, filtering, model identification (PCA)     1 −1 −1 0 0 0 0 1 0 −1 0 0 0 1 0 0 −1 0 0 0 0 1 1 −1             x1 x2 x3 x4 x5 x6         =     0 0 0 0     Data Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 18 / 23
  • 21. Applications Steps to data compression, filtering, model identification (PCA) Let Z be data matrix. Each column of Z represents a flow variable Compute S = 1 N ZT Z where N is no. of data points Find Eigen values, and Eigen vectors of S Let columns of U1 consists of Eigen vectos corresponding significant Eigen values Let columns of U2 consists of Eigen vectors corresponding to insignificant Eigen values. Then UT 2 represents the underlying model equations Compressed data is C = ZU1 Filtered data is F = CUT 1 Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 19 / 23
  • 22. (Applications) Matlab code for compression, filtering, and model identification clear a l l ; clc ; M = csvread ( ” flow_with_noise . csv ” ) ; [ r , c ] = size (M) ; S = M ' * M / r ; [ eig_vec , eig_val ] = eigen_val_vec(S) ; basis = eig_vec ( : , 5 : 6 ) ; model = eig_vec ( : , 1 : 4 ) ' ; compressed_data = M * basis ; filtered_data = compressed_data * basis ' ; Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 20 / 23
  • 23. Exercises Limitations of our code Extend QR factorization code for rectangular matrices Modify QR Algorithm code for finding out complex Eigen values Back substitution code can be extended for handling repeated Eigen values Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 21 / 23
  • 24. Thank you Senthil Kumarasamy Spectral Decomposition and its Applications Gyan Data Private Limited 22 / 23