Page 1 of 1

Exercise 3. Load the beersales dataset in the TSA package by running data(beersales). You will model monthly beersales i

Posted: Tue Nov 23, 2021 9:30 am
by answerhappygod
Exercise 3 Load The Beersales Dataset In The Tsa Package By Running Data Beersales You Will Model Monthly Beersales I 1
Exercise 3 Load The Beersales Dataset In The Tsa Package By Running Data Beersales You Will Model Monthly Beersales I 1 (66.43 KiB) Viewed 69 times
this needs to be solved in R. please provide R code
Exercise 3. Load the beersales dataset in the TSA package by running data(beersales). You will model monthly beersales in millions of barrels and perform the following tasks. (a) Create plots using tsdisplay() and comment on them. Also perform an Augmented Dickey- Fuller test for unit roots and comment on the result. [5] (b) Estimate a trend by smoothing the series and plot it. What order do you choose for the moving average smoother and why? [5] 2 (c) Hence decompose the time series as an additive model with trend, seasonal, and random components. Find the seasonal and random components and plot them against time. Centre the seasonal component on zero. [5] (d) Fit a linear trend by fitting a linear model using linear_tc=lm(TC time beersales)). Then create the deterministic part of a forecast by adding the trend and seasonal compo- nents extrapolated forward 2 years. Hint: You should use deltat(beersales) to get the time gap between time points. [5] (e) Use the above to calculate the minimum means-squared error forecast for the next 2 years and plot the mean of this forecast. [5]