--- title: "Stat. 474 Final" author: "Prof. Eric A. Suess" date: "`r format(Sys.time(), '%B %d, %Y')`" output: html_notebook --- This is a take-home Final Exam. You may ask questions of the Professor or search google. This is exam is to be completed independently. For the COVID19 data from the United States develop the best forecasting model and produce a forecast for the next 25 weeks. Note that the data is recorded daily. See Section 9.11 Exercises 10 for an example. ```{r} library(pacman) p_load(fpp3, tidyverse, COVID19) ``` ```{r} covid_data <- covid19(c("United States")) covid_data <- covid_data %>% as_tsibble(key = "id", index = "date") ``` > a. Produce an STL decomposition of the data and describe the trend and seasonality. ### **Answer:** Summarize your answer to the question here. All code and comments should be below and your written answer above. ### **Code and Comments:** ```{r} covid_data %>% autoplot(confirmed) covid_data %>% autoplot(log(confirmed)) ``` > b. Do the data need transforming? If so, find a suitable transformation. ### **Answer:** Summarize your answer to the question here. All code and comments should be below and your written answer above. ### **Code and Comments:** ```{r} ``` > c. Are the data stationary? If not, find an appropriate differencing which yields stationary data. ### **Answer:** Summarize your answer to the question here. All code and comments should be below and your written answer above. ### **Code and Comments:** ```{r} ``` > d. Identify a couple of ARIMA models that might be useful in describing the time series. Which of your models is the best according to their AICc values? ### **Answer:** Summarize your answer to the question here. All code and comments should be below and your written answer above. ### **Code and Comments:** ```{r} ``` The ARIMA(3,1,0)(0,1,1) model is best. > e. Estimate the parameters of your best model and do diagnostic testing on the residuals. Do the residuals resemble white noise? If not, try to find another ARIMA model which fits better. ### **Answer:** Summarize your answer to the question here. All code and comments should be below and your written answer above. ### **Code and Comments:** ```{r} ``` > f. Forecast the next 25 weeks of data. ### **Answer:** Summarize your answer to the question here. All code and comments should be below and your written answer above. ### **Code and Comments:** ```{r} ``` > g. Eventually, the prediction intervals are so wide that the forecasts are not particularly useful. How many weeks of forecasts do you think are sufficiently accurate to be usable? ### **Answer:** Summarize your answer to the question here. All code and comments should be below and your written answer above.