-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eigenvectors and eigevalues lecture ex needs improving #544
Comments
Dear John @jstac , Here is a version of the exercise I updated: Power iteration is an algorithm used to compute the dominant eigenvalue of a diagonalizable The method proceeds as follows:
A thorough discussion of the method can be found here. Implement the power iteration method using the following matrix and initial vector: Set the number of iterations to The solution for this exercise to match with the question def power_iteration(A=np.array([[1, 0, 3],
[0, 2, 0],
[3, 0, 1]]), b=np.array([1,1,1]), m=20):
for i in range(m):
b = np.dot(A, b)
lambda_1 = abs(b).max()
b = b/ b.max()
print('Eigenvalue:', lambda_1)
print('Eigenvector:', b)
power_iteration() What do you think about this update? Would you like to change anything? Best ❤️ |
Hi @LongYe, this is great, many thanks! I suggest replacinng "Multiply..." with "At the Just to comply with the style manual, please use |
Sure thing. I will submit a PR for this issue and incorporate these suggestions. Thanks John! Best ❤️ |
Regarding the first exercise in https://intro.quantecon.org/eigen_I.html, we need to make clear exactly what the reader should try to do. Steps:
(That way they get the satisfaction of computing something before they check the solution.)
The text was updated successfully, but these errors were encountered: