{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Homework 3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "1\\. Add shifts to the QR algorithm\n", "\n", "Instead of factoring $A_k$ as $Q_k R_k$ (the way the pure QR algorithm without shifts does), the shifted QR algorithms:\n", "\n", "i. Get the QR factorization $$A_k - s_k I = Q_k R_k$$\n", "ii. Set $$A_{k+1} = R_k Q_k + s_k I$$\n", "\n", "Choose $s_k = A_k(m,m)$, an approximation of an eigenvalue of A. \n", "\n", "The idea of adding shifts to speed up convergence shows up in many algorithms in numerical linear algebra (including the power method, inverse iteration, and Rayleigh quotient iteration). " ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "def practical_qr(A, iters=10):\n", " # Fill method in\n", " return Ak, Q" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python [conda root]", "language": "python", "name": "conda-root-py" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.1" } }, "nbformat": 4, "nbformat_minor": 2 }