The Federal Reserve may not be currently forecasting a recession, but sooner or later the U.S. economy’s fortunes will take a turn for the worse. And when that happens, home owners in Rochester, N.Y., can rest easy.

A new study from Redfin ranked Rochester as the city least at risk of a housing downturn during the next recession. Redfin RDFN, +2.36% computed the downturn risk for the 50 largest cities across the country using the following metrics:

• The ratio of the median home sale price to household income

• Average loan-to-value ratio of homes sold in 2018

• Home-price volatility based on the year-to-year standard deviation

• Share of home sales that are flips, i.e. sold twice within 12 months at a different price

• Diversity of local employment based on the likelihood that two randomly selected workers are in the same field

• Share of the local economy dependent on exports

• Share of local households headed by someone 65 or older

These factors were all weighted differently, based on how likely each attribute was to contribute to a real-estate-market downturn, to produce an overall score.

Rochester had the lowest score of any city studied at 30.4%, followed by Buffalo, N.Y. (31.9%), and Hartford, Conn. (33.9%). Overall, the top 10 cities that were least likely to see a recession-fueled housing downturn were all located east of the Mississippi River.

Rank Metro area Average home loan-to-value ratio Home price volatility Flips share of sales Exports share of GDP Overall score 1 Riverside, Calif. 65.3% 17.9% 6.3% 5.6% 72.8% 2 Phoenix 64.8% 17.7% 8.1% 5.4% 69.8% 3 Miami 50.4% 15.2% 7.5% 10.1% 69.5% 4 San Diego 65.6% 16.9% 5.9% 8.0% 68.2% 5 Providence, R.I. 70.6% 16.8% 4.4% 8.6% 67.1% 6 Tampa, Fla. 59.2% 17.1% 7.5% 4.3% 66.8% 7 Las Vegas 61.0% 16.7% 8.3% 2.4% 64.6% 8 Los Angeles 62.6% 15.7% 7.7% 6.1% 63.7% 9 San Antonio, Texas N/A 15.7% 5.8% 7.1% 63.2% 10 Orlando, Fla. 61.2% 16.0% 6.1% 2.4% 59.1%

At the other end of the spectrum, Riverside, Calif., faces the highest risk of a housing downturn with a score of 72.8%, followed by Phoenix (69.8%) and Miami (69.5%), according to Redfin. Most of the high-risk cities were clustered in California and in the Sun Belt, with the exception of Providence, R.I., which ranked as the fifth riskiest city on Redfin’s list.

Read more:Investors could get a great deal on real estate in Opportunity Zones — and that could be a problem

A number of factors separate cities like Rochester from Riverside. For starters, most of the high-risk cities are located in parts of the country that were hardest hit by the Great Recession. These areas have more volatile home prices than other regions.

A few factors contribute to that volatility, according to Redfin. These markets tend to attract more home flippers looking to turn a quick profit. Overall, the higher amount of investor activity in these cities drives home prices up. That forces homeowners to take out larger loans to buy property.

And so when recessions hit the local economies of these cities and cause job cuts, the larger loan amounts can represent an even more substantial burden for households that have experienced a loss of income. Many of these home owners will then default on their debt, and the resulting foreclosures will exert downward pressure on home prices across these markets.

Another factor Redfin considered was each city’s exposure to the export market. Because the upcoming recession would likely be caused by the ongoing trade war between the U.S. and China, Redfin surmised, local economies that are more dependent on global trade could be affected more by the overall economy’s downturn.

The good news for all property owners across the rest of the country is that the next recession won’t be fueled by the housing market itself, unlike the last one, Redfin’s report concluded.

“Home prices are high right now, but they’re high because there’s not enough supply to meet demand, which means there’s not a bubble at risk of bursting,” Redfin’s chief economist, Daryl Fairweather, said in the report. “Most of today’s financed homeowners have excellent credit and a cushion of home equity, making them unlikely to default on their mortgage.”

The Great Recession was something of an anomaly in terms of the major impact it had on home prices. Previous recessions produced much smaller changes to home prices — in the case of the recession sparked by the dot-com bubble, home prices actually rose.