The world’s leading publication for data science, AI, and ML professionals.

Saving Money Using Data Science

Why that student in class who asked your math teacher "When am I ever going to use this stuff?" is probably broke

In an earlier article, I discussed how to use the STL algorithm to break any time series into its seasonal, trend and noise component. I walked you through an example using the stock price for Amazon. In this article, I am going to show you how you can use the same technique to save money when renting an apartment. I am going to use monthly average rental prices for 1 bedroom apartments that Apartment List makes available here between 2017 and 2021. If you want to see example code, see my earlier article.

If you didn’t read my earlier article, here is a brief primer on the STL algorithm: It takes any time-series as an input and it breaks that time-series into its seasonal, trend and remainder (i.e., noise) component. For example, here is the average monthly rent for a 1 bedroom apartment in Boston, MA (first chart) decomposed into the three components (second chart):

Image by Author
Image by Author
Image by Author
Image by Author

If we focus on just the seasonal component, we can see which month of the year you should sign your lease to get the cheapest monthly rent. In Boston the min to max seasonality is -$60 to +$50, which means signing your lease in some months will decrease your monthly rent by an average of -$60 and for other months it will increase by +$50.

Image by Author
Image by Author

For Boston, the seasonality is highest in August and lowest in January. Therefore, you should try to sign a yearly lease between December and January (you will save $110 per month compared to the seasonal peak), and avoid signing between May and August (you will pay $110 more per month compared to the seasonal minimum). So, some open source Data with a few lines of R code can save you $1,300 per year if you live in Boston. Not all cities show the same seasonality as Boston. For example, let’s look at Miami, FL and Austin, TX.

Image by Author
Image by Author

In Miami, FL we see that the seasonality is at a maximum of about +$15 per month in March and a minimum of -$15 per month in October; not as dramatic as Boston. Choosing the right month to sign a lease in Miami, FL will save you about $360 per year. The seasonality in Austin, TX has a similar range: its maximum is +$20 per month in August and its minimum is -$15 per month in February. You can save a bit more in Austin, TX (e.g., $420 per year) versus Miami, FL if you sign your lease at the right time.

Image by Author
Image by Author
Image by Author
Image by Author

The dataset from Apartment List contains complete data for 479 cities. One interesting question to ask is: "Which cities demonstrate the largest difference between the maximum and minimum seasonality?" Sorted from largest to smallest, let’s look at all the cities where the difference is greater than $100:

Image by Author
Image by Author

There are 26 cities across the United States where signing an apartment lease in the right month will save you at least $1,200 per year. The results seem to bias towards "tech cities" (e.g., Mountain View, Cupertino, Seattle, Redmond) with the largest savings in Foster City, CA at $2,700 per year if you sign your lease in the right month. We can look at the seasonality plots to find those "magic" months for a few representative cities.

Image by Author
Image by Author
Image by Author
Image by Author
Image by Author
Image by Author

In Mountain View, Forster City and Redmond, signing your apartment lease in June or July will cost you $100 to $225 more per month than if you wait 6 months and sign in November or December. Timing things correctly can put $1,200 to $2,700 more in your pocket per year in the 26 cities listed above. If you ever see a student ask "When am I going to use this stuff in real life?" while complaining amount his or her math class, show them this article!

If you want to look at example R code and better understand the STL algorithm, take a look at my earlier article. But if you want to read something a little less technical, I recommend my article on best practices for prioritizing analytical work. If you are a bit more statistically curious today, try [[this article](https://towardsdatascience.com/better-communications-between-data-scientists-and-business-users-46f493ce24ba)](https://towardsdatascience.com/the-three-most-important-statistical-tests-in-business-analytics-fd958a8e2a90) about A/B testing or this article about the three (3) most important statistical tests. Finally, if you want a very fast 1–2 minute read, try this article on eight (8) tips for improving communications between Data Science and business users.


Related Articles