Discussion2_You-Jin,Tsai

Author

You-Jin,Tsai

1 Part I

1.1 Question1: What is fpp3 package about? How many data sets does it have? What all packages does it load?

The fpp3 package is the companion package for the textbook Forecasting: Principles and Practice (3rd edition). It provides the data sets used in the book (25 data sets Figure 1) and automatically loads the main tidyverts packages for time series analysis. (Hyndman 2025)

From library(fpp3), we can see that it loads the following packages: tibble, dplyr, tidyr, lubridate, ggplot2, tsibble, tsibbledata, feasts, and fable.

Sys.setlocale("LC_TIME", "en_US.UTF-8")
[1] "en_US.UTF-8"
library(fpp3)
Warning: package 'fpp3' was built under R version 4.5.2
Registered S3 method overwritten by 'tsibble':
  method               from 
  as_tibble.grouped_df dplyr
── Attaching packages ──────────────────────────────────────────── fpp3 1.0.2 ──
✔ tibble      3.3.0     ✔ tsibble     1.1.6
✔ dplyr       1.1.4     ✔ tsibbledata 0.4.1
✔ tidyr       1.3.1     ✔ feasts      0.4.2
✔ lubridate   1.9.4     ✔ fable       0.5.0
✔ ggplot2     4.0.1     
Warning: package 'ggplot2' was built under R version 4.5.2
Warning: package 'tsibble' was built under R version 4.5.2
Warning: package 'tsibbledata' was built under R version 4.5.2
Warning: package 'feasts' was built under R version 4.5.2
Warning: package 'fabletools' was built under R version 4.5.2
Warning: package 'fable' was built under R version 4.5.2
── Conflicts ───────────────────────────────────────────────── fpp3_conflicts ──
✖ lubridate::date()    masks base::date()
✖ dplyr::filter()      masks stats::filter()
✖ tsibble::intersect() masks base::intersect()
✖ tsibble::interval()  masks lubridate::interval()
✖ dplyr::lag()         masks stats::lag()
✖ tsibble::setdiff()   masks base::setdiff()
✖ tsibble::union()     masks base::union()
data(package = "fpp3")
Figure 1

1.2 Question2: What is a tsibble ?

A tsibble is a tidy time series data frame. It has an index (a time variable) and a key (which identifies different series). It follows tidy data principles, making it easy to use with dplyr, ggplot2, and other tidyverse tools.[ Wang, Cook, and Hyndman (2020)]

1.3 Question3: What is feasts package about?

The feasts package is used for exploring, visualizing, and describing time series data. It provides tools for decomposition, autocorrelation analysis, summary statistics, and visualizations. It helps us understand the patterns in our data before building models.[ O’Hara-Wild, Hyndman, and Wang (2025)]

1.4 Question4: What is fable package about?

The fable package is the forecasting and modeling package in the tidyverts ecosystem. It allows us to fit models such as ARIMA, ETS, and then generate forecasts using a tidy, consistent workflow. [ O’Hara-Wild, Hyndman, and Wang (2026)]

2 Part II

“For this assignment, I selected several Boston‑related data series from FRED. These include the All‑Transactions House Price Index for Boston, MA (MSAD), the Unemployment Rate in Boston, MA (MD), and All Employees: Manufacturing in Boston, MA (MD).”

2.1 Load Package

library(fredr)
Warning: package 'fredr' was built under R version 4.5.2
fredr_set_key(Sys.getenv("FRED_API_KEY"))

2.2 Load Data

# House Price Index
hpi <- fredr(
  series_id = "ATNHPIUS14454Q",
  observation_start = as.Date("2016-01-01")
)

# Unemployment Rate
unemp_r <- fredr(
  series_id = "LAUDV251445400000003",
  observation_start = as.Date("2016-01-01")
)

# Manufacturing Employment
manu_e <- fredr(
  series_id = "SMU25144543000000001",
  observation_start = as.Date("2016-01-01")
)

2.3 Time Series Visualization

ggplot(hpi, aes(x = date, y = value)) +
  geom_line(color = "red",linewidth=1) +
  labs(title = "All-Transactions House Price Index for Boston, MA",
       subtitle="Quarterly,From 2016Q1~2025Q3",
       x = "Year", 
       y = "Index 1995:Q1=100",
       caption="Source:Fred"
       )

ggplot(unemp_r, aes(x = date, y = value)) +
  geom_line(color = "orange",linewidth=1) +
  labs(title = "Unemployment Rate in Boston, MA (MD)",
       subtitle="Monthly,From Jan-2016 to Nov-2025",
       x = "Year", 
       y = "Percent",
       caption="Source:Fred"
       )

ggplot(manu_e, aes(x = date, y = value)) +
  geom_line(color = "purple",linewidth=1) +
  labs(title = "All Employees: Manufacturing in Boston, MA (MD)",
       subtitle="Monthly,From Jan-2016 to Nov-2025",
       x = "Year", 
       y = "Thousands of Persons",
       caption="Source:Fred"
       )

References

Hyndman, Rob. 2025. “Fpp3: Data for "Forecasting: Principles and Practice" (3rd Edition).” https://doi.org/10.32614/CRAN.package.fpp3.
O’Hara-Wild, Mitchell, Rob Hyndman, and Earo Wang. 2025. “Feasts: Feature Extraction and Statistics for Time Series.” https://doi.org/10.32614/CRAN.package.feasts.
———. 2026. “Fable: Forecasting Models for Tidy Time Series.” https://doi.org/10.32614/CRAN.package.fable.
Wang, Earo, Dianne Cook, and Rob J Hyndman. 2020. “A New Tidy Data Structure to Support Exploration and Modeling of Temporal Data” 29: 466–78. https://doi.org/10.1080/10618600.2019.1695624.