Skip to content

Commit

Permalink
Updated renv and recompiled
Browse files Browse the repository at this point in the history
  • Loading branch information
robjhyndman committed Jan 23, 2024
1 parent bbcbbc1 commit d7be386
Show file tree
Hide file tree
Showing 22 changed files with 78 additions and 81 deletions.
4 changes: 2 additions & 2 deletions _freeze/assignments/A2/execute-results/html.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"hash": "2fdc228899b4120f50b1f353ed12bfc8",
"hash": "18d74fd2481bfeae1e9e0303e96f3d0b",
"result": {
"engine": "knitr",
"markdown": "---\ntitle: Assignment 2\n---\n\n\nThis 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.\n\n```r\n# Replace the seed with your student ID\nset.seed(12345678)\nretail <- readr::read_rds(\"https://bit.ly/monashretaildata\") |>\n filter(`Series ID` == sample(`Series ID`, 1))\n```\n\n 1. Plot your time series using the `autoplot()` command. What do you learn from the plot?\n 2. Plot your time series using the `gg_season()` command. What do you learn from the plot?\n 3. Plot your time series using the `gg_subseries()` command. What do you learn from the plot?\n 4. Find an appropriate Box-Cox transformation for your data and explain why you have chosen the particular transformation parameter $\\lambda$.\n 5. Produce a plot of an STL decomposition of the transformed data. What do you learn from the plot?\n\nYou need to submit one Rmarkdown or Quarto file which implements all steps above.\n\nTo receive full marks, the Rmd or qmd file must compile without errors.\n\n\n<br><br><hr><b>Due: 22 March 2024</b><br><a href=https://learning.monash.edu/mod/assign/view.php?id=2034165 class = 'badge badge-large badge-blue'><font size='+2'>&nbsp;&nbsp;<b>Submit</b>&nbsp;&nbsp;</font><br></a>\n",
"markdown": "---\ntitle: Assignment 2\n---\n\n\nThis 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.\n\n```r\n# Replace the seed with your student ID\nset.seed(12345678)\nretail <- readr::read_rds(\"https://bit.ly/monashretaildata\") |>\n filter(`Series ID` == sample(`Series ID`, 1))\n```\n\n 1. Plot your time series using the `autoplot()` command. What do you learn from the plot?\n 2. Plot your time series using the `gg_season()` command. What do you learn from the plot?\n 3. Plot your time series using the `gg_subseries()` command. What do you learn from the plot?\n 4. Find an appropriate Box-Cox transformation for your data and explain why you have chosen the particular transformation parameter $\\lambda$.\n 5. Produce a plot of an STL decomposition of the transformed data. What do you learn from the plot?\n\nFor all plots, please use appropriate axis labels and titles.\n\nYou need to submit one Rmarkdown or Quarto file which implements all steps above.\n\nTo receive full marks, the Rmd or qmd file must compile without errors.\n\n\n<br><br><hr><b>Due: 22 March 2024</b><br><a href=https://learning.monash.edu/mod/assign/view.php?id=2034165 class = 'badge badge-large badge-blue'><font size='+2'>&nbsp;&nbsp;<b>Submit</b>&nbsp;&nbsp;</font><br></a>\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
Expand Down
4 changes: 2 additions & 2 deletions _freeze/assignments/A4/execute-results/html.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"hash": "ecd870b2226cc85092e37213bea2523e",
"hash": "fb25018867f57bd07a76176f4b58a69e",
"result": {
"engine": "knitr",
"markdown": "---\ntitle: Assignment 4\n---\n\n\n## Background\n\nHere is a function that generates data from an AR(1) model starting with the first value set to 0\n\n```r\ngenerate_ar1 <- function(n = 100, c = 0, phi, sigma = 1) {\n # Generate errors\n error <- rnorm(n, mean = 0, sd = sigma)\n # Set up vector for the response with initial values set to 0\n y <- rep(0, n)\n # Generate remaining observations\n for(i in seq(2, length = n-1)) {\n y[i] <- c + phi * y[i-1] + error[i]\n }\n return(y)\n}\n```\n\nHere `n` is the number of observations to simulate, `c` is the constant, `phi` is the AR coefficient, and `sigma` is the standard deviation of the noise. The following example shows the function being used to generate 50 observations\n\n```r\nlibrary(fpp3)\ntsibble(time = 1:50, y = generate_ar1(n=50, c=1, phi=0.8), index = time) |>\n autoplot(y)\n```\n\n## Instructions\n\n<ol>\n<li> Modify the `generate_ar1` function to generate data from any ARMA(p,q) model with parameters to be specified by the user. The first line of your function definition should be\n\n ```r\n generate_arma <- function(n = 100, c = 0, phi = NULL, theta = NULL, sigma = 1)\n ```\n\n Here `phi` and `theta` are vectors of AR and MA coefficients. Your function should return a numeric vector of length `n`.\n\n For example `generate_arma(n = 50, c = 2, phi = c(0.4, -0.6))` should return 50 observations generated from the model\n $$y_t = 2 + 0.4y_{t-1} - 0.6y_{t-2} + \\varepsilon_t$$\n where $\\varepsilon \\sim N(0,1)$.\n\n<li> The noise should be generated using the `rnorm()` function.\n\n<li> Your function should check stationarity and invertibility conditions and return an error if either condition is not satisfied. You can use the `stop()` function to generate an error. The model will be stationary if the following expression returns `TRUE`:\n\n ```r\n !any(abs(polyroot(c(1,-phi))) <= 1)\n ```\n\n The MA parameters will be invertible if the following expression returns `TRUE`:\n\n ```r\n !any(abs(polyroot(c(1,theta))) <= 1)\n ```\n\n<li> The above function sets the first value of every series to 0. Your function should fix this problem by generating more observations than required and then discarding the first few observations. You will need to consider how many observations to discard, to prevent the returned series from being affected by the initial values. Test that it is working by checking that the first few values of the series are close to the mean of the series, even when `c` is a large value.\n</ol>\n\nPlease submit your solution as a .R file.\n\n\n<br><br><hr><b>Due: 3 May 2024</b><br><a href=https://learning.monash.edu/mod/assign/view.php?id=2034170 class = 'badge badge-large badge-blue'><font size='+2'>&nbsp;&nbsp;<b>Submit</b>&nbsp;&nbsp;</font><br></a>\n",
"markdown": "---\ntitle: Assignment 4\n---\n\n\n## Background\n\nHere is a function that generates data from an AR(1) model starting with the first value set to 0\n\n```r\ngenerate_ar1 <- function(n = 100, c = 0, phi, sigma = 1) {\n # Generate errors\n error <- rnorm(n, mean = 0, sd = sigma)\n # Set up vector for the response with initial values set to 0\n y <- rep(0, n)\n # Generate remaining observations\n for(i in seq(2, length = n-1)) {\n y[i] <- c + phi * y[i-1] + error[i]\n }\n return(y)\n}\n```\n\nHere `n` is the number of observations to simulate, `c` is the constant, `phi` is the AR coefficient, and `sigma` is the standard deviation of the noise. The following example shows the function being used to generate 50 observations\n\n```r\nlibrary(fpp3)\ntsibble(time = 1:50, y = generate_ar1(n=50, c=1, phi=0.8), index = time) |>\n autoplot(y)\n```\n\n## Instructions\n\n<ol>\n<li> Modify the `generate_ar1` function to generate data from an ARIMA(p,d,q) model with parameters to be specified by the user. The first line of your function definition should be\n\n ```r\n generate_arima <- function(n = 100, d = 0, c = 0, phi = NULL, theta = NULL, sigma = 1)\n ```\n\n Here `phi` and `theta` are vectors of AR and MA coefficients. Your function should return a numeric vector of length `n`.\n\n For example `generate_arima(n = 50, d = 1, c = 2, theta = c(0.4, -0.6))` should return 50 observations generated from the ARIMA(2,1,0) model\n $$y_t = y_{t-1} + 2 + 0.4\\varepsilon_{t-1} - 0.6\\varepsilon_{t-2} + \\varepsilon_t$$\n where $\\varepsilon \\sim N(0,1)$.\n\n<li> The noise should be generated using the `rnorm()` function.\n\n<li> Your function should check stationarity and invertibility conditions and return an error if either condition is not satisfied. You can use the `stop()` function to generate an error. The model will be stationary if the following expression returns `TRUE`:\n\n ```r\n !any(abs(polyroot(c(1,-phi))) <= 1)\n ```\n\n The MA parameters will be invertible if the following expression returns `TRUE`:\n\n ```r\n !any(abs(polyroot(c(1,theta))) <= 1)\n ```\n\n<li> The above function sets the first value of every series to 0. Your function should fix this problem by generating more observations than required and then discarding the first few observations. You will need to consider how many observations to discard, to prevent the returned series from being affected by the initial values.\n\n<li> You may find the `diffinv()` function useful.\n</ol>\n\nPlease submit your solution as a .R file.\n\n\n<br><br><hr><b>Due: 3 May 2024</b><br><a href=https://learning.monash.edu/mod/assign/view.php?id=2034170 class = 'badge badge-large badge-blue'><font size='+2'>&nbsp;&nbsp;<b>Submit</b>&nbsp;&nbsp;</font><br></a>\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
Expand Down
4 changes: 2 additions & 2 deletions _freeze/index/execute-results/html.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"hash": "714719b3ab59aa54d9c31b04f22fe49c",
"hash": "76923fb7edcc8acb67aca6effb17a013",
"result": {
"engine": "knitr",
"markdown": "---\ntitle: \"ETC3550/5550 Applied forecasting\"\n---\n\n\n\n\n## Lecturer/Chief Examiner\n\n* [**Rob J Hyndman**](https://robjhyndman.com). Email: [[email protected]](mailto:[email protected])\n\n## Tutors\n\n* [**Mitchell O'Hara-Wild**](https://mitchelloharawild.com). Email: [[email protected]](mailto:[email protected])\n* Elena Sanina\n* Xiaoqian Wang\n* Zhixiang (Elvis) Yang\n\n## Consultations\n\n* Rob\n* Mitch\n* Elena\n* Elvis\n* Xiaoqian\n\n## Weekly schedule\n\n* Pre-recorded videos: approximately 1 hour per week [[Slides](https://github.com/robjhyndman/fpp3_slides)]\n* Tutorials: 1.5 hours in class per week\n* Seminars: 9am Fridays, [Central 1 Lecture Theatre, 25 Exhibition Walk](https://maps.app.goo.gl/RKdmJq2tBfw8ViNT9).\n\n\n\n\n|Date |Topic |Chapter |Assessments |\n|:------|:-----------------------------------|:--------------------------------|:--------------|\n|26 Feb |[Introduction to forecasting and R](./week1/index.html)|[1. Getting started](https://OTexts.com/fpp3/intro.html)| |\n|04 Mar |[Time series graphics](./week2/index.html)|[2. Time series graphics](https://OTexts.com/fpp3/graphics.html)|[Assignment 1](assignments/A1.qmd)|\n|11 Mar |[Time series decomposition](./week3/index.html)|[3. Time series decomposition](https://OTexts.com/fpp3/decomposition.html)| |\n|18 Mar |[The forecaster's toolbox](./week4/index.html)|[5. The forecaster's toolbox](https://OTexts.com/fpp3/toolbox.html)|[Assignment 2](assignments/A2.qmd)|\n|25 Mar |[Exponential smoothing](./week5/index.html)|[8. Exponential smoothing](https://OTexts.com/fpp3/expsmooth.html)| |\n|01 Apr |Mid-semester break | | |\n|08 Apr |[Exponential smoothing](./week6/index.html)|[8. Exponential smoothing](https://OTexts.com/fpp3/expsmooth.html)|[Assignment 3](assignments/A3.qmd)|\n|15 Apr |[ARIMA models](./week7/index.html) |[9. ARIMA models](https://OTexts.com/fpp3/arima.html)| |\n|22 Apr |[ARIMA models](./week8/index.html) |[9. ARIMA models](https://OTexts.com/fpp3/arima.html)| |\n|29 Apr |[ARIMA models](./week9/index.html) |[9. ARIMA models](https://OTexts.com/fpp3/arima.html)|[Assignment 4](assignments/A4.qmd)|\n|06 May |[Multiple regression and forecasting](./week10/index.html)|[7. Time series regression models](https://OTexts.com/fpp3/regression.html)| |\n|13 May |[Dynamic regression](./week11/index.html)|[10. Dynamic regression models](https://OTexts.com/fpp3/dynamic.html)| |\n|20 May |[Dynamic regression](./week12/index.html)|[10. Dynamic regression models](https://OTexts.com/fpp3/dynamic.html)|[Retail Project](assignments/Project.qmd)|\n\n\n## Assessments\n\nFinal exam 60%, project 20%, other assignments 20%\n\n## R package installation\n\nHere is the code to install the R packages we will be using in this unit.\n\n```r\ninstall.packages(c(\"tidyverse\",\"fpp3\", \"GGally\"), dependencies = TRUE)\n```\n",
"markdown": "---\ntitle: \"ETC3550/5550 Applied forecasting\"\n---\n\n\n\n\n## Lecturer/Chief Examiner\n\n* [**Rob J Hyndman**](https://robjhyndman.com). Email: [[email protected]](mailto:[email protected])\n\n## Tutors\n\n* [**Mitchell O'Hara-Wild**](https://mitchelloharawild.com). Email: [[email protected]](mailto:[email protected])\n* Elena Sanina\n* Xiaoqian Wang\n* Zhixiang (Elvis) Yang\n\n## Consultations\n\n* Rob\n* Mitch\n* Elena\n* Elvis\n* Xiaoqian\n\n## Weekly schedule\n\n* Pre-recorded videos: approximately 1 hour per week [[Slides](https://github.com/robjhyndman/fpp3_slides)]\n* Tutorials: 1.5 hours in class per week\n* Seminars: 9am Fridays, [Central 1 Lecture Theatre, 25 Exhibition Walk](https://maps.app.goo.gl/RKdmJq2tBfw8ViNT9).\n\n\n\n\n|Week |Topic |Chapter |Assessments |\n|:------|:-----------------------------------|:--------------------------------|:--------------|\n|26 Feb |Introduction to forecasting and R |[1. Getting started](https://OTexts.com/fpp3/intro.html)| |\n|04 Mar |[Time series graphics](./week04 Mar/index.html)|[2. Time series graphics](https://OTexts.com/fpp3/graphics.html)|[Assignment 1](assignments/A1.qmd)|\n|11 Mar |Time series decomposition |[3. Time series decomposition](https://OTexts.com/fpp3/decomposition.html)| |\n|18 Mar |The forecaster's toolbox |[5. The forecaster's toolbox](https://OTexts.com/fpp3/toolbox.html)|[Assignment 2](assignments/A2.qmd)|\n|25 Mar |Exponential smoothing |[8. Exponential smoothing](https://OTexts.com/fpp3/expsmooth.html)| |\n|01 Apr |[Mid-semester break](./week01 Apr/index.html)|[NA](NA) | |\n|08 Apr |[Exponential smoothing](./week08 Apr/index.html)|[8. Exponential smoothing](https://OTexts.com/fpp3/expsmooth.html)|[Assignment 3](assignments/A3.qmd)|\n|15 Apr |ARIMA models |[9. ARIMA models](https://OTexts.com/fpp3/arima.html)| |\n|22 Apr |ARIMA models |[9. ARIMA models](https://OTexts.com/fpp3/arima.html)| |\n|29 Apr |ARIMA models |[9. ARIMA models](https://OTexts.com/fpp3/arima.html)|[Assignment 4](assignments/A4.qmd)|\n|06 May |[Multiple regression and forecasting](./week06 May/index.html)|[7. Time series regression models](https://OTexts.com/fpp3/regression.html)| |\n|13 May |Dynamic regression |[10. Dynamic regression models](https://OTexts.com/fpp3/dynamic.html)| |\n|20 May |Dynamic regression |[10. Dynamic regression models](https://OTexts.com/fpp3/dynamic.html)|[Retail Project](assignments/Project.qmd)|\n\n\n## Assessments\n\nFinal exam 60%, project 20%, other assignments 20%\n\n## R package installation\n\nHere is the code to install the R packages we will be using in this unit.\n\n```r\ninstall.packages(c(\"tidyverse\",\"fpp3\", \"GGally\"), dependencies = TRUE)\n```\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
Expand Down
Binary file modified _freeze/week10/slides/figure-beamer/traintest1-1.pdf
Binary file not shown.
Binary file modified _freeze/week10/slides/figure-beamer/traintest1a-1.pdf
Binary file not shown.
Binary file modified _freeze/week10/slides/figure-beamer/tscvggplot1-1.pdf
Binary file not shown.
Binary file modified _freeze/week10/slides/figure-beamer/unnamed-chunk-1-1.pdf
Binary file not shown.
4 changes: 3 additions & 1 deletion _freeze/week11/index/execute-results/html.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"result": {
"engine": "knitr",
"markdown": "---\ntitle: \"Week 11: Dynamic regression\"\n---\n\n::: {.cell}\n\n:::\n\n\n## What you will learn this week\n\n* How to combine regression models with ARIMA models to form dynamic regression models\n* Dynamic harmonic regression to handle complex seasonality\n* Lagged predictors\n\n## Pre-class activities\n\nRead [Chapter 10 of the textbook](https://otexts.com/fpp3/dynamic.html) and watch all embedded videos\n\n## Exercises (on your own or in tutorial)\n\nComplete Exercises 1-7 from [Section 7.10 of the book](https://otexts.com/fpp3/regression-exercises.html).\n\n\n## Slides for seminar\n\n<embed src='https://af.numbat.space/week11/slides.pdf' type='application/pdf' width='100%' height=465></embed>\n<a href=https://af.numbat.space/week11/slides.pdf class='badge badge-small badge-red'>Download pdf</a>\n\n## Seminar activities\n\n\n\nRepeat the daily electricity example, but instead of using a quadratic function of temperature, use a piecewise linear function with the \"knot\" around 20 degrees Celsius (use predictors `Temperature` & `Temp2`). How can you optimize the choice of knot?\n\nThe data can be created as follows.\n\n```r\nvic_elec_daily <- vic_elec |>\n filter(year(Time) == 2014) |>\n index_by(Date = date(Time)) |>\n summarise(\n Demand = sum(Demand)/1e3,\n Temperature = max(Temperature),\n Holiday = any(Holiday)\n ) |>\n mutate(\n Temp2 = I(pmax(Temperature-20,0)),\n Day_Type = case_when(\n Holiday ~ \"Holiday\",\n wday(Date) %in% 2:6 ~ \"Weekday\",\n TRUE ~ \"Weekend\"\n )\n )\n```\n\nRepeat but using all available data, and handling the annual seasonality using Fourier terms.\n\n\n\n## Assignments\n\n* [Retail Project](../assignments/Project.qmd) is due on Friday 24 May.\n",
"supporting": [],
"supporting": [
"index_files"
],
"filters": [
"rmarkdown/pagebreak.lua"
],
Expand Down
Binary file modified _freeze/week12/slides/figure-beamer/unnamed-chunk-1-1.pdf
Binary file not shown.
Binary file modified _freeze/week2/activities/figure-html/acf-quiz-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _freeze/week2/index/figure-html/acf-quiz-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _freeze/week2/slides/figure-beamer/unnamed-chunk-1-1.pdf
Binary file not shown.
Binary file modified _freeze/week2/slides/figure-beamer/unnamed-chunk-2-1.pdf
Binary file not shown.
Binary file modified _freeze/week3/slides/figure-beamer/abs3-1.pdf
Binary file not shown.
Binary file modified _freeze/week3/slides/figure-beamer/abs4-1.pdf
Binary file not shown.
Binary file modified _freeze/week3/slides/figure-beamer/abs5-1.pdf
Binary file not shown.
Binary file modified _freeze/week3/slides/figure-beamer/abs6-1.pdf
Binary file not shown.
Binary file modified _freeze/week3/slides/figure-beamer/abs7-1.pdf
Binary file not shown.
Binary file modified _freeze/week3/slides/figure-beamer/abs8-1.pdf
Binary file not shown.
Binary file modified _freeze/week3/slides/figure-beamer/abs9-1.pdf
Binary file not shown.
Binary file modified _freeze/week9/slides/figure-beamer/venn-1.pdf
Binary file not shown.
Loading

0 comments on commit d7be386

Please sign in to comment.