In this weeks discussion, I attempt to forecast portfolio
preformance, using the top down, bottom up, and middle out coupling
methods. My chosen stocks are TSLA, GOOG, BA, and LMT, meaning my two
industries of focus are tech and weapons manufacturing.
## ── Attaching packages ────────────────────────────────────────────── fpp3 0.5 ──
## ✔ tibble 3.2.1 ✔ tsibble 1.1.4
## ✔ dplyr 1.1.4 ✔ tsibbledata 0.4.1
## ✔ tidyr 1.3.0 ✔ feasts 0.3.1
## ✔ lubridate 1.9.3 ✔ fable 0.3.3
## ✔ ggplot2 3.5.0 ✔ fabletools 0.3.4
## ── 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()
##
## Please cite as:
## Hlavac, Marek (2022). stargazer: Well-Formatted Regression and Summary Statistics Tables.
## R package version 5.2.3. https://CRAN.R-project.org/package=stargazer
From the graphs above we can see that while tech stocks behave
very similarly, Boeing and LMT are very different. A part of this is
likely caused by recent volatility stemming from BA’s production issues.
TSLAmodel1 <- TotalTrain %>%
model(
"TSLA" = ARIMA(TSLAAdj.Close)
)
GOOGmodel1 <- TotalTrain %>%
model(
"GOOG" = ARIMA(GOOGAdj.Close)
)
BAmodel1 <- TotalTrain %>%
model(
"BA" = ARIMA(BAAdj.Close)
)
LMTmodel1 <- TotalTrain %>%
model(
"LMT" = ARIMA(LMTAdj.Close)
)
TSLAforc <- TSLAmodel1%>%
forecast(h = 251)
GOOGforc <- GOOGmodel1%>%
forecast(h = 251)
LMTforc <- LMTmodel1%>%
forecast(h = 251)
BAforc <- BAmodel1%>%
forecast(h = 251)
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning: The output of `fortify(<fable>)` has changed to better suit usage with the ggdist package.
## If you're using it to extract intervals, consider using `hilo()` to compute intervals, and `unpack_hilo()` to obtain values.
## Warning: The output of `fortify(<fable>)` has changed to better suit usage with the ggdist package.
## If you're using it to extract intervals, consider using `hilo()` to compute intervals, and `unpack_hilo()` to obtain values.
Unfortunately, for some reason, all forecasts have behaved
identically, and fairly poorly. I suspect the nature of the data, that
of having missing dates within the dataset, confounded the ARIMA model
and led it to turn into a practically naive forecast. In future
forecasts using this method, I will likely focus more on data
optimization and prepping.