Please use D2L to turn in both the PDF/ Word output and your R Markdown file.

For this exercise, we will revisit the avocado dataset. Our goal is to fit a model that explains avocado volumes. This should build upon the methods you used for question 4 on homework 4.

For this analysis, the goal is to understand the relationship between the volume of conventional avocados purchase and a set of explantory variables.

library(readr)
library(dplyr)
library(lubridate)
library(forecast)
library(ggplot2)
avo <- read_csv('http://www.math.montana.edu/ahoegh/teaching/timeseries/data/avocado_west.csv')
## Parsed with column specification:
## cols(
##   Date = col_date(format = ""),
##   AveragePrice = col_double(),
##   TotalVolume = col_double(),
##   type = col_character()
## )
avo.volume <- avo %>% arrange(Date) %>% filter(type == 'conventional') %>% mutate(month = month(Date), year = year(Date), week.number = 1:n())

ggtsdisplay(avo.volume %>% select(TotalVolume) %>% pull() %>% ts(), main = 'Conventional Avocado Volumes') 

Assume that you are interested in an explanatory modeling framework that assess the impact of avocado price, year, month, and whether the week is a super bowl week to model prices. Additionally, use appropriate tools to verify that the residuals of this model do not contain any structure.

Print out your results and include a written summary of your findings.