Homework Problem 4, STAT 705, Fall 2017. ========================================== Assigned 9/11/2017, Due Monday 9/18/2017 worth 12 points Write a function LinInterp to linearly interpolate values y as a function of x, where x and y are input vectors of the same length, given as a matrix Mxy with column names x and y , and xalt is an input vector of values for x at which interpolated y values are desired. The output should be a matrix cbind(xnew, ynew) , where xnew is the subvector of entries of xalt that fall between min(x) and max(x), inclusive. Write such a function in two different ways, (a) using a for-loop, and (b) vectorizing the interpolation operation. Do timing runs using "system.time" for both of your functions, and show by applying the functions (a), (b) to input matrices Mxy with 100,000 rows and vectors xalt of length at least 1000 , that it does indeed make a difference which way you do the coding. Check that your two functions give exactly the same result, and SHOW that they do (on moderate sized input matrices) visually, by using the commands "plot" and "lines".