Not all luxury homes are in overheated markets. Surprising value can be found in 10 U.S. metropolises.

Opportunity is knocking on the doors of real estate investors brave enough to sink money into residential housing in Stamford, Conn.; Allentown, Pa.; Bakersfield, Calif.; and Detroit. These metropolitan areas, in addition to several others like Boston and Chicago (see table below), are where you will find the most undervalued residential real estate in the country.

In Stamford, Conn., 43 miles north of New York City, a Tudor-style four-bedroom home on Long Island Sound with 200-degree views of the water has been languishing on the market for more than a year. That’s even after several price reductions. The 5,671-square-foot waterfront home, offered by real estate broker Douglas Elliman, dates from the turn of the 20th century and is currently listed at $3.39 million. That’s down from the $4.8 million asking price when it hit the market in April 2015, says Douglas Elliman’s Joelle Bentley, the agent representing the property.

This waterfront home was perhaps mispriced at the start—creating knock-on problems—but it is also, not insignificantly, located in the second-most undervalued catchment in the U.S., after top-ranked Allentown, Pa.

And that’s a buying opportunity for the smart investor.

LAST YEAR, Collateral Analytics—a Hawaii-based real estate valuation firm that provides data to mortgage-lending officers across the nation—helped Penta identify the most-overheated markets in the country. (See “Real Estate: Top 10 Most Overvalued Cities,” May 16.) This time around, we asked the firm the inverse question: Which real estate markets are beaten down but with local economic revivals that suggest they might be smart places for investors to buy residential properties?

Collateral Analytics surveyed 1,405 metropolitan catchment areas on our behalf. The top 10 metro regions on our table are the most undervalued in the country, due to their low, often negative, “predictive indicator.” That measure takes the median price of single-family homes sold in each area, then divides that figure by the region’s “intrinsic” economic value, determined by median incomes and other local economic factors. The resulting indicator suggests where the country’s most desirable and affordable housing is located, based on local levels of wealth.

Additionally, to identify those pockets where low-cost housing is also attracting new employers to the area, we asked Collateral to factor into their calculations a region’s predicted job growth over the next three years, according to estimates provided by Moody’s Analytics Economy.com.

Atlantic City, N.J., for example, was eliminated in this way from our most undervalued list. While its residential real estate has an attractive predictive indicator of negative 9.15%—making it look like a great buy—Moody’s is also figuring that Atlantic City is going to lose 4.2% of its jobs in the next few years.

Conversely, based on the steady drumbeat of bad news coming out of Detroit, most investors would probably never consider investing in the Motor City. That would be a big mistake. The city that emerged from bankruptcy only two years ago appears to be on the rebound. More than one in three Detroit properties were foreclosed on, due to mortgage defaults or unpaid taxes, from 2005 through 2014, according to the Detroit News. Today, however, Detroit’s median price to intrinsic value ratio suggests that it is seriously undervalued, and, more importantly, after all of that creative destruction, it has a far brighter economic future. The Detroit metropolitan area is, in fact, expected to increase jobs by nearly 5% over the next three years.

Low-cost housing, coupled with an increase in the number of local jobs, makes for a promising combination for the real estate investor. This is not just theory at work. According to Realcomp, a multiple listing service in Michigan, the inventory of homes for sale in metro Detroit has fallen 14% from January 2013 through May 2016, while the median sale price has risen to $165,000 from $80,000 during the same period. Detroit, in other words, has bottomed out, and the local housing market is tightening.

So-called real estate–owned properties—properties still owned by a lender when a foreclosed home fails to sell at auction—have had a significant impact on most of the undervalued markets in our table, says Michael Sklarz, chief executive of Collateral Analytics. “While there are fewer in nearly all markets compared with the past several years, real estate–owned sales have pushed prices down to the levels where they are at,” he explains. That’s logical: When even the real estate professionals can’t unload foreclosed properties at knocked-down prices, a shiver of fear runs through the entire market. But life isn’t static. The key is spotting that moment when foreclosure prices start heading back up again—as recently happened in Chicago.

Chicago, also included on our most undervalued list, suffered one of the largest number of mortgage foreclosures in the nation between 2004 and 2015. Now it, too, appears to be bouncing back. According to real estate trade association Illinois Realtors, in May 2016, the median price of homes in Chicago was 6.1% higher, with 7.5% more homes sold compared with May 2015.

What’s up? Some of the growth in Chicago was generated by rapid increases in the prices of foreclosed properties, claims Geoffrey J.D. Hewings, director of the Regional Economics Applications Laboratory at the University of Illinois. In other words, key trend figures to keep an eye on, if you are bottom-fishing, are the prices that foreclosures are demanding—or not, as might be the case.

What about the housing market overall? According to Collateral Analytics, it is overvalued by 5% over the past 12 months, compared with the 4% we reported last year. Historically, it is undervalued by 2%, based on the past five years’ figures, and by 1.4%, if you look at prices over the past 30 years.

Not terribly alarming, one way or another. But could the undervalued markets we have identified fall further? Unlikely, says Sklarz, who predicts, at worse, that “prices will continue to move sideways, while the intrinsic value price continues to increase along with rising employment and household incomes.” His caveat: “A dramatic correction for an undervalued market would only happen if there is a significant fundamental event in a particular market, such as a major employer leaving or going out of business.”

If that’s the case, then the investor is in trouble. But we never said this was an easy way to make a living. What we are saying is that, in a low-yield environment, brave investors have the potential to make double-digit returns in corners of the housing market that many others have overlooked.