A new theory published in Trends in Cognitive Sciences suggests that being moody can help people quickly adapt to changes in their environment, ABC News reported.

Researchers from the University College London revealed that as people learn from experiences that are colored by their mood, their expectations come to reflect not only the reward associated with each particular state, but also recent changes in the overall availability of reward in their environment. In this way, the existence of mood allows learning to account for the impact of general environmental factors.

"This effect of mood should be useful whenever different sources of reward are interconnected or possess an underlying momentum," Eran Eldar, one of the lead authors of the study, said in a statement. "That may often be the case in the natural as well as in the modern world, as successes in acquiring skills, material resources, social status, and even mating partners may all affect one another.

Eldar and his colleagues argue that mood draws on experiences and can, in fact, help people quickly adapt to changes in our environment. For example, experiencing unexpected gains on the stock market should improve a trader's mood. That positive mood may then cause the trader to take more risks, essentially helping her adapt more quickly to a market that is generally on the rise.

They noted that positive or negative moods maximize their usefulness by persisting only until expectations are fully in accordance with changes in rewards, BT reported.

"Because moods are ubiquitous and have significant impacts on our lives, it is likely that they have conferred a significant competitive advantage throughout the course of evolution. Being moody at times may be a small price to pay for the ability to adapt quickly when facing momentous environmental changes," they concluded.