Module 5 Discussion

Author

Tin Vu

#loading libraries
library(fpp3)
library(fredr)
library(ggplot2)
library(patchwork)

#FRED API Key
fredr_set_key ("2e2c37e9aafe0f62c76d6bc4ef83765f")

1) Please explain what are smoothing parameters in an ETS model.

ETS stands for error, trend, and seasonality and exponetial smoothing means that the model makes forecasts by putting higher weights on more recent observation and less weights on older observations. It helps with smoothing out unnecessary noise while retaining the main patterns in the data.

The 4 ETS parameters are level (⍺), trend (𝛽), seasonality (𝛾), and dampening (𝜙).

Level (⍺): Updates the baseline of the series, a high value means that it adjusts quickly while a low value means that it changes slowly.

Trend (𝛽): Updates the slope of the plot, a high value means that trends can change quickly and a low value means that the trend stays stable.

Seasonality (𝛾): Updates the seasonal pattern or repeating cycles, a high value means that seasonality can shift over time while a low value means that seasonality remains consistent.

Dampening (𝜙): Dampening controls whether the trend continues to keep the same path into future projections or flattens out. A value of 1 or close to 1, means that no dampening occurs and the trend continues while a value lower than 1 means that dampening does occur and the trend will start to gradually flatten over time.

2) Pick any 2 different time series, visualize them and upload them as a image vector photo. Based on eyeballing the pattern, what values of smoothing parameters do you expect (for alpha, beta, gamma, phi)?

#Loading Data Set From FRED

#Time series 1
fedfunds <- fredr(series_id = "FEDFUNDS", 
      observation_start = as.Date("1990-01-01"),
      observation_end   = as.Date("2026-01-01")) |>
  transmute(Month = yearmonth(date), value) |>
  as_tsibble(index = Month)

#Time series 2 
realGDP <- fredr(series_id = "GDPC1", 
      observation_start = as.Date("1990-01-01"),
      observation_end   = as.Date("2026-02-26")) |>
  transmute(Month = yearmonth(date), value) |>
  as_tsibble(index = Month)

#time series 1 plot 
plot1 <- fedfunds |> 
  autoplot(value) +
  labs(
    title = "Federal Funds Effective Rate",
    y = "Percent",
    x = "Month"
)

#time series 2 plot
plot2 <- realGDP |> 
  autoplot(value) +
  labs(
    title = "Real Gross Domestic Product",
    y = "Billions of Chained 2017 Dollars",
    x = "Month"
)

plot1 / plot2

Federal funds effective rate:

Lots of long flat periods and then sharp moves which may come from policy changes. This is more level shifts than a smooth trend and doesn’t show repeating seasonality.

Level (⍺): Seems likely to be be fairly high, so maybe from the ranges of 0.5-1. The model seems to adjust quickly when the level changes.

Trend (𝛽): Most likely very low since there isn’t a stable slope.

Seasonality (𝛾): Most likely close to 0 since it doesn’t seem like it would be used. No obvious seasonal cycle.

Dampening (𝜙): Likely 1, so it doesn’t seem like it would be used.

Real gross domestic product:

A clear upward direction over time (trend), and not so obvious repeating seasonal pattern.

Level (⍺): There seems like it would have a medium value close to ~0.5 since it doesn’t seem to be adjusting as quick, a bit delayed.

Trend (𝛽): Possibly low to medium so around 0.25, a trend does seem to exist but changes very gradually.

Seasonality (𝛾): There doesn’t seem to be any seasonal cycle so close to 0.

Dampening (𝜙): Possibly close to 1 or 1, maybe very slight trend flattening over time but overall doesn’t seem to have a clear dampening effect.

3) Find the best ETS model on your time series data, confirm your intuition was right (or wrong) about the parameters. Reconcile the results/explain.

# Fit plot1 ETS (fedfunds)
plot1_fit_level<- fedfunds |> model(ETS(value))
report(plot1_fit_level)
Series: value 
Model: ETS(A,Ad,N) 
  Smoothing parameters:
    alpha = 0.9998997 
    beta  = 0.5821373 
    phi   = 0.8319484 

  Initial states:
     l[0]       b[0]
 8.207768 -0.0128668

  sigma^2:  0.019

     AIC     AICc      BIC 
918.7740 918.9712 943.1984 

For seasonality, we expected there to be no seasonality and the modeled picked N which means seasonality isn’t present. The level or alpha being high is what we expected because the series shifts quickly and the actual alpha value is essentially 1. We predicted that there would be no trend and no dampening but the model automatically picked both a trend and dampening. The beta value being 0.58 is higher than what I expected and the phi value being 0.83 is definitely a lot different than what I predicted.

Auto ETS selected ETS(A,Ad,N) for fedfunds: no seasonality as expected, but it preferred a damped trend to capture longer rate cycles while using very high α to react quickly to policy-driven level changes.

# Fit plot2 ETS (realGDP)
plot2_fit_level <- realGDP |> model(ETS(value))
report(plot2_fit_level) 
Series: value 
Model: ETS(M,A,N) 
  Smoothing parameters:
    alpha = 0.825075 
    beta  = 0.0001001029 

  Initial states:
     l[0]     b[0]
 9938.154 91.35665

  sigma^2:  1e-04

     AIC     AICc      BIC 
2205.653 2206.087 2220.502 

For seasonality, we predicted that there would be no seasonal cycle, and we got N, so we were correct. While the trend does exist according to the model and we did predict there to be a trend, but beta value essentially being 0 means that the trend slope is very stable and doesn’t update much over time. No dampening occurs either which is what we predicted. The model chose the error to be multiplicative which makes sense for GDP forecast errors, bigger economies would result in bigger deviations.

Auto ETS selected ETS(M,A,N) for realGDP: no seasonality as expected, a trend component is included, but β is essentially zero, implying the slope is very stable and most updating happens through the level (high α). Multiplicative errors imply variability scales with GDP’s size.