Every day, Wall Street analysts upgrade some stocks, downgrade others, and "initiate coverage" on a few more. But do these analysts even know what they're talking about? Today, we're taking one high-profile Wall Street pick and putting it under the microscope...

Interest rates are rising, and that should be bad news for the housing market, with mortgage rates up more than half a point from January at 4.6%. And yet, despite both "high selling prices and low home inventory," reports The Wall Street Journal (subscription required), home sales are picking up. Citing a Commerce Department report, the Journal notes that from April to May, sales of new homes rose 6.7% sequentially -- and 14.1% year over year.

That's good news for investors in homebuilder KB Home (NYSE:KBH), which reported earnings yesterday and won a new upgrade on Wall Street this morning. But it's only part of the story.

Here's what you need to know.

Builders reading a blueprint

Image source: Getty Images.

KB Home reports earnings

Let's start with a review of what KB Home told investors last night. Releasing numbers that easily trumped analyst estimates, KB Home reported 10% sales growth to $1.1 billion in its fiscal Q2 2018, and a 73% increase in earnings per share to $0.57.

Adding color to those headline numbers, KB noted that its "deliveries" grew only half as rapidly as its revenue -- up 5%. Higher prices added another 4% to the revenue growth rate. Perhaps best of all, though, was the fact that KB's operating profit margin on that rising revenue surged 180 basis points higher -- up by more than a third from this time last year, to 6.8%.

The company was not free-cash-flow positive, but management noted that operating cash flow improved from negative $65 million a year ago, to negative $19 million in Q2 2018, despite ongoing efforts "to invest $2.4 billion in land and development ... to drive growth" in future years.

KB Home earns upgrade

Up on Wall Street, they liked those numbers a lot, with Citigroup and Evercore ISI both raising their price targets on KB Home stock to $28 a share, Barclays removing its sell rating from the stock, and Merrill Lynch double upgrading KB -- all the way from underperform to buy -- with a $37 price target, according to a note today on TheFly.com.

As Merrill Lynch explained, KB Home has exceeded expectations on "execution, margins and returns" for several quarters in a row, and it's finally time to acknowledge that the stock deserves a buy rating. Although many investors worry that high prices made even higher by rising interest rates will scare away homebuyers, the Commerce Department data shows this is clearly not the case for new homes at least.

In fact, Merrill believes the homebuilding market "may actually be inflecting higher" and predicts "solid homebuilding growth through 2020," which would obviously be good news for KB stock. Meanwhile, at its current valuation of 18.4 times trailing earnings, and with analysts predicting strong, 24% annualized growth over the next five years on average, the stock appears priced to move.

Housing market dynamics

KB Home management, by the way, seems to agree -- and recently authorized the repurchase of up to 4 million of its own shares, or nearly 5% of all shares outstanding. But does this mean you should buy KB Home stock? Does Merrill Lynch's argument in favor KB stock make sense in light of the data we're seeing out of Commerce?

I think it does. Here's why:

WSJ reports that "previously owned-homes sales, which represent the bulk of the housing market, have declined from a year earlier in four out of the first five months of this year." At the same time, though, new home sales are up, as I mentioned above.

So how are we to explain this dynamic, where few "used" homes are getting sold, but many new ones are? Nationwide senior economist Ben Ayers thinks it's a function of supply and demand -- as in, people are demanding houses to live in, but there's not a big enough supply of existing houses to sell.

The only way to match up supply and demand, therefore, is to build more new houses to make up for the deficit in existing houses available for sale. This would explain both the lack of sales growth in the "used" market, and the skyrocketing growth in new home sales. It also explains why, as Ayers says, "New home construction is also increasing with housing starts up to an expansion high in May."

I think this bodes very well for KB Home's business going forward -- and I think Merrill Lynch is right to recommend buying KB Home stock.

Rich Smith has no position in any of the stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.