Professional Documents
Culture Documents
Google - Stock - XLSX: Lab 7 Autoregression and Piecewise Linear Regression
Google - Stock - XLSX: Lab 7 Autoregression and Piecewise Linear Regression
1. The data set (google_stock.xlsx) consists of n = 105 values which are the closing stock price of a share
of Google stock during 2-7-2005 to 7-7-2005.
2. Let yt = the annual number of worldwide earthquakes with magnitude greater than 7 on the Richter
scale for n = 100 years (earthquakes.xlsx data obtained from https://earthquake.usgs.gov).
Fit a AR(2) and AR(3) model to the data and plot the predictions. Compute 𝑟 2 value for both fits.
3. The shipment data set (shipment.txt) contains the cost of a shipment (in thousand dollars) and the
size of the shipment (in thousand parts).
a. Read the data using dlmread as the columns are separated by white space/tabs
b. Plot the data
c. First fit a linear line to the data to predict cost using size.
d. Use size = 250 as a knot and do a piecewise linear regression.
e. Plot both fitted lines.
f. Compute 𝑟 2 for both cases.