Question: 10. This question should be answered using the Weekly data set, which is part of the ISLR package. This data is similar in nature to

10. This question should be answered using the Weekly data set, which

is part of the ISLR package. This data is similar in nature to the

Smarket data from this chapter's lab, except that it contains 1, 089

weekly returns for 21 years, from the beginning of 1990 to the end of

2010.

(a) Produce some numerical and graphical summaries of the Weekly

data. Do there appear to be any patterns?

(b) Use the full data set to perform a logistic regression with

Direction as the response and the five lag variables plus Volume

as predictors. Use the summary function to print the results. Do

any of the predictors appear to be statistically significant? If so,

which ones?

(c) Compute the confusion matrix and overall fraction of correct

predictions. Explain what the confusion matrix is telling you

about the types of mistakes made by logistic regression.

(d) Now fit the logistic regression model using a training data period

from 1990 to 2008, with Lag2 as the only predictor. Compute the

confusion matrix and the overall fraction of correct predictions

for the held out data (that is, the data from 2009 and 2010).

(e) Repeat (d) using LDA.

(f) Repeat (d) using QDA.

(g) Repeat (d) using KNN with K = 1.

(h) Which of these methods appears to provide the best results on

this data?

(i) Experiment with different combinations of predictors, includ-

ing possible transformations and interactions, for each of the

methods. Report the variables, method, and associated confu-

sion matrix that appears to provide the best results on the held

out data. Note that you should also experiment with values for

K in the KNN classifier.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!