Skip to content

Commit a8a78bf

Browse files
committed
Roll-over for 2025
1 parent 248eaf9 commit a8a78bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+629
-797
lines changed

_dependencies.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ library(commonmark)
22
library(markdown)
33
library(languageserver)
44
library(codetools)
5+
library(moodlequiz)

_quarto.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ website:
3232
- week12/index.qmd
3333
- text: Discussion
3434
icon: chat-fill
35-
href: https://edstem.org/au/courses/15863/discussion/
35+
href: https://edstem.org/au/courses/21163/discussion/
3636
- text: Moodle
3737
icon: mortarboard-fill
38-
href: https://learning.monash.edu/course/view.php?id=10091&section=1
38+
href: https://learning.monash.edu/course/view.php?id=26695&section=1
3939
- text: Textbook
4040
icon: book-fill
4141
href: https://OTexts.com/fpp3

assignments.csv

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Assignment, Due, Moodle, File
2-
Assignment 1, 2024-03-08, 2298116, "A1.qmd"
3-
Assignment 2, 2024-03-24, 2034165, "A2.qmd"
4-
Assignment 3, 2024-04-14, 2034169, "A3.qmd"
5-
Assignment 4, 2024-05-05, 2034170, "A4.qmd"
6-
Retail Project, 2024-05-24, 2034167, "Project.qmd"
2+
Forecasting Competition, 2025-03-14, 3444036, "competition.qmd"
3+
Assignment 1, 2025-03-28, 3444030, "A1.qmd"
4+
Assignment 2, 2025-04-18, 3444031, "A2.qmd"
5+
Assignment 3, 2025-05-16, 3444032, "A3.qmd"
6+
Retail Project, 2025-05-30, 3444033, "Project.qmd"

assignments/A1.qmd

Lines changed: 24 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,37 @@
11
---
22
title: Assignment 1
3-
fig-cap-location: top
43
---
54

6-
**You must provide forecasts for the following items:**
5+
This assignment will use the same data that you will use in the [retail project](Project.qmd) later in semester. Each student will use a different time series, selected using their student ID number as follows.
6+
7+
```r
8+
library(fpp3)
9+
get_my_data <- function(student_id) {
10+
set.seed(student_id)
11+
all_data <- readr::read_rds("https://bit.ly/monashretaildata")
12+
while(TRUE) {
13+
retail <- filter(all_data, `Series ID` == sample(`Series ID`, 1))
14+
if(!any(is.na(fill_gaps(retail)$Turnover))) return(retail)
15+
}
16+
}
17+
# Replace the argument with your student ID
18+
retail <- get_my_data(12345678)
19+
```
20+
21+
1. Plot your time series using the `autoplot()` command. What do you learn from the plot?
22+
2. Plot your time series using the `gg_season()` command. What do you learn from the plot?
23+
3. Plot your time series using the `gg_subseries()` command. What do you learn from the plot?
24+
4. Find an appropriate Box-Cox transformation for your data and explain why you have chosen the particular transformation parameter $\lambda$.
25+
5. Produce a plot of an STL decomposition of the transformed data. What do you learn from the plot?
726

8-
1. Google closing stock price on 20 March 2024 [[Data](https://finance.yahoo.com/quote/GOOG/)].
9-
2. Maximum temperature at Melbourne airport on 10 April 2024 [[Data](http://www.bom.gov.au/climate/dwo/IDCJDW3049.latest.shtml)].
10-
3. The difference in points (Collingwood minus Essendon) scored in the AFL match between Collingwood and Essendon for the Anzac Day clash. 25 April 2024 [[Data](https://en.wikipedia.org/wiki/Anzac_Day_match)].
11-
4. The seasonally adjusted estimate of total employment for April 2024. ABS CAT 6202, to be released around mid May 2024 [[Data](https://www.abs.gov.au/statistics/labour/employment-and-unemployment/labour-force-australia/latest-release)].
12-
5. Google closing stock price on 22 May 2024 [[Data](https://finance.yahoo.com/quote/GOOG/)].
27+
For all plots, please use appropriate axis labels and titles.
1328

14-
**For each of these, give a point forecast and an 80% prediction interval, and explain in a couple of sentences how each was obtained.**
29+
You need to submit one Quarto (`qmd`) file which implements all steps above.
1530

16-
* The [Data] links give you possible data to start with, but you are free to use any data you like.
17-
* There is no need to use any fancy models or sophisticated methods. Simple is better for this assignment. The methods you use should be understandable to any high school student.
18-
* Full marks will be awarded if you submit the required information, and are able to meaningfully justify your results in a couple of sentences in each case.
19-
* Once the true values in each case are available, we will come back to this exercise and see who did the best using the scoring method described in class.
20-
* The student with the lowest score is the winner of our forecasting competition, and will win a $50 cash prize.
21-
* The assignment mark is not dependent on your score.
31+
To receive full marks, the `qmd` file must compile without errors.
2232

2333
```{r}
2434
#| output: asis
2535
source(here::here("course_info.R"))
2636
submit(schedule, "Assignment 1")
2737
```
28-
29-
___
30-
31-
## Leaderboard
32-
33-
```{r}
34-
readRDS(here::here("assignments/A1_leaderboard.rds")) |>
35-
DT::datatable()
36-
```
37-
38-
## Forecasts
39-
40-
::: {layout-ncol=5}
41-
42-
### Q1
43-
[![Google closing stock price on 20 March 2024](Q1.png)](Q1.png)
44-
45-
### Q2
46-
[![Maximum temperature at Melbourne airport on 10 April 2024](Q2.png)](Q2.png)
47-
48-
### Q3
49-
[![Difference in points in AFL Anzac Day clash](Q3.png)](Q3.png)
50-
51-
### Q4
52-
[![Seasonally adjusted total employment for April 2024](Q4.png)](Q4.png)
53-
54-
### Q5
55-
[![Google closing stock price on 22 May 2024](Q5.png)](Q5.png)
56-
57-
:::

assignments/A1_leaderboard.rds

-7.58 KB
Binary file not shown.

assignments/A1_responses.rds

-14.6 KB
Binary file not shown.

assignments/A2.qmd

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,22 @@ get_my_data <- function(student_id) {
1010
set.seed(student_id)
1111
all_data <- readr::read_rds("https://bit.ly/monashretaildata")
1212
while(TRUE) {
13-
retail <- filter(all_data, `Series ID` == sample(`Series ID`, 1))
13+
retail <- filter(all_data, `Series ID` == sample(`Series ID`, 1))
1414
if(!any(is.na(fill_gaps(retail)$Turnover))) return(retail)
1515
}
1616
}
1717
# Replace the argument with your student ID
1818
retail <- get_my_data(12345678)
1919
```
2020

21-
1. Plot your time series using the `autoplot()` command. What do you learn from the plot?
22-
2. Plot your time series using the `gg_season()` command. What do you learn from the plot?
23-
3. Plot your time series using the `gg_subseries()` command. What do you learn from the plot?
24-
4. Find an appropriate Box-Cox transformation for your data and explain why you have chosen the particular transformation parameter $\lambda$.
25-
5. Produce a plot of an STL decomposition of the transformed data. What do you learn from the plot?
21+
1. Using a test set of 2019--2022, fit an ETS model chosen automatically, and three benchmark methods to the training data. Which gives the best forecasts on the test set, based on RMSE?
22+
2. Check the residuals from the best model using an ACF plot and a Ljung-Box test. Do the residuals appear to be white noise?
23+
3. Now use time-series cross-validation with a minimum sample size of 15 years, a step size of 1 year, and a forecast horizon of 5 years. Calculate the RMSE of the results. Does it change the conclusion you reach based on the test set?
24+
4. Which of these two methods of evaluating accuracy is more reliable? Why?
2625

27-
For all plots, please use appropriate axis labels and titles.
26+
Submit a Quarto (`qmd`) file which carries out the above analysis. You need to submit one file which implements all steps above.
2827

29-
You need to submit one Rmarkdown or Quarto file which implements all steps above.
30-
31-
To receive full marks, the Rmd or qmd file must compile without errors.
28+
To receive full marks, the `qmd` file must compile without errors.
3229

3330
```{r}
3431
#| output: asis

assignments/A3.R

Lines changed: 0 additions & 31 deletions
This file was deleted.

assignments/A3.qmd

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,32 @@
22
title: Assignment 3
33
---
44

5-
This assignment will use national population data from 1960 -- 2022. Each student will use a different time series, selected using their student ID number as follows.
5+
This assignment will use the same data that you will use in the [retail project](Project.qmd) later in semester. Each student will use a different time series, selected using their student ID number as follows.
66

77
```r
88
library(fpp3)
9-
# Replace seed with your student ID
10-
set.seed(12345678)
11-
pop <- readr::read_rds("https://bit.ly/monashpopulationdata") |>
12-
filter(Country == sample(Country, 1))
9+
get_my_data <- function(student_id) {
10+
set.seed(student_id)
11+
all_data <- readr::read_rds("https://bit.ly/monashretaildata")
12+
while(TRUE) {
13+
retail <- filter(all_data, `Series ID` == sample(`Series ID`, 1))
14+
if(!any(is.na(fill_gaps(retail)$Turnover))) return(retail)
15+
}
16+
}
17+
# Replace the argument with your student ID
18+
retail <- get_my_data(12345678)
1319
```
1420

15-
Population should be modelled as a logarithm as it increases exponentially.
21+
Use a training set up to and including 2018.
1622

17-
1. Using a test set of 2018--2022, fit an ETS model chosen automatically, and three benchmark methods to the training data. Which gives the best forecasts on the test set, based on RMSE?
18-
2. Check the residuals from the best model using an ACF plot and a Ljung-Box test. Do the residuals appear to be white noise?
19-
3. Now use time-series cross-validation with a minimum sample size of 15 years, a step size of 1 year, and a forecast horizon of 5 years. Calculate the RMSE of the results. Does it change the conclusion you reach based on the test set?
20-
4. Which of these two methods of evaluating accuracy is more reliable? Why?
23+
* What transformations (Box-Cox and/or differencing) would be required to make the data stationary? You should use a unit-root test as part of the discussion.
24+
* Use a plot of the ACF and PACF of the (possibly differenced) data to determine two plausible models for this data set.
25+
* Fit both models, along with an automatically chosen model, and produce forecasts for 2019--2022.
26+
* Which model is best based on AIC? Which model is best based on the test set RMSE? Which do you think is best to use for future forecasts? Why?
27+
* Check the residuals from your preferred model, using an ACF plot and a Ljung-Box test. Do the residuals appear to be white noise?
2128

22-
Submit an Rmd or qmd file which carries out the above analysis. You need to submit one file which implements all steps above.
29+
Submit a Quarto (`qmd`) file which carries out the above analysis. You need to submit one file which implements all steps above.
2330

24-
To receive full marks, the Rmd or qmd file must compile without errors.
2531

2632
```{r}
2733
#| output: asis

assignments/A4.R

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)