Stock market forecasts from Punxsutawney Phil would probably have about the same chance of being accurate as forecasts from most pundits. (Photo from Punxsutawney Groundhog Club)

Would you believe that we’ve just seen the stock market set a record? Well, you should believe it, because it’s true.

What kind of record, you ask?

Answer: A year-ending-to-year-opening whiplash record.

There’s been quite a lot of whiplash in the markets lately, and the swing between December’s drop and January’s jump is a classic example.

The Standard & Poor’s 500-stock index fell 7.9 percent in December, when gloom prevailed, and rose 9.2 percent in January, when perceptions (though not economic realities) changed. That 17.1 percent spread is the biggest year-end-to-year-opening monthly differential in the 90 years for which the folks at S&P Dow Jones Indices have statistics.

Then there’s the Wilshire 5000 total stock market index, which had a biggest-ever $5.2 trillion month-to-month swing — the biggest-ever $2.8 trillion monthly drop in December, followed by the biggest-ever $2.4 trillion monthly jump in January.

What does this stomach-churning swing tell the investors among us what to do with their money now? Beats me.

It’s too bad that we didn’t get a chance to ask Punxsutawney Phil to forecast the stock market when he emerged from his burrow to forecast how much longer winter has to go.

After all, forecasts from the prognosticating groundhog would probably have about the same chance of being as accurate as forecasts from most market pundits, who can generally offer wonderful-sounding after-the-fact explanations of what has just happened but aren’t terribly great at telling you what’s going to happen.

Now that I’m done riffing, let me explain why I asked S&P and Wilshire Associates for these numbers, and for some others that I’ll give you in a minute.

My point is to show that if you, like me, are a nonprofessional investor, you’d better have both financial staying power and a strong stomach if you’re going to have a significant part of your overall wealth invested in stocks.

The return of the S&P 500 (including reinvested dividends) for 90 years has averaged 10.1 percent annually, according to AJO, a Philadelphia investment house. But that average masks huge swings, including 50 percent-plus drops after the Internet-telecom stock bubble burst in the early 1990s and during the market meltdown that started in 2007 and bottomed out in March 2009.

If you didn’t have both staying power and a strong stomach, it was tempting to bail out during the sickening drops, when gloom and dire predictions prevailed. But unless you’re either a market genius or incredibly lucky, bailing on stocks during the bad days means that you miss some or all of the gains that stocks produce after bottoming out.

The 17.1 percent December-January S&P swing is the biggest ever for those two months — but only the 38th largest two-month swing on record, according to S&P Dow Jones Indices. Of the others, 19 were positive and 18 were negative.

And although the Wilshire 5000’s December-January dollar swing is its biggest ever, Wilshire says that the 18.2 percent differential is only the fifth-largest change in percentage terms since 1970, when Wilshire’s history begins.

The December-January dollar difference was the biggest ever because the value of the U.S. stock market is much larger than when the Wilshire’s four bigger percentage swings took place. But the dollar number is easier to relate to — just like the number of points that the Dow Jones industrial average has risen or fallen gets much more attention from the general public than the number of S&P 500 points that the market rises or falls.

I don’t know where stocks go from here; no one knows for sure. The one thing I do know, though, is that given the history I’ve shown you — and given that most trading volume these days consists of computers using mathematical formulas to trade with each other — whiplash is inevitable.

And you can be sure that whiplash will be with us for at least as long as people continue to gather in Punxsutawney, Pa., every Feb. 2 to watch Phil emerge from his burrow. Gotta love the groundhog.