Question: hw 9 . m ( Function ) Problem 3 : Write a function that can be called as lambda _ vec, U my _ subspaceiteration

hwm Function
Problem : Write a function that can be called as
lambdavec, mysubspaceiteration Afun maxiter,, tol
implementing subspace iteration for the dominant eigenpairs of a symmetric
matrix including the RayleighRitz step, for which you may call the builtin Mat
lab function eig on a smaller matrix The input Afun is a function handle
which, when called as AfunV for a matrix with rows, returns The input
WO is an arbitrary initial guess for subspace iteration. The number of columns in
the initial guess dictates the number of dominant eigenvectors we seek. The outpu
lambdavec is a vector of the dominant eigenvalues, ordered nonincreasingly, and
the columns of the output are the corresponding dominant eigenvectors.
Use your function to run PCA on the data matrix Y from hwmat. The array Y
is where indicates the data dimension and indicates the number of dat
points. You will have to demean Y yourself to produce a data matrix X with zer
points. You will have to demean Y yourself to produce a data matrix X with zero
appropriate function handle implementing matrix multiplication by via
Afun @ Make sure to answer all parts and provide the correct MATLAB code. Met me know if there is anything I need to revise!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
