WEEK 3 HOMEWORK – SAMPLE SOLUTIONS
IMPORTANT NOTE
These homework solutions show multiple approaches and some optional extensions for most of
the questions in the assignment. You don’t need to submit all this in your a
...
WEEK 3 HOMEWORK – SAMPLE SOLUTIONS
IMPORTANT NOTE
These homework solutions show multiple approaches and some optional extensions for most of
the questions in the assignment. You don’t need to submit all this in your assignments; they’re
included here just to help you learn more – because remember, the main goal of the homework
assignments, and of the entire course, is to help you learn as much as you can, and develop
your analytics skills as much as possible!
Question 7.1
Describe a situation or problem from your job, everyday life, current events, etc., for which exponential
smoothing would be appropriate. What data would you need? Would you expect the value of α (the first
smoothing parameter) to be closer to 0 or 1, and why?
Question 7.2
Using the 20 years of daily high temperature data for Atlanta (July through October) from Question 6.2
(file temps.txt), build and use an exponential smoothing model to help make a judgment of whether the
unofficial end of summer has gotten later over the 20 years. (Part of the point of this assignment is for
you to think about how you might use exponential smoothing to answer this question. Feel free to
combine it with other models if you’d like to. There’s certainly more than one reasonable approach.)
Note: in R, you can use either HoltWinters (simpler to use) or the smooth package’s es function (harder
to use, but more general). If you use es, the Holt-Winters model uses model=”AAM” in the function call
(the first and second constants are used “A”dditively, and the third (seasonality) is used
“M”ultiplicatively; the documentation doesn’t make that clear).
Question 8.1
Describe a situation or problem from your job, everyday life, current events, etc., for which a linear
regression model would be appropriate. List some (up to 5) predictors that you might use.
I supervised a project for a company that builds machinery with custom features. Based on a generic
base model, potential customers specify additional features they need, and the company quotes a price.
The goal of the project was to create a linear regression model to estimate the cost to build each unit,
based on the number of units, time until delivery, and binary variables for each of the potential features.
(It could also include interaction terms between them.) The model would be trained on data from
previous completed projects.
Question 8.2
Using crime data from http://www.statsci.org/data/general/uscrime.txt (file uscrime.txt, description at
http://www.statsci.org/data/general/uscrime.html ), use regression (a useful R function is lm or glm) to
predict the observed crime rate in a city with the following data:
[Show More]