Skip to content

AlexanderHolmes0/Senate_Tracker

Repository files navigation

💡 User Guide

First Things First

This guide is designed to bring YOU up to speed on what this app is all about.
First, I would like to thank you for your interest in this project 😊

To get started exploring stock trades and when politicians bought/sold them, click on the side bar menu and find ‘Home’ (🏠).
For a quick exploration, click the different tabs on the stock quotes box to the right of the stock series. The icons align with the side bar menu on the left hand side of the page to allow for deeper exploration.

From this page you can explore any of the 8,000+ available stocks to choose from but not all will have senate trades. This is done with the sidebar dropdown called Stock Name.

The table to the right of the time series plot are monthly stock quotes for your selected stock. This box can also show 3 different plots (‘Seasonality’🍃, ‘Autocorrelation’ 📊, ‘Decomposition’ 🗑️)

This app updates daily except for interpretation examples‼️

The table below the plot features ANY trades that senators have made and disclosed. (A neato pop-up will inform you if no senators have traded the selected stonk)
The sidebar also houses a variable selection called Plotted Variable. Pick from any to see it within the plot.

Red 🔴/Green🟢/Orange🟠/Blue🔵 lines appear on the plot indicating the Type of transaction the senator did and when they did.
In addition to the already discussed functionality, there are two other input choices you can make.

Transaction Type filters the senate data to only include certain transactions like only
'Sale (Full)' transactions. Pick and choose from the dropdown options.

Date Range filters the stock data to only include certain dates. This partition of stock data is used globally on every tab and will stay this way until Transaction Type dropdown is changed or the Stock Name is changed.

Let’s keep it goin!
So what about maths with stonks 🚀 That’s why I’m here!
Alright alright

I was getting to it

Maths Stuff 📚

Seasonality

Click on the ‘Seasonality’ (🍃) tab to see the seasonality of the selected stock. The plot next to it will be the yearly breakdown by color of the seasonality patterns📈.
This makes finding seasonal trends easier.
Another nifty feature is that YOU can decide how this decomposition is run. More on this lil later.

‘Decomposition’ (in this case) is us trying to make sense of the past by taking into account certain features of the series (Trend, Seasonality, Random)


Autocorrelation

As we continue down the sidebar, we arrive at this thing called ‘Autocorrelation’ (📊) tab

What is that you ask?
Correlation with lags and YOU get to choose how much lag is present (plus animations)
woo hoo!🎉

Lag is just how far we are pushing earlier observations down and seeing how they correlate with those later values.

Table example:

Month SomeNum Lagged Value
1 2 NA
2 3 2

See how the first month got pushed down to the second month?
That’s Autocorrelation! ‘Correlation with lags’

Next Menu Item!


Decomposition

Decomposition (🗑️) tab is all about breaking down a series into different parts.
There are 5️⃣ options to choose from when performing decomposition on a time series.
Classical contains both additive and multiplicative types. Seasonality does not change which is usually not a good thing.

Additive

Concerned about adding up the different components.

Yt = Trendt ➕ Seasonalityt ➕ Randomt

  • Use Additive when the trend is mostly going one direction and seasonal variation (differences) is minimal
  • Expressed in ‘things’ above the trend i.e. ‘We are $400 above the trend’

Multiplicative

Concerned about multiplying the different components together.

Yt = Trendt ✖️ Seasonalityt ✖️ Randomt

  • Use Multiplication when the trend is parabolic or the seasonal variation is getting ‘cone’ shaped.
  • Expressed in percentages above the trend (middle is 0% but shown as 1)

STL (My Fav)

Seasonal and Trend decomposition using Loess
Uses additive but multiplicative can be obtained through transformations of data.

  • Uses locally fitted regression models to fit the line and bring out the true features of the series as well as being robust to outliers.
  • Read more about it here! STL.pdf

Seats & X11 methods

X11

Developed by the US Census Bureau for better forecasting and evaluation of census data. It only allows for monthly and quarterly data. 😔

Classical decomp but on steroids! Seasonality allowed to change.
Many extra steps involved we won’t dive into here but know its awesome.

SEATS (Feature In Development)

(Seasonal Extraction in ARIMA Time Series) was developed by the Bank of Spain. Seasonality is also allowed to change here.
It’s a pretty great method as well.

Learn just how these methods do it X-13ARIMA-SEATS Manual


Play around and test all different stuff!
This is YOUR playground for discovering stock patterns 🚀 or politician ‘shadiness’ ‼️

Head on over to interpretation examples 🖊 to see more tips!