WASHINGTON — Joined by his two predecessors, Ben Bernanke marked the 100th anniversary of the Federal Reserve by reflecting on the bold actions past chairmen have had to take in the best interest of the US economy.

To make his point, Bernanke referred lightheartedly to a two-by-four he keeps in his office. It was mailed to the Fed by home builders, a sign of protest over high interest rates the central bank used under then-chairman Paul Volcker in the late 1970s and early 1980s to fight inflation.

Bernanke said writing on the piece of lumber ‘‘communicates some distinctly unfavorable views of high interest rates and their effects on the economy.’’

For Bernanke, the fight has been the opposite. He’s kept interest rates at record lows and pursued ‘‘controversial but necessary measures’’ to fight a severe financial crisis.

‘‘Dispassionate analysis, expertise, and commitment to public service — all are values that have served us well,’’ Bernanke told the audience gathered in the Fed’s massive board room. ‘‘But one value that strikes me as having been at least as important as any other has been the Federal Reserve’s willingness, during its finest hours, to stand up to political pressure and make tough but necessary choices.’’

Bernanke spoke at a ceremony marking the Fed’s 100 years. He was joined by former chairmen Volcker and Alan Greenspan.

During his tenure, Volcker drove interest rates to levels not seen since the Civil War. He did so to combat a prolonged bout of high inflation.

Volcker said no one could claim that the Fed has always gotten economic policy exactly right. But he said the central bank has served the country well by acting in the public interest.

Greenspan, who was chairman from 1987 to early 2006, called the days following the October 1987 stock market crash ‘‘truly frightening.’’ But because of quick actions taken by the Fed, he said, the impact on the overall economy was minimal.

Bernanke said while economists have well-known difficulties making accurate forecasts even a few quarters into the future, he had one advantage in trying to predict the Fed’s next 100 years: ‘‘I won’t be around to explain why the forecast went wrong.’’