Please answer the following questions in complete sentences in a clearly prepared manuscript and submit the solution by the end of class on Thursday, September 27th, 2012. You should submit your PDF file to Blackboard http://mycourses.purdue.edu as well as your Matlab files. Given the shorter due-date, feel free to inquire about extensions, although, realize you have a midterm on October 4th. I’ve also made the homework shorter.
Please identify anyone, whether or not they are in the class, with whom you discussed your homework. This problem is worth 1 point, but on a multiplicative scale.
Through this problem, assume that the matrices are all symmetric. You may assume this in your code as well.
Implement a Matlab function for the Cholesky factorization.
Research the Cholesky factorization and answer the following question, either providing a proof or a reference. Is the Cholesky factorization unique?
Compare your Cholesky factorization code to Matlab’s chol function on the following matrix.
n = 10;
Q = qr(randn(n));
D = abs(randn(n,1));
A = Q*diag(D)*Q';
Your professor boldy asserted that using the Cholesky factorization was faster than using the LU factorization. Make sure he’s still right. Show the performance of Matlab’s LU and Cholesky factorization for matrices with size that varies from 10 to 500.
Your professor also boldy asserted that we preserve positive definiteness after one step of the Cholesky factorization. Recall that this was:
\mA = \bmat{\alpha & \vb^T \\ \vb & \mC} = \mF \mF^T = \bmat{\gamma & 0 \\ \vf & \mF_1} \bmat{\gamma & \vf^T \\ 0 & \mF_1^T}.
So we set and . Then, we recursively compute the Cholesky factorization of
\mC - \vb \vb^T/\alpha = \mF_1 \mF_1^T.
This only works if is positive definite. Prove that this is true. (Hint: you can do it from the definition of positive definiteness: for all .)
Briefly explain why step 5 justifies that a Cholesky factorization exists for any positive definite matrix. (This is really like a one or two sentence answer.)
One of the most useful aspects of the Choleskfy factorization is as a way to check if a matrix is positive definite or negative definite. A matrix is negative definite if
\vx^T \mA \vx < 0
for all . Change your Matlab implementation to report if a matrix is not positive definite. (Hint: this relates to why a Cholesky factorization always exists for a positive definite matrix in the previous problem.) Use this to test if the matrix for Poisson’s equation from Homework 2, Problem 7 is positive or negative definite.
Suppose that are a sequence of samples from a random variable. The sample variance of is:
V = \frac{1}{n-1} \sum_{i=1}^n (x_i - \frac{1}{n} \sum_{i=1}^n x_i )^2.
Compute the condition number of the sample variance.
This is a real problem that I ran into this summer! I was using a program written by someone else to compute a particular statistical estimate. The details don’t really matter, but at one step, the code needed to compute the Hurwitz zeta function:
H(s,q) = \sum_{n=0}^\infty \frac{1}{(q+n)^s}
where ranged from 1 to 7 and where ranged from 1 to 500. They were using Matlab, which doesn’t provide a function for the Hurtwitz zeta function, but does provide a function for the Riemann zeta function:
R(s) = \sum_{n=1}^\infty \frac{1}{n^s}.
Note that the only difference between these two functions is that the first term in the Riemann zeta function is and the first term in the Hurwitz zeta function is . To account for this difference, the code I was using did the following:
function h=hzeta(s,q)
z = zeta(s)
h = z - sum((1:(q-1)).^(-s));
Was I happy when I realized this? You should use what you’ve learned about finite precision computations to answer this question. You can evaluate the Hurwitz zeta function to arbitrary precision via Wolfram Alpha. There is an answer that’s more correct on this problem, but the most critical part of your answer is how you justify it.