# Using Linear Regression to Predict Weather Patterns

Weather is important for most aspects of human life.  Predicting weather is very useful.  Humans have attempted to make predictions about the weather, many early religions used gods to explain the weather.  Only relatively recently have humans developed reasonably accurate weather predictions.  I decided to collect weather data and measured the accuracy of predictions made using linear regression.

I collected data from www.wunderground.com.  I found many measurements every day for decades from several locations within the USA.  I collected the following observations:

• Temperature - the measure of warmth or coldness
• Humidity - the amount of moisture in the atmosphere
• Precipitation - the amount of moisture (usually rain or snow) which falls on the ground
• Wind Speed -  the speed at which air flows through the environment
• Pressure - the force the atmosphere applies on the environment

I collected multiple readings of these observations for each day from 1986-2016 in the following locations: Alaska, Chicago, San Francisco, Miami, New York City, Washington, DC, and Los Angeles.  The data collection was complicated because the rows in tables weren't uniform, some measurements were missing or had units inconsistently and some values varied between numbers and strings.

After collecting the data, I created a Shiny Application to analyze patterns between weather observations.  It is available  https://robinganemccalla.shinyapps.io/robinsweatherproject/.  For any location and pair of weather observations (including time) the Application will automatically display a scatterplot of all the data with a regression line and a regression analysis of how well the first observation predicted the second observation.  In addition, the Application automatically displays a multi-variate regression for the y-axis, using every other observation to predict the observation on the y-axis.

After comparing all of the observation combinations, I did not find many strong patterns.  Most R-squared values for single variable linear equation were below 0.1 and many were even lower than that.  Some patterns existed in some locations but were reversed in others.  For example, in Los Angeles, New York City, Miami and Washington, DC temperatures rose as humidity rose.  But in Alaska, Chicago and San Francisco the opposite was true.

Even when all variables were used, the R-Squared values were seldom over 0.5.  And there was not consistency of weather patterns between location.  The two variables which were more consistently predicted were humidity and wind speed.  This could be because they are least effected by external weather and variables I did not collect.

Professional weather forecasters are not perfect, but their predictions are typically more accurate than those of this linear regression model.  This implies that weather is a non-linear system.  Additionally, my predictions were all based on data from one location as opposed to multiple locations that most forecasters use.  Though my model is imperfect, it does describe limitation of linear regression on predicting weather.

### Robin Gane-McCalla

Robin Gane-McCalla graduated from Hamilton College with a degree in Mathematics and Computer Science. He's worked as a computer programmer, data analyst, researcher and web developer. After working for several companies (including a few start ups) he's decided...

## Leave Responses

mlgjbvzhw qcssr kilhoxt kihb numsbhfefrwxstv
Http://www.ucgbc.org/ November 7, 2017
Skype has opened its web-based buyer beta on the entire world, soon after introducing it broadly inside the United states and U.K. earlier this month. Skype for Online also now facilitates Linux and Chromebook for immediate text messaging interaction (no voice and video nevertheless, all those need a connect-in set up). The expansion of the beta adds help for a longer listing of different languages to assist strengthen that worldwide functionality
Janelle July 20, 2017
Thanks to the terrific manual
Rocky July 17, 2017
I enjoy the article
Jennie July 5, 2017
Thanks for the excellent article
Susie July 5, 2017
Thanks to the excellent guide
Angela July 5, 2017
I spent a lot of time to locate something like this
Selene June 30, 2017
I spent a great deal of time to locate something similar to this
Www.T.Com June 30, 2017
Skype has opened up its internet-based buyer beta to the world, right after introducing it broadly from the Usa and You.K. before this 30 days. Skype for Web also now supports Chromebook and Linux for immediate online messaging conversation (no video and voice but, these call for a connect-in set up). The increase of your beta provides assist for a longer selection of languages to help bolster that global user friendliness
www.t.Com June 28, 2017
Skype has established its website-centered consumer beta for the entire world, after establishing it generally in the U.S. and U.K. earlier this calendar month. Skype for Internet also now works with Linux and Chromebook for instant text messaging conversation (no video and voice however, all those call for a plug-in installation). The increase of the beta provides assist for an extended listing of spoken languages to help you bolster that overseas usability
bvlgari serpenti watch yellow gold imitation June 22, 2017
hola yo no quiero usar Spotbros mi cuenta ahora y quiero borrar mi cuenta y todas las cuentas Spotbros últimos Quiero eliminar mi cuenta bvlgari serpenti watch yellow gold imitation http://www.buywatchandjewelry.cn/cheap-fake-bvlgari-serpenti-tubogas-watch-pink-gold-single-helix-bracelet-spp35bgdg2t-p62.html
smartphone lifestyle review June 12, 2017
Hello it's me, I am also visiting this site daily, this website is truly good and the visitors are in fact sharing good thoughts.
bague cartier diamant occasion replique June 1, 2017
Undeniably believe that which you said. Your favorite justification seemed to be on the web the easiest thing to be aware of. I say to you, I definitely get irked while people think about worries that they plainly do not know about. You managed to hit the nail upon the top and defined out the whole thing without having side-effects , people could take a signal. Will likely be back to get more. Thanks bague cartier diamant occasion replique http://www.bijouxpascher.net/
masters in education May 26, 2017
I am regular visitor, how are you everybody? This piece of writing posted at this website is in fact nice.
online learning May 24, 2017
When I initially commented I clicked the "Notify me when new comments are added" checkbox and now each time a comment is added I get several emails with the same comment. Is there any way you can remove me from that service? Many thanks!
online education degrees May 23, 2017
I was suggested this website by my cousin. I am not sure whether this post is written by him as nobody else know such detailed about my difficulty. You're incredible! Thanks!
online courses May 22, 2017
Hi there, its nice article about media print, we all be familiar with media is a fantastic source of facts.
homeschooling May 21, 2017
It's difficult to find well-informed people in this particular topic, however, you seem like you know what you're talking about! Thanks