Discussion 4

Author

Robert Jenkins

Setup

library(fpp3)
library(fredr)
library(dplyr)
library(tseries)
library(fabletools)
fredr_has_key()
[1] TRUE

FRED Data

#Large Bank Consumer Credit Card Balances: Total Balances (RCCCBBALTOT)
Large_Bank_CCC <- fredr(series_id = "RCCCBBALTOT") |>
  transmute(month = yearmonth(date),value) |>
  as_tsibble(index = month)


#Borrowings, All Commercial Banks (H8B3094NCBDM)
Borrowings_ABC <- fredr(series_id = "H8B3094NCBDM") |>
  transmute(month = yearmonth(date),value) |>
  as_tsibble(index = month)

autoplot(Large_Bank_CCC)+
  labs(title = "Large Bank Consumer Credit Card Balances",
    subtitle = "Monthly Data (FRED: RCCBBALTOT)",
    x = "Month",
    y = "Billions of Dollars"
  )

autoplot(Borrowings_ABC)+
    labs(
    title = "Borrowings at All Commercial Banks",
    subtitle = "Monthly Data (FRED: H8B3094NCBDM)",
    x = "Month",
    y = "Millions of Dollars"
  )

Finding Best ETS Model

# Fit ETS for Credit Card Balances
fit_cc_ann <- Large_Bank_CCC |>
  model(ann = ETS(value ~ error("A") + trend("N") + season("N")))

# Fit ETS for Bank Borrowings
fit_borrow <- Borrowings_ABC |>
  model(ets = ETS(value))

report(fit_cc_ann)
Series: value 
Model: ETS(A,N,N) 
  Smoothing parameters:
    alpha = 0.9028616 

  Initial states:
     l[0]
 572.3163

  sigma^2:  929.0039

     AIC     AICc      BIC 
576.5947 577.0845 582.5056 
report(fit_borrow)
Series: value 
Model: ETS(M,Ad,N) 
  Smoothing parameters:
    alpha = 0.9998997 
    beta  = 0.07481076 
    phi   = 0.9709424 

  Initial states:
     l[0]    b[0]
 43996.64 2341.11

  sigma^2:  6e-04

     AIC     AICc      BIC 
16558.82 16558.95 16585.56