NYC Data Science Academy| Blog
Bootcamps
Lifetime Job Support Available Financing Available
Bootcamps
Data Science with Machine Learning Flagship ๐Ÿ† Data Analytics Bootcamp Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lesson
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories Testimonials Alumni Directory Alumni Exclusive Study Program
Courses
View Bundled Courses
Financing Available
Bootcamp Prep Popular ๐Ÿ”ฅ Data Science Mastery Data Science Launchpad with Python View AI Courses Generative AI for Everyone New ๐ŸŽ‰ Generative AI for Finance New ๐ŸŽ‰ Generative AI for Marketing New ๐ŸŽ‰
Bundle Up
Learn More and Save More
Combination of data science courses.
View Data Science Courses
Beginner
Introductory Python
Intermediate
Data Science Python: Data Analysis and Visualization Popular ๐Ÿ”ฅ Data Science R: Data Analysis and Visualization
Advanced
Data Science Python: Machine Learning Popular ๐Ÿ”ฅ Data Science R: Machine Learning Designing and Implementing Production MLOps New ๐ŸŽ‰ Natural Language Processing for Production (NLP) New ๐ŸŽ‰
Find Inspiration
Get Course Recommendation Must Try ๐Ÿ’Ž An Ultimate Guide to Become a Data Scientist
For Companies
For Companies
Corporate Offerings Hiring Partners Candidate Portfolio Hire Our Graduates
Students Work
Students Work
All Posts Capstone Data Visualization Machine Learning Python Projects R Projects
Tutorials
About
About
About Us Accreditation Contact Us Join Us FAQ Webinars Subscription An Ultimate Guide to
Become a Data Scientist
    Login
NYC Data Science Acedemy
Bootcamps
Courses
Students Work
About
Bootcamps
Bootcamps
Data Science with Machine Learning Flagship
Data Analytics Bootcamp
Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lessons
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook
Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories
Testimonials
Alumni Directory
Alumni Exclusive Study Program
Courses
Bundles
financing available
View All Bundles
Bootcamp Prep
Data Science Mastery
Data Science Launchpad with Python NEW!
View AI Courses
Generative AI for Everyone
Generative AI for Finance
Generative AI for Marketing
View Data Science Courses
View All Professional Development Courses
Beginner
Introductory Python
Intermediate
Python: Data Analysis and Visualization
R: Data Analysis and Visualization
Advanced
Python: Machine Learning
R: Machine Learning
Designing and Implementing Production MLOps
Natural Language Processing for Production (NLP)
For Companies
Corporate Offerings
Hiring Partners
Candidate Portfolio
Hire Our Graduates
Students Work
All Posts
Capstone
Data Visualization
Machine Learning
Python Projects
R Projects
About
Accreditation
About Us
Contact Us
Join Us
FAQ
Webinars
Subscription
An Ultimate Guide to Become a Data Scientist
Tutorials
Data Analytics
  • Learn Pandas
  • Learn NumPy
  • Learn SciPy
  • Learn Matplotlib
Machine Learning
  • Boosting
  • Random Forest
  • Linear Regression
  • Decision Tree
  • PCA
Interview by Companies
  • JPMC
  • Google
  • Facebook
Artificial Intelligence
  • Learn Generative AI
  • Learn ChatGPT-3.5
  • Learn ChatGPT-4
  • Learn Google Bard
Coding
  • Learn Python
  • Learn SQL
  • Learn MySQL
  • Learn NoSQL
  • Learn PySpark
  • Learn PyTorch
Interview Questions
  • Python Hard
  • R Easy
  • R Hard
  • SQL Easy
  • SQL Hard
  • Python Easy
Data Science Blog > Data Visualization > From Visualizing NYC 2017 House Sales Data To Postulating Its Thermodynamics Theory

From Visualizing NYC 2017 House Sales Data To Postulating Its Thermodynamics Theory

James Chen
Posted on Feb 6, 2018

This project aims to (1) visualize the patterns of NYC 2017 house sales in each of the five boroughs, (2) put forth some preliminary postulates to explain the patterns. I focused on the patterns of transaction volumes (i.e., how many houses sold) and house prices, with respect to location and time. I chose this topic because the scope is focused and the data set is relatively clean. Also, there was a personal reason: I bought a house last year (2017) in Staten Island. After going through the whole process (looking for a house in the right location, putting in bids, applying for the mortgage, and finally closing the deal), I became interested in learning NYC's real estate patterns since then. I feel maybe I can talk about something specific and interesting to house sellers/buyers.

1. Data Source and Pre-Processing

The raw data set is NYC Department of Finance's 2017 property sales records (locations/building years/square-footages/sales dates/prices/etc.). It consists of five files corresponding to the five boroughs of NYC: Manhattan, Bronx, Brooklyn, Queens and Staten Island. For raw data, see

http://www1.nyc.gov/site/finance/taxes/property-rolling-sales-data.page

To simplify analysis, we concentrated on two quantities: transaction volumes (henceforth shortened as "volume") and prices, with all other information (such as buildings' ages, square-footages, etc.) not considered. Also, for practical consideration, all transaction records with dollar amount less than $100,000 were filtered out for this project. Finally, analysis for each borough is based on the study of all zip-code areas in each one.

Some summary results appear in the following graph. Left: transaction volumes by borough; Right: median house prices by borough.

2. Data Transformation: Borough-wise Normalization

We now move to the next level, to find more interesting or fundamental patterns. But before that, we perform such data transformation: Borough-wise Normalization. It is a term coined by the author of this project, and is no different than the usual normalization in statistics (i.e. calculating z-scores). We spell out its context (i.e., borough-wise) to remind how the normalization should be done. Say we want to normalize a particular zip-code area's January house sales volume, and say the zip code is 10305 โˆˆ Staten Island, we normalize it with respect to the average level ฮผ and standard deviation ฯƒ of house sales volume in Staten Island in January. Note that we normalize with appropriate borough-wise values. Similarly, we normalize house prices borough-wise. Further data visualization and analysis are based on the borough-wise normalized volumes and prices. For more algorithm-like description (so that interested readers can implement them with programs), see the following linked notes which I wrote for this project:

https://github.com/jamesczq/ShinyApp_NYC_17_House_Sales/blob/master/jamesczq_proj1.pdf

Why do we want such normalizations? The reason is both practical and philosophical. Practically, it makes the pattern sharper (hence easier to identify a pattern). Philosophically, as everything is relative, we need to put a quantity in a most appropriate context. When you claim that a certain zip-code area (e.g. 10305 โˆˆ Staten Island) appears active in terms of house sales volume, you claim so not because you compared it with other boroughs but with the relevant borough-wise average (Staten Island in this case). When you claim a zip-code area (e.g. 11234 โˆˆ Brooklyn) appears to be competitive in terms of house prices, you didn't compare it with Manhattan's price level but with the relevant borough-wise average (Brooklyn in this case).

Below are two visualization examples that use heat maps to show the transaction activity patterns; the heat intensity is set to be proportional to normalized house sales volumes. The heat dots are plotted per zip-code in a borough. The more intense a red dot, the more transactions occurred in that zip-code. Please note that a zero heat-intensity does NOT mean no house sold in that zip-code; it just means the volume sold there was at the boroughโ€™s average level (recall that we are plotting the normalized volumes, not the volumes themselves). Likewise, a green dot indicates a zip-code area has below-average house sales volume.

Example 1. Transaction Activity Pattern in Queens: May versus June, 2017.

In this example, some of the most eye-catching patterns include: (1) In both May and June 2017, there is a dominant red dot (highly active in transactions) in the neighborhood of Flushing, Queens, where MTA 7-Trains end and the largest Asian populations in NYC reside. (2) In May, a constellation of red dots led from Flushing to Elmhurst, Queens, each of which corresponds to a major 7-Train stop; however, those red dots became green (below-average) in June. (3) The opposite process occurred in the neighborhood to the west of Forest Hills and to the east of Meadow/Willow Lakes: both changed from green to red from May to June.

The above observations may or may not be surprising depending on an observerโ€™s familiarity with Queensโ€™ housing market. You can explore the Shiny App I developed to discover โ€œsurprisingโ€ findings by playing with Month and Borough choices. The Shiny App can be accessed by the following link:

https://jamesczq.shinyapps.io/NYC_House_Sales_2017/

The potential business point is that identifying this activity pattern may be useful for buyers or sellers or real estate developers. For example, assuming this kind of pattern will be the same in 2018, if I anticipate buying a house in between Flushing and Elmhurst and hope to get the business done around May, I could expect more transactions in May and less in June. Sound business decision may be further made. For example, buyers may think about should they avoid high activity time so that they will not have to compete with other bidding buyers and pay more than a house's actual value. 

Example 2. Transaction Activity Pattern in Staten Island: July versus December, 2017.

As a resident of Staten Island, I find the patterns in this example make a lot sense. (1) Notice the neighborhood right near the Verrazano bridge (the Arrochar neighborhood, east end of Island and at the last exit of cross-Island highway I-278), which appears to have at- or below-average transaction volumes. That's where my house is, so I can confirm that nearly no one in this neighborhood was selling properties. To use this information to make better business decisions, you would want to first answer the question: is property investment in a low-transaction neighborhood wise or not? As for most things, that depends. If such a neighborhood experiences low sales volume due to, say, high crime rate, it is wiser not to invest there. But a low transaction volume could also be a sign that not many residents want to sell because they're happy in the neighborhood. In such cases, whenever you have the opportunity to buy in at a reasonable price, you probably should do so. (2) You can clearly see the neighborhood in the Islandโ€™s belly (the New Dorp neighborhood) changed from red-hot to green-cool from mid-year to year-end. The reason is this: One of the best high schools in Staten Island is in that neighborhood. At the end of spring semesters (from May to July), families move in and out which is typical at the end of an academic year; but such activity is muted at the end of fall semesters (winter time). Say if you want to invest in properties in New Dorp and you are in no hurry, it is more advisable to buy in during winter than spring, since you may compete with more bidding buyers in the spring but less so in the winter. On the other hand, if you are house sellers, it may be more profitable to sell properties in spring.

Now that I am an Islander so I know local things. But for an outside investors (from Brooklyn, Long Island, or even further) who may not be familiar with Island affairs and who may not have time/energy to travel here to survey, this transaction activity pattern can provide valuable intelligence to help make sound business decisions.  

3. Further Observations Part I: Overall Time Behavior of Transaction Volumes

It is a little surprising to find there seems to be a periodic oscillation in transaction volumes for each borough, and the oscillations occur with the same frequency. See the following plot:

To go beyond visual inspection, we can look at the Fourier transform of the data (or equivalently the time-autocorrelation). A preliminary result looks like the following plot, which suggests some periodicity exists.

But I have to say the conclusion is not robust yet. First, I have not carefully conducted the discrete Fourier transform. For example, the discrete Fourier transform was done with Fast Fourier Transform (FFT). But how many points in the FFT should I use, given 12 data points in time to be certain, so that I am not over-sampling or under-sampling? Second, a more rigorous examination of periodicity should take into account more data in time, say, data merged from 2016, 2015, etc.

4. Further Observations Part II: Overall Spatial Behavior of House Prices

So far, we have not discussed about the house prices yet. Now let us examine the prices. Below are density plots of the distributions of the normalized prices in five boroughs, aggregated over 2017.

Actually, the more in-depth thought of this project stems from observing the above distributions. Let me save a long-winded description, but directly point out to the following observation. The five distributions seem to come from the same family of a particular kind, such that it grows at the beginning like a polynomial (linearly, quadratically, etc.) but then after certain point decays at least exponentially. In thermodynamics, we see this kind of behaviors from the Maxwell-Boltzmann distribution for velocities of ideal gases, or the Planckโ€™s blackbody radiation law relating radiation power density (per wavelength) to wavelength (essentially 1/momentum of photons) of โ€œgasesโ€ of photons. The real power is that even though those models only take one underlying parameter, that is, temperature (no one hundred features!), they can make predictions about macroscopic properties associated with seemingly complicated random motions very well. We always desire models that work well and are simple enough but not simpler.

The following plot illustrates the analogy between distributions of normalized house prices at different locations (different boroughs) and distributions of radiation power densities at different temperatures. For clarity, we only plot Manhattanโ€™s price distribution to compare with the radiation power density distributions. It is clear that the role played by location in determining price distributions parallels the role played by temperature in determining radiation power density distributions. This confirms an old saying about the three things that matter most in real estate business are โ€œlocation, location, location.โ€ In this preliminary examination, we had not fitted the price distribution curves with the functional form taken by radiation power density distributions. But that is not difficult to do should we choose to do it, since we now know exactly what functional form we want to fit.

We further postulate the following correspondence relations between real estate business and thermodynamics. Since not everyone is familiar with thermodynamics, we will save the technical definitions.

Please note that correspondence is by no means equality! The correspondence relations just suggest what analogies can be drawn. (In fact, I suspect that price is technically analogous to 1/momentum, instead of momentum.)

If we can quantify temperature and entropy in real estate business, we may further quantify quantities such as free energy (maximum useful work a system can do under certain constraints), chemical potentials (โ€œenergyโ€ introduced per transaction, which may tell how transaction volumes influence price distribution), etc. Those may help understand the mechanism of real estate business better with a theoretical framework from thermodynamics to guide our thinking. One more point: if the price distributions behave closely in the style of blackbody radiation or Maxwell-Boltzmann distribution, we should be happy, since it indicates that prices are determined by a free market. Why? If we go back to the original derivation of Planck's blackbody radiation law or Maxwell-Boltzmann distribution, be it gases of photons or ideal gases, the assumption is that the only interaction between particles is elastic collision and there is no other kind of interaction or external forcing. If there is some other kind of interaction or external forcing, the radiation will not be blackbody-like, nor will the velocities be distributed Maxwell-Boltzmann like. Therefore, analogously, if the house price โ€œradiationโ€ is Planck-like or Maxwell-Boltzmann like, it implies the underlying microscopic bidding/buying activities are elastic โ€œcollisions.โ€ That means that we'd see no loss of overall momenta\um after โ€œcollisionโ€ (bidding/buying) and no other kinds of interaction or outside forcing (large-scale organized speculations or price controlling, say). It provides some metric to monitor the healthiness of house market.

Ending remarks:

Why would Planck blackbody radiation be my first thought? Two years ago, when I was a math PhD student and had nothing better to do beside research, I took a course in introductory astrophysics. For the course project I was assigned to verify the current estimate of the minimum and maximum radius of the star Alpha Persei (the brightest star in constellation Perseus). Here we study the house price distributions from house sales data and hope to find the mechanism behind pricing. There and then we tried to find the radiation power density distribution (with respect to wavelength) from actual field observation. We know the mechanism (Planckโ€™s radiation law, at least approximately) and hope to establish a link between a starโ€™s radius with its observed radiation power density distribution via such mechanism. (The difference is that to study stars we did actual field work instead of โ€œdplyrโ€ing data sets, and the field work was to use a large telescope (see the picture to the left below) with a set of wavelength filters to capture and count photons of different wavelengths from a star.) The end conclusion was not surprising that we showed the current estimate of Alpha Perseiโ€™s radius was convincing (see the graph to the right below), but it left me a deep impression that how such a simple model (Planckโ€™s radiation law) could help us unlock "secret" messages sent from a star galaxies-far-away!

5. Future Improvement

This project is merely a preliminary examination of NYC real estate patterns. There are a number of possible improvements to apply in the future. They include the following: (1) The Shiny App can be made more sophisticated. (2) More historical data (i.e., not just 2017 Sales Records) can be taken into account in exploring the patterns. (3) The study can be refined to separate houses into finer categories: commercial use, residential apartments, residential one-family houses, residential two-family houses, etc. The lists for improvement can be endless, but, the goal is to discover patterns that are simple to understand and make use of.

About Author

James Chen

Trained in math and physics. Rarely thought one day he would do business analytics when he was in school (for example, in what universe would knowledge in complex variables or Fourier transform or electromagnetic theory or quantum mechanics...
View all posts by James Chen >

Related Articles

Capstone
Acquisition Due Dilligence Automation for Smaller Firms
Machine Learning
Beware of Feature Importance for Business Decisions
Meetup
Building a Safer Future
Python
Tech Layoffs: Exploring the Trends and Industry Shifts
Meetup
Analysis of Mass Shootings and Gun Ownership in the United States

Leave a Comment

Cancel reply

You must be logged in to post a comment.

No comments found.

View Posts by Categories

All Posts 2399 posts
AI 7 posts
AI Agent 2 posts
AI-based hotel recommendation 1 posts
AIForGood 1 posts
Alumni 60 posts
Animated Maps 1 posts
APIs 41 posts
Artificial Intelligence 2 posts
Artificial Intelligence 2 posts
AWS 13 posts
Banking 1 posts
Big Data 50 posts
Branch Analysis 1 posts
Capstone 206 posts
Career Education 7 posts
CLIP 1 posts
Community 72 posts
Congestion Zone 1 posts
Content Recommendation 1 posts
Cosine SImilarity 1 posts
Data Analysis 5 posts
Data Engineering 1 posts
Data Engineering 3 posts
Data Science 7 posts
Data Science News and Sharing 73 posts
Data Visualization 324 posts
Events 5 posts
Featured 37 posts
Function calling 1 posts
FutureTech 1 posts
Generative AI 5 posts
Hadoop 13 posts
Image Classification 1 posts
Innovation 2 posts
Kmeans Cluster 1 posts
LLM 6 posts
Machine Learning 364 posts
Marketing 1 posts
Meetup 144 posts
MLOPs 1 posts
Model Deployment 1 posts
Nagamas69 1 posts
NLP 1 posts
OpenAI 5 posts
OpenNYC Data 1 posts
pySpark 1 posts
Python 16 posts
Python 458 posts
Python data analysis 4 posts
Python Shiny 2 posts
R 404 posts
R Data Analysis 1 posts
R Shiny 560 posts
R Visualization 445 posts
RAG 1 posts
RoBERTa 1 posts
semantic rearch 2 posts
Spark 17 posts
SQL 1 posts
Streamlit 2 posts
Student Works 1687 posts
Tableau 12 posts
TensorFlow 3 posts
Traffic 1 posts
User Preference Modeling 1 posts
Vector database 2 posts
Web Scraping 483 posts
wukong138 1 posts

Our Recent Popular Posts

AI 4 AI: ChatGPT Unifies My Blog Posts
by Vinod Chugani
Dec 18, 2022
Meet Your Machine Learning Mentors: Kyle Gallatin
by Vivian Zhang
Nov 4, 2020
NICU Admissions and CCHD: Predicting Based on Data Analysis
by Paul Lee, Aron Berke, Bee Kim, Bettina Meier and Ira Villar
Jan 7, 2020

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day ChatGPT citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay football gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income industry Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI

NYC Data Science Academy

NYC Data Science Academy teaches data science, trains companies and their employees to better profit from data, excels at big data project consulting, and connects trained Data Scientists to our industry.

NYC Data Science Academy is licensed by New York State Education Department.

Get detailed curriculum information about our
amazing bootcamp!

Please enter a valid email address
Sign up completed. Thank you!

Offerings

  • HOME
  • DATA SCIENCE BOOTCAMP
  • ONLINE DATA SCIENCE BOOTCAMP
  • Professional Development Courses
  • CORPORATE OFFERINGS
  • HIRING PARTNERS
  • About

  • About Us
  • Alumni
  • Blog
  • FAQ
  • Contact Us
  • Refund Policy
  • Join Us
  • SOCIAL MEDIA

    ยฉ 2025 NYC Data Science Academy
    All rights reserved. | Site Map
    Privacy Policy | Terms of Service
    Bootcamp Application