Assignment_2_Solution

# Assignment_2_Solution - Stat 371 Spring 2008 Assignment 2...

This preview shows pages 1–3. Sign up to view the full content.

Stat 371 Spring 2008 Assignment 2 Due: in class, June 3 1. Having learned about regression models and prediction, you think about quitting school to make your fortune as a currency trader. If you could predict the closing value of the American dollar one day or even better one week ahead, you could retire without ever having a real job. To test your plan, use the closing value of the \$US measured in terms of \$C at the end of each day from January 1, 2008 to May 23, 2008. Your goal is to predict the closing value of the dollar for May 26 and May 30, 2008. You can find the data in the file ass2q1.txt (source: http://www.x-rates.com/d/CAD/USD/data120.html ) with variate names day , date and value . Note that day is the number corresponding to the date so that Jan 1 is 1, Jan 2 is 2 and so on. NOTE: This solution uses the data as originally posted. The corrected data will give slightly different numerical values. a) Prepare a scatter plot of value vs day . Can you see any regular patterns? The plot looks like an “M” with relatively long periods of increases and decreases. One challenging issue in using past performance to predict the future is to decide what data to use from the past e.g. daily vs weekly, starting from Jan 1 or from April 1 etc. Here we compare using all of the data vs the data from day 80 onward as suggested in the scatter plot. We will use a polynomial in time ( day ) as our model. To avoid problems with round-off errors, create new variates s1 <- (day-mean(day))/sd(day), s2 <- s1*s1, s3 <-s1^3, …,s6 <- s1^6 . Note that a polynomial of degree k in s1 is also a polynomial of degrees k in day and vice versa. 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
b) Consider a model of the form 01 2 6 1 2 ... 6 value s s s R β ββ = ++ + + + . Why can we not interpret 2 as usual? Any suggestions? We usually interpret a coefficient such as 2 by looking at how the response variate changes with s2 holding all other explanatory variates in the model fixed. This is impossible since all of the explanatory variates are functions of s1. One possible (but not very informative) interpretation is that 2 represents the curvature of the response when s1=0. It does not make a lot of sense here to interpret the individual coefficients, only the polynomial as a whole. c) Using all of the data, fit 4 th , 5 th and 6 th degree polynomial models. How does 2 R change. What would happen if we added a seventh degree term? Why? We get the following values of 2 R . Degree of Polynomial 2 R 4 0.3896 5 0.5161 6 0.5251 Adding any extra term can only increase 2 R , since the residual sum of squares cannot get any larger when we add another explanatory variate to the model ˆˆ T rr d) Find a 95% prediction interval for the value on May 26 and May 30, 2008 for each of the above models. Which interval do you prefer?
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 05/12/2011 for the course STAT 371 taught by Professor Ahmed during the Fall '09 term at Waterloo.

### Page1 / 8

Assignment_2_Solution - Stat 371 Spring 2008 Assignment 2...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online