A large number of people have been flocking to unhappy cities like Detroit and Cleveland despite their financial woes. But why?

A new paper published by Harvard Kennedy School Professor Edward Glaeser explained that lower cost of living in these declining cities is drawing scores of American citizens to them.

For the study, the experts analyzed happiness across several metropolitan areas in the country using a national survey conducted by CDC. They also sourced data from the Behavioral Risk Factor Surveillance System (BRFSS), to account for satisfaction levels. They arrived at the conclusion after controlling for income, employment, age and other demographic factors.

Published by the National Bureau for Economic Research, the study found that "places with lower levels of population and income growth are less happy." It also found that people like to go to "warm places."

But then why are people moving to the sad cities? Apparently, the high price in the happier places is driving them to cheaper areas - the unhappy regions.

The researchers added that people don't make their decisions based on happiness entirely. Other economic factors come into play too. They explained that residents of an unhappy city receive higher real wages, which compensates for their misery. Plus, since there is no real measure for happiness, this could be tricky thing.

"An alternative view is that humans are quite understandably willing to sacrifice both happiness and life satisfaction if the price is right. ... Indeed, the residents of unhappier metropolitan areas today do receive higher real wages-presumably as compensation for their misery," the authors wrote in the report.

Home prices in the United States have been increasing across cities. In May, the median asking price of a home was $214,900 across board, which is an 8 percent year-on-year increase, according to the May 2014 National Housing Trend Report by Realtor.com.

Another latest report released by Reis Inc., a New York-based real estate research firm, revealed that average asking rents in the second quarter rose to $1,099, up 0.8 percent from the first quarter of 2014.

Also with more people resorting to rent rather than to buy, the sadder cities have become the respite.

Citylab has a map of cities that have been rated on the basis of happiness by the researchers. The study found that Charlottesville, Rochester, Naples and Flagstaff are among the happiest of the cities while Scranton and Erie, Indiana and Detroit were the saddest cities.