Researchers have long known that weather has a profound physiological impact.
The human body reacts to sunlight by producing serotonin, a neurotransmitter that is strongly linked with feelings of well-being.
Some people are more likely to be depressed during winter, a condition known as seasonal affective disorder or SAD, according to MIT Technology Review.
But despite this evidence, psychologists have long failed to find a clear correlation between weather and mood.
Also Read
Some moods are clearly correlated with certain types of weather or changes in the weather but sometimes in counterintuitive ways.
Researchers began with a database of tweets geotagged to one of 32 major urban areas in the US, such as New York, Chicago, Los Angeles and San Franciso.
They categorised these tweets according to four different mood dimensions: anger-hostility, fatigue-inertia, depression-dejection and sleepiness-freshness.
They used a machine learning algorithm to find correlations with the weather in these areas.
"People tend to be happier as temperature becomes cooler but feel uncomfortable with drastic temperature decrease," they said.
Higher temperatures also make people angrier. Snow, on the other hand, is correlated with negative moods.
Li and colleagues also found that most moods follow a weekly pattern with peaks at the weekend.