Q1.1 Australian Population
Q2. Use the Facebook stock price (data set gafa_stock) to do the following: Produce a time plot of the series.Produce forecasts using the drift method and plot them.Show that the forecasts are identical to extending the line drawn between the first and last observations.Try using some of the other benchmark functions to forecast the same data set. Which do you think is best? Why?
Stock prices are influenced by many factors and could be volatile, naive performs best because it didn’t assume seaslonal patterns like snavie or assumes consitent trend like drift method.
## # A tibble: 30 × 4
## h Model Manual Difference
## <int> <dbl> <dbl> <dbl>
## 1 1 131. 131. 0
## 2 2 131. 131. 0
## 3 3 131. 131. 0
## 4 4 131. 131. 0
## 5 5 131. 131. 0
## 6 6 131. 131. 0
## 7 7 131. 131. 0
## 8 8 131. 131. 0
## 9 9 131. 131. 0
## 10 10 132. 132. 0
## # ℹ 20 more rows
## Warning: The future dataset is incomplete, incomplete out-of-sample data will be treated as missing.
## 30 observations are missing between 2019-01-01 and 2019-01-30
Q3.Apply a seasonal naïve method to the quarterly Australian beer production data from 1992. Check if the residuals look like white noise, and plot the forecasts. The following code will help.
p-value calculated from Ljung_box test is large engough to indicate residuals to be white noise.
## Warning: `gg_tsresiduals()` was deprecated in feasts 0.4.2.
## ℹ Please use `ggtime::gg_tsresiduals()` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning: Removed 4 rows containing missing values or values outside the scale range
## (`geom_line()`).
## Warning: Removed 4 rows containing missing values or values outside the scale range
## (`geom_point()`).
## Warning: Removed 4 rows containing non-finite outside the scale range
## (`stat_bin()`).
## # A tibble: 1 × 3
## .model lb_stat lb_pvalue
## <chr> <dbl> <dbl>
## 1 SNAIVE(Beer) 58.6 0.0000994
Q4.Repeat the previous exercise using the Australian Exports series from global_economy and the Bricks series from aus_production. Use whichever of NAIVE() or SNAIVE() is more appropriate in each case.
Australian Exports - Ljung-Box test p-value is 0.282618 indicate the residuals for Australian Exports are white noise. Bricks Production - Ljung-Box test p-value is 8.093526e-14 suggests the residuals for Bricks Production are not white noise.
## Warning: Removed 4 rows containing missing values or values outside the scale range
## (`geom_line()`).
## Warning: Removed 4 rows containing missing values or values outside the scale range
## (`geom_point()`).
## Warning: Removed 4 rows containing non-finite outside the scale range
## (`stat_bin()`).
Q7.
## Warning: Removed 12 rows containing missing values or values outside the scale range
## (`geom_line()`).
## Warning: Removed 12 rows containing missing values or values outside the scale range
## (`geom_point()`).
## Warning: Removed 12 rows containing non-finite outside the scale range
## (`stat_bin()`).