Goldman Sachs' Peter Oppenheimer. CNBC / screengrab LONDON — Goldman Sachs has circulated a fascinating but scary research note to clients suggesting that the probability of stocks entering a bear market in the next 24 months currently stands at about 88%, based on the history of previous bear markets.

The note is titled "Bear Necessities. Should we worry now?" It is an exhaustive, 87-page dive through macroeconomic data and stock market activity going all the way back to the early 20th Century. It was written in September by London-based Chief Global Equity Strategist Peter Oppenheimer, and European strategists Sharon Bell and Lilia Iehle Peytavin. Most of their data focus on the US S&P 500 index of stocks - the largest and most-followed of the share indices globally.

Here is the historic context. The S&P is currently the second largest and longest bull run in history.

The index is also relatively expensive, the Goldman trio says. The aggregate valuation of the S&P 500 is now in its 88th percentile, as measured since 1976, according to Goldman's calculations. The median stock is in the 99th percentile.

The trio calculated a risk index based on the Shiller price-earnings ratio (the price of S&P 500 stocks divided by the average of 10 years of earnings, adjusted for inflation), the US ISM manufacturing index, unemployment (very low), the bond yield curve, and core inflation.

The resultant "GS Bear Market Indicator" is currently flashing at 67%. The indicator typically hits highs right before a bear market in US stocks appears:

Historically, when the indicator is at 67%, there is an 88% chance of stocks falling into a bear market in two years' time, the Goldman analysts say:

However, the chance of a bear growling into view in the near-term remains low — just 35%.

Bear markets are triggered in three different ways, Oppenheimer et al argue:

"Cyclical" bear markets are trigged by rising interest rates and recessions;

"Event-driven" bears come from negative economic shocks like war or emerging market crises;

"Structural" bears come from financial bubbles.

Depending on your point of view, all three of those triggers are hovering on the horizon: The Fed and the Bank of England are both signalling interest rates will rise; US President Trump is threatening military action in North Korea; and plenty of people think the low-interest rate environment of the last 10 years has inflated asset bubbles in stocks, real estate and property in Europe, and private equity tech startup valuations.

However, Oppenheimer also believes that a bear market is currently being held back by low inflation, which in turn will force central banks to keep interest rates very low. "Rising inflation remains elusive," he wrote in a recent column for the Financial Times. "Market prices continue to reflect a low risk that interest rates will increase enough to trigger a recession in the near future."

If a bear market does happen it will be a roller coaster ride. Goldman created this diagram based on an average of historic data. Typical bear markets feature a false "bounce," in which stocks decline suddenly but then recover, reassuring investors (who then get crushed in the months afterwards) or giving clever investors a second chance to get the heck out of stocks.

Buckle up!