5.1

Produce forecasts for the following series using whichever of NAIVE(y), SNAIVE(y) or RW(y ~ drift()) is more appropriate in each case: ### a.Australian Population (global_economy)

b. Bricks (aus_production)

Naïve method

## Warning: Removed 20 rows containing missing values (`geom_line()`).

#### Seasonal naïve method

## Warning: Removed 20 rows containing missing values (`geom_line()`).

### NSW Lambs (aus_livestock) #### Seasonal Naive lambs

Drift Lambs

Seasonal Naive is the best forecat model in this cases, as it shows peak birthing capacity planning of lambs.

d. Household wealth (hh_budget)

e.Australian takeaway food turnover (aus_retail)

5.2

Use the Facebook stock price (data set gafa_stock) to do the following: ### a.Produce a time plot of the series.

## # A tsibble: 1,006 x 9 [1]
## # Key:       Symbol [1]
##    Symbol Date        Open  High   Low Close Adj_Close   Volume   day
##    <chr>  <date>     <dbl> <dbl> <dbl> <dbl>     <dbl>    <dbl> <int>
##  1 FB     2015-01-02  78.6  78.9  77.7  78.4      78.4 18177500     1
##  2 FB     2015-01-05  78.0  79.2  76.9  77.2      77.2 26452200     2
##  3 FB     2015-01-06  77.2  77.6  75.4  76.2      76.2 27399300     3
##  4 FB     2015-01-07  76.8  77.4  75.8  76.2      76.2 22045300     4
##  5 FB     2015-01-08  76.7  78.2  76.1  78.2      78.2 23961000     5
##  6 FB     2015-01-09  78.2  78.6  77.2  77.7      77.7 21157000     6
##  7 FB     2015-01-12  77.8  78    76.2  76.7      76.7 19190200     7
##  8 FB     2015-01-13  77.2  78.1  75.8  76.4      76.4 25179600     8
##  9 FB     2015-01-14  76.4  77.2  76.0  76.3      76.3 25741000     9
## 10 FB     2015-01-15  76.4  76.6  73.5  74.1      74.1 34134000    10
## # ℹ 996 more rows

b. Produce forecasts using the drift method and plot them.

C.Show that the forecasts are identical to extending the line drawn between the first and last observations.

### d.Try using some of the other benchmark functions to forecast the same data set. Which do you think is best? Why? The best one is using the Drift method.

5.3

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.

## Warning: Removed 4 rows containing missing values (`geom_line()`).
## Warning: Removed 4 rows containing missing values (`geom_point()`).
## Warning: Removed 4 rows containing non-finite values (`stat_bin()`).

5.4

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.

a. Export

## Warning: Removed 1 row containing missing values (`geom_line()`).
## Warning: Removed 1 rows containing missing values (`geom_point()`).
## Warning: Removed 1 rows containing non-finite values (`stat_bin()`).

### b.Bricks

## Warning: Removed 21 rows containing missing values (`geom_line()`).
## Warning: Removed 21 rows containing missing values (`geom_point()`).
## Warning: Removed 21 rows containing non-finite values (`stat_bin()`).

## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf

## Warning in max(ids, na.rm = TRUE): no non-missing arguments to max; returning
## -Inf
## Warning: Removed 8 rows containing missing values (`()`).
## Warning: Removed 20 rows containing missing values (`geom_line()`).

Conclusion: Good forecast methods should have normally distributed residuals, A model with small residuals will give good forecasts.

5.7

For your retail time series (from Exercise 7 in Section 2.10):

a.

Create a training dataset consisting of observations before 2011 using

b.

Check that your data have been split appropriately by producing the following plot. ### c. Fit a seasonal naïve model using SNAIVE() applied to your training data (myseries_train).

d. 

Check the residuals.

## Warning: Removed 12 rows containing missing values (`geom_line()`).
## Warning: Removed 12 rows containing missing values (`geom_point()`).
## Warning: Removed 12 rows containing non-finite values (`stat_bin()`).

Do the residuals appear to be uncorrelated and normally distributed? Normal distribution is ok.

e.

Produce forecasts for the test data

## Joining with `by = join_by(State, Industry, `Series ID`, Month, Turnover)`

### f. Compare the accuracy of your forecasts against the actual values.

## # A tibble: 1 × 12
##   State    Industry .model .type    ME  RMSE   MAE   MPE  MAPE  MASE RMSSE  ACF1
##   <chr>    <chr>    <chr>  <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 Norther… Clothin… SNAIV… Trai… 0.439  1.21 0.915  5.23  12.4     1     1 0.768
## # A tibble: 1 × 12
##   .model    State Industry .type    ME  RMSE   MAE   MPE  MAPE  MASE RMSSE  ACF1
##   <chr>     <chr> <chr>    <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 SNAIVE(T… Nort… Clothin… Test  0.836  1.55  1.24  5.94  9.06  1.36  1.28 0.601

g.

How sensitive are the accuracy measures to the amount of training data used?