Housing markets seemed to have turned a corner, with Tuesday’s Case-Shiller data adding to the optimism. Home prices have risen for a second consecutive month for the first time since the summer of 2010, but much of this is a consequence of the falling percentage of distressed sales, while prices are still more than 31% of their peaks and may take years to recover. With 11.4 million, or 23.7%, of all residential properties with a mortgage under water, and a shadow inventory worth $246 billion, according to CoreLogic, a true housing recovery is far away.

Tuesday’s Case-Shiller release, with data through June 2012, showed home prices continuing to recover. Both the 10- and 20-city composites finally recorded annual gains (0.1% and 0.5% respectively), prompting index Chairman David Blitzer to say:

We seem to be witnessing exactly what we needed for a sustained recovery; monthly increases coupled with improving annual rates of change. The market may have finally turned around.

The report was met with optimism, as it came after improved existing and new home sales, which Wells Fargo’s analysts suggest indicate markets may be “bottoming in July.” Morgan Stanley/Smith Barney’s people also acknowledged the “improving U.S.-housing fundamentals,” while Barclays’ research team now expects home prices to rise 3% on an annual basis in 2012.

There are several reasons to remain skeptical, though, that this recovery will both be swift and will fuel economic growth that will help pull the U.S. farther from the edge of a new recession. Goldman’s economics research team understands that much of the improvement in housing markets can be attributed to a fall in the percentage of distressed transactions, which accounted for 50% of sales in 2009 and has now fallen to 25%. (Read Steve Schaefer's piece, Why The U.S. Housing Recovery May Be Due For A Stumble for more on this).

The typical foreclosure discount is on the order of 27%, according to John Campbell, chair of Harvard University's economics department. Thus, a falling percentage of distressed sales mean a lower percentage of discounted transactions. The number of distressed sales also affects the size of the foreclosure discount, which in May was reported to be about 20%, according to Goldman. A falling rate of distressed sales provides a double-whammy then, reducing the discount and the number of discounted transactions.

While the number of distressed sales vis-à-vis regular sales has fallen quite dramatically since March 2009, its decline was more moderate from May 2011 to May 2012, when it went from 31% to 25%. The historical average, though, is far away, at about 5%. While Goldman expects the percentage of distressed sales to slowly tend toward this average, they understand this could take many years:

In our view, returning to a more normal proportion of distressed sales will take several years, given the large number of borrowers with negative equity, the large current delinquency and foreclosure inventory, and the long current foreclosure timelines.

As mentioned previously, the most recent data on underwater mortgages shows that nearly a fourth of all residential properties with a mortgage are underwater. That’s 11.4 million as of the end of the first quarter. At the same time, financial institutions including big banks with exposure to the mortgage business like Bank of America, JPMorgan Chase, and Citigroup are sitting on a shadow inventory of 1.5 million units, or four months supply. Worth $246 billion, the shadow inventory will certainly weigh on lending and economic conditions going forward.

Still, the rate of distressed sales is falling. Goldman estimates that if the revision to the 5% historical average happens over the next two years (which is highly unlikely), this would contribute 2% annual growth to home prices; if it happens over four years, they expect a 1% yearly contribution from this effect. It's important to bear in mind that this isn't a one-way move, either. Regulation (such as the robo-signing sparked foreclosure moratorium) has helped to slow distressed sales, while vast number of underwater mortgages and size of the shadow inventory suggests housing markets can face a sudden increase in the number of distressed properties. It will be a bumpy ride for residential real estate.

Housing markets are no longer in free fall, even though there are risks to the outlook. But analysts are turning more bullish. Investors should remain cautious, but should expect prices to very gradually firm going forward. They must note, though, that the market is still more than 30% off its peak, and the rate of distressed properties, while substantially lower than in 2009, is still far above the historical average.