British historian Niall Ferguson has apologised for remarks suggesting that economist John Maynard Keynes did not care about future generations because he was gay and childless.

The academic and author, a professor at Harvard University, described as "stupid" his comments at a conference in California on Thursday, made in an "off-the-cuff" answer following a presentation.

"Keynes was a homosexual and had no intention of having children. We are NOT dead in the long run, our children are our progeny," Ferguson was quoted as saying by blogger Lance Reports on his StreetTalk Live website.

"It is the economic ideals of Keynes that have gotten us into the problems of today. Short-term fixes, with a neglect of the long run, leads to the continuous cycles of booms and busts," he added.

Ferguson apologised on his own blog, saying: "I should not have suggested … that Keynes was indifferent to the long run because he had no children, nor that he had no children because he was gay.

"This was doubly stupid. First, it is obvious that people who do not have children also care about future generations. Second, I had forgotten that Keynes's wife Lydia miscarried."

Keynes, whose theories influenced government policy and macroeconomic theory, married ballerina Lydia Lopokova despite being openly gay. He died in 1946.