« Blue Blue Blue Christmas | Main | The Chronicles of Our Doing »

Cyclical Forecast of the S&P 500

Posted on Sunday, 21 December 2008 at 06:24 PM by Registered CommenterStracia in
Actions: CommentsPost a Comment
Share this: del.icio.us | Digg | Google | Ma.gnolia | Reddit | Stumble Upon | Technorati

We collected monthly data for the S&P 500 from January, 1939 to this week. We “detrended” the data by calculating a 14-month moving average of the 14-month divergence from trend (DFT) — that is, a rolling average of each monthly data point’s divergence from 14 months prior. Detrending the data is a necessary first step in analyzing any underlying cyclicality.

By inspection, this combination of time periods revealed (at least one) obviously cyclical pattern in the underlying data. That was sufficient for a start; an alternative method would be to apply the analysis we describe below to a range of detrending factors (e.g., from 2- to 48-month moving averages of 2- to 48-month DFTs, or [48 - 2]^2 = 2,209 detrended data series). The next step was to measure the detrended pattern numerically, rather than by casual inspection, and then to determine if other less obvious cycles may also be present.

To do that, we built a cyclical-analysis program in Excel that expresses the S&P 500’s detrended data series using a wave equation of the form:

y = A sin(F π P)

Where:

  • y represents the market’s cycle, described as a simple wave;
  • A = amplitude;
  • F = frequency;
  • π = pi, 3.14159…;
  • P = phase.

Obviously, the equation can take any number of possible values. The trick is to solve for those values that yield a wave line that best fits the market’s true cycles. We found four such cyclical patterns:

  • a 43.9-year cycle;
  • a 6.7-year cycle;
  • a 4.1-year cycle; and
  • a 2.0-year cycle.

You have probably seen reference to several of these cycle lengths in the literature; they have been known for decades. We determined them empirically for ourselves (confirmed them) for the purpose of building a forecast. And we did it using stuff you learned on the first day of the trigonometry module of your high-school precalculus course — that is, without recourse to numerology, ancient mystic rites, or by summoning demons (more on your knee-jerk reaction to the word “cycle” below).

Harmony

The above equation is adequate to describe a single wave function — for example, the one for the 6.7-year cycle. But the final step is to combine all known descriptive equations into a single formula, a harmonized wave function. Expressing this more complex function requires a bit more specificity; while we’re at it, we might as well incorporate a more standard symbology for wave functions as well. The formula for, and depiction of, the S&P 500’s rhythm is:




The market function is represented by the dashed black line (the equation determined by our Excel program). The thick red line is the detrended S&P 500. We extended the forecast out to June, 2016.

As you can see, our cyclical forecast is a two-handed wonder: It calls both for better times ahead, and worse. That’s the market, and it’s also in line with a growing but still contrarian call for at least a temporary market rally, however fleeting. We look forward to tracking the performance of large-cap stocks versus this published forecast.

Extensible Model

One of the things we like about our model is that we can “feed” it any data series we like. Ever wonder if there is a trend in advertising revenues, mean global temperatures, the performance of discount retailers, or women’s hemlines? Given the historical data, our Excel-based VBA program hunts for and finds the underlying cycles in a jiffy. It uses the nonlinear least-squares method to isolate those cycles for which residual error values are minimized locally, and at some point we plan to add the Bertels test for significance.

Software

There are a number of commercial software solutions that support wave-function analysis, including Techsignal and TableCurve 2D, each of which costs hundreds of dollars. (CycleDF runs in Excel and costs $70; FitAll comes in two versions, $39 and $99.) Techsignal requires that a piece of hardware, like a thumb drive, be installed on your system whenever the program runs. Can you imagine if every program required its own hardware and USB port? It’s a small-minded approach to IP protection, and one that never caught on for commercial software; and it’s part of the reason that Techsignal has not caught on. MATLAB and Mathematica also support wave-function analysis, but require learning rich, if vastly extensible grammars.

Roll Our Own

As with much of our analytical work, we prefer to stick to statistical techniques that never let the analyst abstract the math from the problem at hand, and yield themselves to inspection and testing every step of the way. (Mortgage-backed security, anyone?)

Idiocracy

Cyclical analysis is underutilized as a forecasting tool, probably because it takes two shakes more trigonometry than other practices common to business or economic analysis. For that reason, you may hear the word “cycle” and think we are talking about esoteric market theory, magic numbers, moon phases or some such. You would be wrong. Just look at the math: We are using a wave equation, rather than a linear equation, to express a relationship between two series. That is all. We look forward to sharing more such work as we build out our model.

Custom Analysis

We can also perform cyclical analyses on a bespoke basis, using data that you supply or that we can “fetch” for you. Please see our custom services page. ♦

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this blog entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own Web site »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>