Question: Problem 7.4 In this problem, we will use the correlation coefficient to discover linear relation- ships in data sets. Whenever you are asked to make

Problem 7.4 In this problem, we will use the correlation coefficient to discover linear relation- ships in data sets. Whenever you are asked to make a plot, make sure to turn in ? print out with your homework submission. You do not need to turn i your code. Download the hx7data.?at file from the Homework 7 folder. place it in your working direc- tory, and use the command load hw7data to load the data matrices X, Y, and Z into your environment First, let's recall the idea of linear dependence from linear algebra Specifically, we say that two column vectors bi d2 are lincarly dependent if we can write one as a scalar multiple of the other for some ? 0. Otherwise, we say that they are linearly independent. Recall also that the column rank of a matrix is equal to the number of linearly independent columns. (a) One of the columns in X is linearly dependent with the first column. Use the matlab function rank to disoover which column Plot these two columns against each other using the command plot (xC,1),XC: ,m), 'x") where m is the selected column to make sure one is a scaled version of the other Before we start calculating correlation coefficients, here is a bit of background as to what exactly is being calculated. Say that X 1], . . . .x n are T'8 realizations of a random variable X. Then. the sample mean is ?? =??_iXIi . In Problem 4.3(c), you wrote code to caleulate the sample mean from a sequence of data points, but you could also use MATLAB's built-in function mean. Here. we will be using MATLAB's built-in function corr for the sample correlation coeflicient between two sequences. Say that X11], . . . , X?n] are n realizations of a random variable XI and X2[1] ,X2[n are n realizations of a random variable X2. The sample correlation coefficient is where ?1 and ?2 are the sample means and i= I variances.1 are the sample Recall that the correlation coefficient ?1.2 between Xi and X2 is exactly 1 if Xi-aX2 + b for some a > 0 and is exactly-l if Xi =aX2 + b for some a 0 and is exactly-l if Xi =aX2 + b for some a
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
