Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A question about time series. I\'m wondering how to solve this problem. Thank yo

ID: 3357663 • Letter: A

Question

A question about time series. I'm wondering how to solve this problem. Thank you! (the data is in R, astsa package~)

3.17 One of the remarkable technological developments in the computer industry has been the ability to store information densely on a hard drive. In addition, the cost of storage has steadily declined causing problems of too much data as opposed to big data. The data set for this assignment is cpg, which consists of the median annual retail price per GB of hard drives, say ct, taken from a sample of nufacturers from 1980 to 2008. (a) Plot c and describe what you see. (b) Argue that the curve ct versus t behaves like ctaest by fitting a linear regression of log ct on t and then plotting the fitted line to compare it to the logged data. Comment. (c) Inspect the residuals of the linear regression fit and comment. (d) Fit the regression again, but now using the fact that the errors are autocorrelated. Comment.

Explanation / Answer

## Using R Commands

load the dataset

data(cpg)

a) plot(cpg)

b) logcpg=log(cpg)

modlm=lm(logcpg~time(logcpg),data=logcpg)

plot(modlm)

fit=ts(modlm$fitted.values,start = 1980,end = 2008,frequency = 1)

plot(logcpg,col="red")
lines(fit)

We can see that there is a close match between Actual and predicted values, though from the lm plots we can see non-linearity.

c) plot(modlm) : We can see the assumption of linearity being vilolated. There seems to be a pattern in residuals suggesting auto-correlation. The errors seem to follow a normal distribution.

d)

acf(modlm$residuals)
pacf(modlm$residuals)

From pacf it seems it's an AR(1) process. We can use generalized least squares to fit the regression line:

read the correlation value from PACF.

require(nlme)
newfit<-gls(logcpg~time(logcpg),data=logcpg,correlation = corAR1(value = .6))