10.9) Fit a lag-5 autoregressive model to the NYSE data, as described in the text (Section 10.5) and Lab 10.9.6. Refit the model with a 12-level factor representing the month. Does this factor improve the performance of the model?
10.10) In Section 10.9.6, we showed how to fit a linear AR model to the NYSE data using the lm() function. However, we also mentioned that we can “flatten” the short sequences produced for the RNN model in order to fit a linear AR model. Use this latter approach to fit a linear AR model to the NYSE data. Compare the test R2 of this linear AR model to that of the linear AR model that we fit in the lab. What are the advantages/disadvantages of each approach?
10.11) Repeat the previous exercise, but now fit a nonlinear AR model by “flattening” the short sequences produced for the RNN model.
10.12) Consider the RNN fit to the NYSE data in Section 10.9.6. Modify the code to allow inclusion of the variable day_of_week, and fit the RNN. Compute the test R2 .
10.13) Repeat the analysis of Lab 10.9.5 on the IMDb data using a similarly structured neural network. There we used a dictionary of size 10,000 . Consider the effects of varying the dictionary size. Try the values 1000 , 3000 , 5000 , and 10,000 , and compare the results.
Download Book: https://www.statlearning.com/
Authors' Lectures (R): • Statistical Learning with R
Authors' Lectures (Python): • Statistical Learning with Python
https://colab.research.google.com/dri...