讲解:Econ 493、data、R、RC/C++| Statistics、、

Econ 493 A1 - Fall 2019Homework 4Assignment InformationThis assignment is due on Monday November 18 at 11:59 am.Submit the assignment in the locked box in the Department of Economics General Office(Tory 8-14). Note that the General Office is CLOSED daily from 12-1 pm and after 4:00 pm.Late assignments will receive NO MARKS.Answers to computing exercises must include R commands and output files when applicable.All answers must be transcribed to your written answers which must be separate from the Rprintout.Total marks = 50 (5 questions).Exercise 1Electricity consumption is often modelled as a function of temperature. Temperature ismeasured by daily heating degrees and cooling degrees. Heating degrees is 18◦C minus theaverage daily temperature when the daily average is below 18◦C; otherwise it is zero. Thisprovides a measure of our need to heat ourselves as temperature falls. Cooling degreesmeasures our need to cool ourselves as the temperature rises. It is defined as the averagedaily temperature minus 18◦C when the daily average is above 18◦C; otherwise it is zero.Let yt denote the monthly total of kilowatt-hours of electricity used, let x1,t denote themonthly total of heating degrees, and let x2,t denote the monthly total of cooling degrees.An analyst fits the following model to a set of such data:a. What sort of ARIMA model is identified for ηt?b. The estimated coefficients of β1 and β2 are found to be greater than zero. Explain whatthe estimates of β1 and β2 tell us about electricity consumption.c. Describe how this model could be used to forecast electricity demand for the next 12months.d. Explain why the ηt term should be modelled with an ARIMA model rather thanmodeling the data using a standard regression package. In your discussion, comment onthe properties of the estimates, the validity of the standard regression results, and theimportance of the ηt model in producing forecasts.1Exercise 2Given an initial value for y0, re-write each ytin terms of y0 and past innovations (that is, εifor i = 0, . . . , t). Also, find the h-step-ahead forecast for h = 1, 2.a. yt = yt−1 + εt + 0.5εt−1b. yt = 1.1yt−1 + εtc. yt = yt−1 + 1 + εtd. yt = yt−1 + t + εtExercise 3 (R)The file us_macro_quarterly.csv contains quarterly data on several macroeconomic seriesfor the United States. The variable P CEP is the price index for personal consumptionexpenditures from the US National Income and Product Accounts. In this exercise you willconstruct forecasting models for the rate of inflation, based on P CEP. For this analysis, usethe sample period 1963Q1 to 2012Q4.a. Compute the inflation rate, inflt = 400 × [log(P CEPt) − lo代做Econ 493、data代写、代做R、R编程设计代写 g(P CEPt−1)]. What arethe units of infl?b. Use R to plot the inflation rate series (infl) and the ACF. Does the series appear to bestationary? Explain.c. Use R to plot the change in the inflation rate series (infl0) and the ACF. Does thedifferenced series appear to be stationary? Explain.d. Use the ADF test to determine d.e. Compute and plot the one-step-ahead quarterly forecasts of the inflation rate for thepseudo out-of-sample period 2003Q1 to 2012Q4 (40 quarters) using the following models:(i) an ARIMA(2,0,0) and (ii) and ARIMA(2,1,0). Compare your results in terms of theRMSE.f. Are the pseudo out-of-sample forecasts biased? That is, do the forecast errors have anon-zero mean?Exercise 4 (R)Consider the spurious regression problem with time series data. The file inflation.csvcontains 39 annual observations of the following variables (by columns): - Year: 1971-2009 -Deaths: Total number of deaths, Canada - CPI: Consumer Price Index, Canadaa. Use the CPI series to compute the annual inflation rate, inflt = 100 × [log(CP It) −log(CP It−1)] for the sample 1972–2009. Plot the time series.b. Obtain the total number of deaths in Canada per 1000 people for the sample 1972–2009(that is, divide the data by 1000). Plot the time series.c. Use OLS to estimate the equation inflt = β0 + β1deadt + εt. Is deaths significant atthe 5% level? What is the sign of the slope coefficient?d. Relate your results in (c) to the spurious regression problem.2e. Use OLS to estimate the equation infl0t = β0 + β1dead0t + εt. Is deaths significant atthe 5% level? What is the sign of the slope coefficient?f. Use OLS to estimate the equation inflt = β0+β1deadt+β2time+εt. Is deaths significantat the 5% level? What is the sign of the slope coefficient?Exercise 5 (R)The file quarterly.csv contains the series of quarterly industrial production and the consumer’sprice index (CPI) for the US for the quarters 1960:Q1 to 2012:Q4.a. Create the log change in the index of industrial production (indprod) aslip0 = log(indprodt) − log(indprodt−1) and the inflation rate as inflt = log(CP It) −log(CP It−1).b. Determine if lip0 and inflt are stationary?c. Estimate the bivariate VAR using three lags of each variable and a constant. Verifythat the three-lag specification is selected by the BIC, whereas the AIC selects five lags.d. Perform the Granger causality tests. Verify that the F-statistic for the test that inflationGranger-causes industrial production is 4.82 (with a significance level of 0.003) and thatthe F-statistic for the test that industrial production Granger-causes inflation is 5.1050(withh a significance level of 0.002).3转自:http://www.6daixie.com/contents/18/4422.html

你可能感兴趣的:(讲解:Econ 493、data、R、RC/C++| Statistics、、)