当前位置:天才代写 > 作业代写,留学生作业代写-北美、澳洲、英国等靠谱代写 > 回归和预测代写 Regression and Forecasting代写

回归和预测代写 Regression and Forecasting代写

2022-01-03 11:53 星期一 所属: 作业代写,留学生作业代写-北美、澳洲、英国等靠谱代写 浏览:532

回归和预测代写

STAT 321 – Regression and Forecasting

Assignment #4

回归和预测代写 1) Create a time series plot of the gdp. Comment on what you see. 2) Note that it appears that the variation in gdp increases slightly over time.

The GDP_US dataset contains the quarterly gross domestic product (chained 2012 $ ×109 ) for the U.S. for the 10 year period from 2009 to 2018 inclusive (Source: https://fred.stlouisfed.org/ )

 

(1-4)    回归和预测代写

1) Create a time series plot of the gdp. Comment on what you see.

2) Note that it appears that the variation in gdp increases slightly over time. A common procedure before fitting a linear regression model to account for the seasonal and trend components in time series data is to take a log transformation of the series. Create a time series plot of the log transformed series. Compare this plot with the plot in a). We will use the transformed series for all remaining questions.

3) Fit a linear regression model to account for the observed seasonal component and (linear) trend, as described in lessons. Comment on the overall fit of the model.

4) Assess the adequacy of the model by examining a time series plot of the residuals, a qq plot, and a correlogram (note that a time series plot of the residuals will be very similar but preferred to a plot of the fitted values vs the residuals in this case).

 

回归和预测代写
回归和预测代写

 

(5-8)  

5) Add a quadratic trend term to account for model adequacy issues. Comment on the effect adding this term has on the overall fit of the model.

6) What conclusions can you draw from the estimates and associated p-values of the seasonal parameters?

7) Forecast the gdp for the first quarter of 2019. Remember to back transform the data from the log scale.

8) Reassess the adequacy of the model by replotting the plots in d).

 

(9-12)  回归和预测代写

9) Test for the significance of a positive lag-1 autocorrelation using the Durbin-Watson test statistic. Calculate the value directly from the definition and compare this value to the appropriate upper and lower critical values (for a = 0.05) from a Durbin-Watson table (tables can be found on the web).

10) Confirm your result in 9) by using R to perform the test using the commands:

> library(lmtest)
> dwtest (model name)

 

11) Fit an AR(1) model to the residuals using the arima function in R. Use thepredict function to forecast the residual for the first quarter of 2019.

12) Revise your forecasted sales in 7) using the forecasted residual in 11)

 

13)  回归和预测代写

Instead of fitting a linear regression model, we can use differencing to eliminate the seasonal and/or trend components.

a) Use differencing to remove the seasonal component in the time series. The difffunction in R can be used to achieve this for the appropriate lag (k =4). Provide a time series plot of the differenced series. Comment.

b) Use differencing of the (seasonally) differenced series in a) to also remove the (lag1) trend.

c) Plot the differenced series in b). Has the trend been eliminated?

d) After accounting for the seasonal and trend component through differencing, is there still autocorrelation in the time series? Plot the correlogram and comment.

 

回归和预测代写
回归和预测代写

 

 

 

更多代写:cs设计作业代做  雅思代考  英国生物学Biology网课代修  市场营销essay代写  数学math论文代写  网上作业代写

合作平台:随笔代写 论文代写 写手招聘 英国留学生代写

 

 

天才代写-代写联系方式