Bank of America Merrill Lynch  revised its housing forecast upward due to a better alignment of supply and demand, and now predicts the S&P/Case-Shiller Index will increase by 5% in the fourth quarter over 4Q 2011.

That translates into an average price gain of 2.1% this year compared to 2011.

In August, BofA analysts predicted prices would rise 2% in the fourth quarter over the year-ago quarter. That was also a revision upward. In March, BofA Merrill Lynch forecasted the bottom in national home prices. However, it underestimated the magnitude of the turn.

The analysts also expect average home price appreciation of 3.3% a year over the next 10 years, a cumulative gain of about 36%.

BofA still expects home prices to slow down into the end of the year.

"It is important to remember that the housing market is subject to volatility in the best of times; in this distorted market, we cannot expect a smooth pattern," the research note said.

It predicts that national prices will increase 5.6% quarter-over-quarter in the third quarter of 2012, following a 9.3% gain in the second quarter. It predicts flat prices in the fourth quarter of this year as well as a decline of 1.6% in the first quarter of 2013 before prices begin to trend upward.

The main component driving the forecasted increase in home prices is a better alignment of housing supply and demand. Inventory of homes for sale continues to decline because of pickup in house demand, a slow clearing rate for distressed properties and a significantly below normal pace of new home construction.

Sales of REOs were at the lowest pace in August since 2008, which reflects a shift toward short sales.

To view the decline in supply of exisiting and new homes for sale click on the chart. 

Analysts said the two most important variables for short-term price dynamics are months supply and change in distressed share. They predict that the decline of months supply will continue to edge lower in 2013, which will underpin home prices. Share of distressed sales should return to 23.7% by 3Q, compared to the current share of 20.5%. 

There are also many differences on a regional basis, which can be attributed to the way foreclosures are cleared in different states.

For example, year-over-year prices are up 7% in Michigan, compared to year-over-year falling prices in Illinois of 2.3%.