CS计算机代考程序代写 2. Carol, an amateur economist, proposes the following time series model for unemployment

2. Carol, an amateur economist, proposes the following time series model for unemployment
rate:
yt= 1 +p3yt!1″1yt!2+”t; (1) 20 2 4
where “t # iid N(0;0:022) (normal distribution with mean 0 and variance 0:022). The time period is measured in number of quarters.
(a) Show that the time series fytg generated by model (1) is stationary.
(b) There is a stochastic cycle in the time series generated by model (1). Find its periodity
in number of quarters.
(c) Compute the ACF for the Örst 3 lags, i.e., ((1), ((2) and ((3).
(d) Write an R program to simulate a sample path of fytg over 30 years. Set the initial values y0 and y!1 to be y0 = 0:1 and y!1 = 0:12. While simulating the random numbers for “t, set the random seed to be your last 4 digits of your SID (this is to ensure that your answer will be di§erent from that of other students).
(e) Plot the sample ACF and record its value for the Örst 3 lags (the values can be retrieved from the acf command output stored as a list). Why are they di§erent from your answers in part (b)?
(f) Using the simulated sample path in part (d), estimate an AR(2) model using the R command arima. Write down the estimated model with the parameter estimates and their standard error. Also record the estimated variance of the innovations.
[Important note: the ìinterceptî estimate in the arima output is in fact the unconditional mean; see Rob Hyndmanís page for details: https://robjhyndman.com/hyndsight/ arimaconstants/.]
(g) Using the simulated sample path in part (d) and the R package forecast, plot the point forecast and the conÖdence interval for each period over the next 5 years. Describe the short-run and long-run behaviour of the point forecast and the conÖdence interval.
2

3. (Ex: 2.8 of RT) Consider the data set of the previous question (i.e., Ex: 2.7 of RT, with data set d-ibm3dxwkdays8008.txt), but focus on the daily simple returns of the S&P composite index.1 For convenient reporting of parameters estimates, please express the daily simple re- turns in percentage (i.e., multiply by 100). Perform the necessary data analysis and statistical tests using the 5% signiÖcance level to answer the following questions:
(a) Is there any weekday e§ect on the daily simple returns of the S&P composite index? You may employ a linear regression model to answer this question. Estimate the model, check its validity, and test the hypothesis that there is no Friday e§ect. Draw your conclusion.
[Hint: note that the Öve weekday dummies are collinear. You may either drop one of them, or include all of them in a regression without intercept (implemented using lm(y#x1+x2+…+xn+0)). The latter approach is more convenient for testing the Friday e§ect.]
(b) Check the residual serial correlations using Q(12) statistic. Are there any signiÖcant serial correlations in the residuals? If yes, build a regression model with time series errors for the data.
[Hint: If you use auto.arima, the option xreg=c(var1,var2,…) allows you to include regressor variables. If you want to include all Öve weekday dummies, you need to suppress the intercept using the option allowmean=F to avoid collinearity.]
1 The data Öle contains 12 columns, The columns are (year, month, day, IBM, VW, EW, SP, M, T, W, H, F), where M, T, W, R, and F denote indicator variables for Monday to Friday, respectively. The daily returns of S&P composite index are in column 7.
3