Module 1 Discussion 2

Author

Ryan Bean

I. Package questions:

What is fpp3package about? How many data sets does it have? What all packages does it load?

fpp3 is the package from the Forecasting Principles and Practice textbook, written by Rob J Hyndman and George Athanasopoulos. It holds 25 unique datasets, many related to Australia. It loads the packages tibble, dplyr, tidyr, lubridate, ggplot2, tsibble, tsibbledata, feasts, and fable.

library(fpp3)

What is a tsibble?

A tsibble is a set of variables recorded on a regular interval. For example, every quarter from 2010 to 2020 could be stored in a tsibble.

What is feasts package about?

The feasts package provides a collection of features for analyzing time series data, including statistical summaries and graphic functions. It’s also an acronym for “Feature Extraction And Statistics for Time Series.”

library(feasts)
help("feasts-package")

What is fable package about?

The fable package provides a collection of commonly used time series forecasting models, including ETS (exponential smoothing) and ARIMA (moving average).

library(fable)
help("fable-package")

II. Visualization of Fred Data

library(fredr)
fredr_set_key("523a2b98a1ce120186357fd0c916cc26")
help("fredr_series_search_id")
df <- fredr(series_id = "OILPRICE",
            observation_start = as.Date("2000-01-01")
            )
y <- df |>
  mutate(Month = yearmonth(date)) |>
  as_tsibble(index = Month)
autoplot(y, value) +
  labs(y = "Price ($)", 
       x = "Year", 
       title = "West Texas Intermediate: Oil Prices", 
       subtitle = "2000-2013, Monthly", 
       caption = "Source: FRED"
  )

y |>
  gg_season(value, labels = "right") +
  labs(y = "Price($)",
       x = "Month",
       title = "W.T.I. Oil Prices: Seasonal Trends")

y |>
  gg_subseries(value) + 
  labs(y = "Price($)",
       x = "Year",
       title = "W.T.I. Oil Prices: Month"
       )

III. Reference

Hyndman and Athanasopoulos (2021)

“Spot Oil Price: West Texas Intermediate (DISCONTINUED)” (2013)

O’Hara-Wild, Hyndman, and Wang (2019a)

O’Hara-Wild, Hyndman, and Wang (2019b)

Boysel and Vaughan (2018)

References

Boysel, Sam, and Davis Vaughan. 2018. “Fredr: An r Client for the ’FRED’ API.” The R Foundation. https://doi.org/10.32614/cran.package.fredr.
Hyndman, R. J., and G. Athanasopoulos. 2021. Forecasting: Principles and Practice (3rd Ed). Third. https://otexts.com/fpp3/.
O’Hara-Wild, Mitchell, Rob Hyndman, and Earo Wang. 2019a. “Feasts: Feature Extraction and Statistics for Time Series.” The R Foundation. https://doi.org/10.32614/cran.package.feasts.
———. 2019b. “Fable: Forecasting Models for Tidy Time Series.” The R Foundation. https://doi.org/10.32614/cran.package.fable.
“Spot Oil Price: West Texas Intermediate (DISCONTINUED).” 2013. https://fred.stlouisfed.org/series/OILPRICE.