The Gram-Schmidt Procedure and Orthogonal Projections 1 ...

The Gram-Schmidt Procedure and Orthogonal Projections 1 ... The Gram-Schmidt Procedure and Orthogonal Projections 1 ...

comm.utoronto.ca
from comm.utoronto.ca More from this publisher
11.07.2015 Views

For example, let P be the subspace of R 3 consisting of all vectors (x, y, z) with theproperty that x + y + z = 0. Find an orthonormal basis for P and compute theorthogonal projection of the following vectors on P .• v = [1,2,3], ˆv =• v = [1,1,1], ˆv =• v = [0,1,0], ˆv =In the above computations, let e denote the “error vector” v − ˆv. Compute 〈v, v〉, 〈ˆv, ˆv〉and 〈e, e〉 for the three cases above.Write a general relationship among the three quantities 〈v, v〉, 〈ˆv, ˆv〉 and 〈e, e〉, wheree = v − ˆv.4 The QR DecompositionLet V be a square matrix (assumed invertible) and let Q = GS(V) be the orthogonal matrixreturned by your Gram-Schmidt procedure. Each row of V has a set of coordinates withrespect to the rows of Q. This implies thatfor some matrix R.V = RQ,After trying a few examples, explain what special property the matrix R has.random n × n matrix can be obtained in Matlab or Octave via rand(n, n).A6

In linear algebra, this decomposition is usually written in transposed form, expressing aninvertible matrix V as V = QR where Q is an orthogonal matrix and R has a similar specialproperty as above. Such a decomposition is referred to as the “QR” decomposition.Thus we see that the Gram-Schmidt procedure results in a QR decomposition. By typing’help qr’, investigate whether your version of Matlab or Octave implements the QRdecomposition.5 Approximate Curve FittingConsider the approximation of a function f(x) over the interval [0, 1] as a quadratic polynomial.Here we show how this can be done approximately using orthogonal projections.In Matlab or Octave, run the following:N = 9;a = linspace(0,1,N);v(1,:) = ones(size(a));v(2,:) = a;v(3,:) = a .* a;b = GS(v);The linspace(a,b,N) function returns a vector of length N with samples uniformlyspaced from a to b, inclusive. The ‘.*’ operator takes the componentwise product of thecorresponding vectors.The matrix v now contains three rows: the first row contains samples from the constantfunction; the second row contains samples from a linearly increasing function; and thethird row contains samples from a quadratically increasing function.The matrix b contains a corresponding orthonormal basis. To see the corresponding samples,try the following command:plot(b(1,:)); hold; plot(b(2,:)); plot(b(3,:));Let us populate a vector f with samples from some function, e.g.,f = exp(a);Let g denote the orthogonal projection of f on the space spanned by the rows of v or b.Both f and g can be plotted as follows:7

For example, let P be the subspace of R 3 consisting of all vectors (x, y, z) with theproperty that x + y + z = 0. Find an orthonormal basis for P <strong>and</strong> compute theorthogonal projection of the following vectors on P .• v = [1,2,3], ˆv =• v = [1,1,1], ˆv =• v = [0,1,0], ˆv =In the above computations, let e denote the “error vector” v − ˆv. Compute 〈v, v〉, 〈ˆv, ˆv〉<strong>and</strong> 〈e, e〉 for the three cases above.Write a general relationship among the three quantities 〈v, v〉, 〈ˆv, ˆv〉 <strong>and</strong> 〈e, e〉, wheree = v − ˆv.4 <strong>The</strong> QR DecompositionLet V be a square matrix (assumed invertible) <strong>and</strong> let Q = GS(V) be the orthogonal matrixreturned by your <strong>Gram</strong>-<strong>Schmidt</strong> procedure. Each row of V has a set of coordinates withrespect to the rows of Q. This implies thatfor some matrix R.V = RQ,After trying a few examples, explain what special property the matrix R has.r<strong>and</strong>om n × n matrix can be obtained in Matlab or Octave via r<strong>and</strong>(n, n).A6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!