b) (1) Using the results of part (a), let Q be the matrix with column vectors b j and A be the matrix with column vectors v j :

Similar documents
Lecture 6. Numerical methods. Approximation of functions

MATH 167: APPLIED LINEAR ALGEBRA Least-Squares

Linear Algebra- Final Exam Review

December 20, MAA704, Multivariate analysis. Christopher Engström. Multivariate. analysis. Principal component analysis

Math 102, Winter Final Exam Review. Chapter 1. Matrices and Gaussian Elimination

Total 170. Name. Final Examination M340L-CS

MATH 22A: LINEAR ALGEBRA Chapter 4

Worksheet for Lecture 25 Section 6.4 Gram-Schmidt Process

Linear Models Review

Lecture Notes 1: Vector spaces

MATH 1B03 Day Class Final Exam Bradd Hart, Dec. 13, 2013

Chapter 3. Vector spaces

MODULE 8 Topics: Null space, range, column space, row space and rank of a matrix

Columbus State Community College Mathematics Department Public Syllabus

ENGG5781 Matrix Analysis and Computations Lecture 8: QR Decomposition

YORK UNIVERSITY. Faculty of Science Department of Mathematics and Statistics MATH M Test #2 Solutions

MATH 167: APPLIED LINEAR ALGEBRA Chapter 3

orthogonal relations between vectors and subspaces Then we study some applications in vector spaces and linear systems, including Orthonormal Basis,

Offline Exercises for Linear Algebra XM511 Lectures 1 12

Dimensionality Reduction: PCA. Nicholas Ruozzi University of Texas at Dallas

Math 520 Exam 2 Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008

Inverses. Stephen Boyd. EE103 Stanford University. October 28, 2017

Lecture 22: Section 4.7

Least squares: the big idea

k is a product of elementary matrices.

Correlation 1. December 4, HMS, 2017, v1.1

4. List of program goals/learning outcomes to be met. Goal-1: Students will have the ability to analyze and graph polynomial functions.

Department of Aerospace Engineering AE602 Mathematics for Aerospace Engineers Assignment No. 4

STA 414/2104: Lecture 8

3 QR factorization revisited

Lecture 3: QR-Factorization

ASM Study Manual for Exam P, Second Edition By Dr. Krzysztof M. Ostaszewski, FSA, CFA, MAAA Errata

University of Colorado Denver Department of Mathematical and Statistical Sciences Applied Linear Algebra Ph.D. Preliminary Exam January 23, 2015

18.06 Quiz 2 April 7, 2010 Professor Strang

Classifier Complexity and Support Vector Classifiers

P = A(A T A) 1 A T. A Om (m n)

6. Orthogonality and Least-Squares

1 Cricket chirps: an example

FINAL EXAM Ma (Eakin) Fall 2015 December 16, 2015

Machine Learning Linear Classification. Prof. Matteo Matteucci

MAT Linear Algebra Collection of sample exams

Final Examination 201-NYC-05 - Linear Algebra I December 8 th, and b = 4. Find the value(s) of a for which the equation Ax = b

MA 265 FINAL EXAM Fall 2012

Worksheet # 2: Higher Order Linear ODEs (SOLUTIONS)

ECE 592 Topics in Data Science

Math 1314 Week #14 Notes

Discriminant analysis and supervised classification

Math 314/ Exam 2 Blue Exam Solutions December 4, 2008 Instructor: Dr. S. Cooper. Name:

1 Reductions from Maximum Matchings to Perfect Matchings

(Mathematical Operations with Arrays) Applied Linear Algebra in Geoscience Using MATLAB

Least squares problems Linear Algebra with Computer Science Application

APPLICATIONS The eigenvalues are λ = 5, 5. An orthonormal basis of eigenvectors consists of

[Disclaimer: This is not a complete list of everything you need to know, just some of the topics that gave people difficulty.]

L2-7 Some very stylish matrix decompositions for solving Ax = b 10 Oct 2015

1 Last time: least-squares problems

Vector spaces. DS-GA 1013 / MATH-GA 2824 Optimization-based Data Analysis.

Midterm. Introduction to Machine Learning. CS 189 Spring Please do not open the exam before you are instructed to do so.

Lecture 4: Applications of Orthogonality: QR Decompositions

MACHINE LEARNING. Methods for feature extraction and reduction of dimensionality: Probabilistic PCA and kernel PCA

Linear Algebra. The Manga Guide. Supplemental Appendixes. Shin Takahashi, Iroha Inoue, and Trend-Pro Co., Ltd.

LINEAR ALGEBRA KNOWLEDGE SURVEY

course overview 18.06: Linear Algebra

Introduction to Signal Detection and Classification. Phani Chavali

Matrix decompositions

PS2: Two Variable Statistics

Probability and Statistics. Terms and concepts

MAT2342 : Introduction to Applied Linear Algebra Mike Newman, fall Projections. introduction

Lecture 22. r i+1 = b Ax i+1 = b A(x i + α i r i ) =(b Ax i ) α i Ar i = r i α i Ar i

MATH 260 Class notes/questions January 10, 2013

BASIC ALGORITHMS IN LINEAR ALGEBRA. Matrices and Applications of Gaussian Elimination. A 2 x. A T m x. A 1 x A T 1. A m x

Singular Value Decomposition. 1 Singular Value Decomposition and the Four Fundamental Subspaces

Lecture 16: Small Sample Size Problems (Covariance Estimation) Many thanks to Carlos Thomaz who authored the original version of these slides

Principle Components Analysis (PCA) Relationship Between a Linear Combination of Variables and Axes Rotation for PCA

LINEAR ALGEBRA 1, 2012-I PARTIAL EXAM 3 SOLUTIONS TO PRACTICE PROBLEMS

5.) For each of the given sets of vectors, determine whether or not the set spans R 3. Give reasons for your answers.

Bindel, Fall 2016 Matrix Computations (CS 6210) Notes for

Statistical methods. Mean value and standard deviations Standard statistical distributions Linear systems Matrix algebra

LECTURE NOTE #3 PROF. ALAN YUILLE

Methods of Mathematical Physics X1 Homework 2 - Solutions

12. Cholesky factorization

Final Review Sheet. B = (1, 1 + 3x, 1 + x 2 ) then 2 + 3x + 6x 2

CLASS NOTES Computational Methods for Engineering Applications I Spring 2015

Math 118, Fall 2014 Final Exam

7. Dimension and Structure.

Designing Information Devices and Systems I Fall 2016 Babak Ayazifar, Vladimir Stojanovic Final Exam

[y i α βx i ] 2 (2) Q = i=1

There are six more problems on the next two pages

Designing Information Devices and Systems I Fall 2015 Anant Sahai, Ali Niknejad Homework 2. This homework is due September 14, 2015, at Noon.

Chapter 6 Page 1 of 10. Lecture Guide. Math College Algebra Chapter 6. to accompany. College Algebra by Julie Miller

Math 307 Learning Goals. March 23, 2010

Applied Mathematics 205. Unit II: Numerical Linear Algebra. Lecturer: Dr. David Knezevic

Midterm 2 - Solutions

Matrix decompositions

ASM Study Manual for Exam P, First Edition By Dr. Krzysztof M. Ostaszewski, FSA, CFA, MAAA Errata

A Tutorial on Data Reduction. Principal Component Analysis Theoretical Discussion. By Shireen Elhabian and Aly Farag

Machine Learning (Spring 2012) Principal Component Analysis

MATH 3330 INFORMATION SHEET FOR TEST 3 SPRING Test 3 will be in PKH 113 in class time, Tues April 21

Solutions to Math 51 First Exam October 13, 2015

Econ Slides from Lecture 8

MTH5112 Linear Algebra I MTH5212 Applied Linear Algebra (2017/2018)

Transcription:

Exercise assignment 2 Each exercise assignment has two parts. The first part consists of 3 5 elementary problems for a maximum of 10 points from each assignment. For the second part consisting of problems in applications you are to choose one of three problems to solve. This part can give up to 5 points from each assignment. The first part consists of elementary questions to make sure that you have understood the basic material of the course while the second part consists of larger application examples. Solutions can either be submitted through the Blackboard page or you can submit handwritten solutions in the envelope outside of room U3 185 before 23.59 on Sunday 21st of December. Each exercise assignment can give a maximum of 15 points, to pass you will need at least 20 points total from both the assignments. If you do not get enough points from the assignments you will be given the opportunity to complement your solutions to reach a passing grade. These complements need to be submitted before 23.59 on the 11th of January. Part 1 In the first part you are to solve and hand in solutions to the questions. You are allowed to use computer software to check your results, but your calculations as well as your result should be included in the answers for full points. 1.1 Consider the three column vectors v 1 = (0, 0, 3), v 2 = (0, 4, 1), v 3 = (3, 1, 1). a) (1) Find an orthogonal basis b 1, b 2, b 3 for R 3 with b 1 = v 1 by using the Gram Schmidt process on v 1, v 2, v 3. Show your steps. b) (1) Using the results of part (a), let Q be the matrix with column vectors b j and A be the matrix with column vectors v j : Q = [ b 1 b 2 b 3 ], A = [ v 1 v 2 v 3 ]. Find a matrix R such that A = QR.

1.2 Consider the data in the table below: x -2 0 2 4 y -3 1 0 2 Table 1: xy-points of some data. 1.3 a) (1) Use the least squares method to approximate a line y = ax + b to the data given in table 1 in least square sense. b) (1) Try to fit a polynomial of second degree to the data in table 1. What result do you get? a) (1) Give a definition of the Kroenecker product,. b) (1) Calculate [ ] 2 1 2 3 3 1 2 1 6 2 0 1 1 0 1.4 1.5 a) (1) Give a definition of a Linear transformation. b) (1) Consider the following transformations from R 3 to R 2, parameterized by some scalar c: [ c (x1, x T c (x) = 2, x 3 ) 2 2(x 1, x 2, x 3 ) (x 2, x 3, x 1 ) + (x 1 + x 2 + x 3 + 1) 2 ]. 2x 1 + 2x 2 2cx 3 Find all possible constants c such that T c is a linear transformation and show that such transformations T c are linear from the definition of a linear transformation. Consider 7 observations out of two classes with 2 measured variables each: 2 1 1 0 0 1 1 1 1 2 3 4 2 3 c1 c1 c1 c2 c2 c2 c2 2

where each row represent one variable (last denoting their class belonging) and each column represent one observation. Our aim is to use Linear discriminant analysis in order to be able to classify new observations for which we do no know their class already. a) (1) For each class: calculate corresponding covariance matrix S 1, S 2 (within class scatter). b) (1) Use LDA to find the line w which when projected upon best separates the two classes. Plot the 7 points and the line w (by hand or using a computer does not matter). Part 2 In this second part you are to choose ONE example where you attempt to solve the questions presented. If you hand in answers to more than one choice you will get points corresponding to the choice which would give the least total points. You are allowed to use computer software (and depending on which option you choose might be needed for some of the questions). If you are using a computer for some calculations you should set up the problem and present how it could theoretically be solved by hand. For example you could write I solved the linear system Ax = b using Matlabs fsolve, another method would have been to use Gaussian elimination and solving the resulting triangular system. Remark: There are two different QR-factorizations of a matrix. If we QR-factorize a n r matrix A in the way you have discussed during the lecture the Q matrix is square n n and the triangular matrix is non-square n r. An alternative QR-factorization is taking Q non-square n r and R square r r. These two ways are closely related and if A is square they are exactly the same. If you have calculated the first version (using Gram-Schmidt or some software) you can get the second version by taking the first r rows of R to get the new R and the first r columns of Q to get the new Q. Estimating pressure using LSM Consider a power plant that generates power by burning trash and using the heat to boil water and then use the resulting steam to generate electricity using turbines. There are many different parameters that need to be tuned carefully to ensure that such a power plant works efficiently. Two important parameters are the steam pressure, P, and temperature, T, in the boiler. Changing the temperature and pressure in the boiler takes time and is expensive so in order to develop a method for tuning the boiler a few strategic measurements are made and our goal is to develop a mathematical model using these measurements. The measurements can be found in table 2. a) One way to the pressure would be to assume that it increases linearly with the temperature, P (T ) = a + bt. Find the parameters a and b using the least square method. 3

P (MPa) 6.4 6.7 7.5 7.8 8.8 T ( C) 10 22 45 60 75 Table 2: Table of pressures, P, at different temperatures, T. Using the QR-factorization of T = QR, where T is the matrix that describes the regression model. we can rewrite the least square method equation as Ra = Qp, where a is a column of model coefficients and p is a vector of pressure values. b) Use the Gram-Schmidt process to calculate the QR-factorization of T and solve Ra = Q p. Note: make sure to read the remark at the start of part 2. It is important to consider the way that the boilers reliability and efficiency depends on temperature. The boiler is designed such that it will be most efficient between 170 C and 230 C. To take this into account we can weight the data points in that range 4 times as strongly as the other data points below the interval and twice as high as the data points above the interval. c) Take the weights of the data points into account fit another single linear regression model to the data. You do not need to perform QR-factorization again. When plotting the data we notice that for the weighted version many of the points are above the line. We therefore decide to try some other models. We will then see which model gives the closest fit. d) Assume that the relation between the pressure and temperature is a 2nd degree polynomial P (T ) = a + bx + cx 2. Calculate the sum of squares of the residuals S = e e where e i = P (T i ) P i. e) Assume that the relation between the pressure and temperature is a power law P (T ) = a e bt. Calculate the sum of squares of the residuals as in d) and compare the two sums and says which is smaller. Regression of the cumulative distribution function An insurance company are designing a life insurance policy for a group of people who are at a higher risk of getting a certain rare disease (that is fortunately very treatable) than the average person. Since the disease is rare there is not a lot of statistical material on the chance of becoming sick so the company wants to create an approximate cumulative distribution function (CDF) to help them design the policy. In the table below the known data about the disease are given: We start with some simple models to describe the CDF. 4

Diagnosed patients, S, % 0.02 0.14 0.21 0.26 0.31 Age, T, years 22 45 50 61 75 Average time at risk, t, years 3.0 7.1 10.2 18.6 31.5 Table 3: Table of diagnosed patients in percent, S, age in years, T, and average time at risk before being diagnosed in years, t. a) Approximate the CDF that describes the diagnosed patients, S, as a function of age, T, with a function that consists of three linear pieces. The first piece is a constant 0 and the third part is a constant 1. In between these two part the CDF increases linearly S(T ) = a + bt. Find a and b using the least square method. b) Approximate the CDF that describes the diagnosed patients, S, as a function of age, T, and time at risk with a function that is described by 0 when R(T, t) 0 S(T, t) = R(T, t) = a + bt + ct when 0 < R(T, t) < 1 1 when R(T, t) 0 Find the parameters a, b and c using the least square method. Using the QR-factorization of T = QR, where T is the matrix that describes the regression model in a) we can rewrite the least square method equation as [ ] a R = Qs, b where s is a vector of diagnosed patients. c) Use the Gram-Schmidt process to calculate the QR-factorization of T and solve [ ] a R = Qs. b Note: make sure to read the remark at the start of part 2. There seems to be some strong correlation between T and t in the data so we want to see if we can improve the method using principal component regression. [ ] 0.2953 0.9554 The principal components for T and t is given by the matrix W =. 0.9554 0.2953 d) Use the [ ] principal [ ] components to define two new variables r(t, t) and q(t, t) such r T that = W. Fit the model S = ar + bq to the data. q t Next we want to use a more sophisticated model. 5

e) Find a special case of the Weibull CFD that relates diagnosed patients and their age S(T ) = 1 ae bt 3 using LSM. You can assume that it is acceptable to rewrite this as a linear regression problem. Classification of fuel sources using SIMCA Can you identify the species of a tree by burning the wood and measuring the volume of different components in the smoke? To try and answer this question a lab have gathered a couple of logs from two different types of wood, burned them one at a time and measured the amount emitted of various chemical compounds. This could for example be water vapour, carbon dioxide, carbon monoxid, sulfur, etc. Six logs each of the two tree types T 1 and T 2 have been burned and the amount emitted out of 3 types of components have been measured. This gives 12 observations in total with 3 variables (and their tree type) given in the table below: 3.5 3.9 4.2 5 5.3 6 5.5 4.8 5.1 3.9 4.1 3.5 1.3 1.7 2.1 2 3 3.3 2.5 3 3.8 4 4.4 4.5 0.5 0.7 0.8 0.7 1.1 1.2 0.9 1.1 1.4 1.5 1.6 1.7 T 1 T 1 T 1 T 1 T 1 T 1 T 2 T 2 T 2 T 2 T 2 T 2 Our aim is to use the SIMCA method in order to find a model for both types of wood such that we might classify new samples. a) (1) Calculate the covariance matrix for each class. b) (1) Use the covariance matrices for find the principal components (PCA) of each class. Pick the one principal component that describes the most variance within the class. c) (1) Use the chosen principal component of each class to calculate the within class variances (s T1 ) 2, (s T1 ) 2 In order to classify new samples we start by choosing 95% as our confidence level. Since we have n = 6 samples in each class, p = 3 variables at start and use k = 1 principal component in each class we need. F ((p k),(p k)(n k 1)) (0.95) = F (2,8) (0.95) = 4.46 (you do not need to show this) Now that we have everything we need we can start trying to classify new observations with unknown tree type, for this two new logs where burned: 6

4.5 5 4 3 1.5 1.1 d) (1) Use your previous results to classify the two new logs of unknown tree-type. d) (1) Classify all your original samples and calculate the confusion matrix. Since there is a possibility that a sample is classified as none or both types, include both of these scenarios as well in your confusion matrix (so you end up with a 4 4 matrix). 7