# A6 - Math 235 Assignment 6 Due Wednesday June 22nd 1 Find a and b to obtain the best ﬁtting equation of the form y 2 a bt for the given data t 1

This preview shows pages 1–3. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Math 235 Assignment 6 Due: Wednesday, June 22nd 1. Find a and b to obtain the best ﬁtting equation of the form y 2 a + bt for the given data. t 1 2 3 4 5 y 9 6 5 3 1 2. Verify that the following system A3? = 5 is inconsistent, then determine for the vector 55 that minimizes [[AEE —— £131 + 2272 = 5 251:1 —— 35172 = 6 £131 — 121132 =2 -4 3. Prove that if U and W are subspaces of a vector space V such that U {‘1 W = {6}, then U :7 W is a subspace of V. Moreover, if {271, . . .,27k} is a basis for U and {151, - -- ,ﬂig} is a basis for W, then {271, . . . ,27k,7i31, . . .463} is a basis for U @ W. 4. Let U be a subspace of a ﬁnite dimensional vector space V and suppose that there are subspaces W1 and W2 such that V = U 69 W1 and V =2 U @ W2. (a) Prove that dim W1 = dim W2. (b) Give an example of a vector space V with subspaces U, W1, and W2 such that V : UEBWl and V=U®W2, but W1 5. Let A be an m X n real matrix. Prove that the nullspace of AT is the orthogonal complement of the column space of A. Use MATLAB to complete the following questions. You do not need to submit a printout of your work. Simply use MATLAB to solve the problems, and submit written answers to the questions along with the rest of your assignment. For questions that involve a set of vectors, enter each vector separately, giving it a name (e.g., 81, 52, S3) and then construct any required matrices from these vectors (e.g., A 2 [SI 82 83]). This will make it easier for you to work with the various elements. m Least Squares Review Section 3.6 of the Course Notes on The Method of Least Squares before attempting this question. In particular, review Example 4, which ﬁnds the least—squares curve, y =2 a + b3: + 0:152, that best ﬁts the data 50-3-1013 y31124 To solve this example using MATLAB, complete the following steps: 1. First, plot the data points: >> x = [~3; ~1; O; 1; 3] >> y = [3; 1; 1; 2; 4] >> plotCX, y, ’*’); 2. Then, create the design matrix, X, for the given model: >> X = [ones(5,l) x X.“2] (Use the ." operator for element—by—element exponentiation.) 3. If X TX is invertible, then we can quickly ﬁnd the least squares solution, ,6, using the formula ,6 :2 (XTX)"1XTy. We can use the rref command to check whether or not X TX is invertible (and in this case it is), and so we can go ahead and calculate the least~squares solution: >> rref(X’*X) >> beta = inv(X’*X)*X’*y 4. Finally, we can plot the least—squares solution on the same graph as our data points to see how well the model ﬁts the data: >> x_range = [—4: 0.1: 41’; >> y_fit_line = beta(1,1) + beta(2,1)*x_range + beta(3,1)*x_range.‘2; >> hold on >> plot (X_range, y_fit_1ine, ’r-’) A corporation tracks its costs as a function of its sales and obtains the following data: | sales (millions) I costs (millions) 0 | 10 4.7711647 20 30 40{50[60 70180 90 19.76 22.35 23.67 I 25.03 4 27.01 30.93 40.98 53.86 Since ﬁxed costs are not included in the above data, the curve that best describes this data is of the form y = ,813: + 523:2 + 33:133. (a) Plot the data points given above. (Notice that the points do seem to be best approximated by cubic curve.) (b) Create the design matrix of this model. What matrix did you get? (0) Find the least-squares solution. What is the solution? (d) Plot the least—squares solution on the same graph as the data points from part (a). Print out this plot and attach it to your submission. ...
View Full Document

## This note was uploaded on 09/30/2011 for the course MATH 235 taught by Professor Celmin during the Spring '08 term at Waterloo.

### Page1 / 3

A6 - Math 235 Assignment 6 Due Wednesday June 22nd 1 Find a and b to obtain the best ﬁtting equation of the form y 2 a bt for the given data t 1

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online