You are on page 1of 22

Cyclicality in Equity Indices returns

Fabrizio Maccallini
29 September 2015

Speculating whether equity indices returns may be subject to periodicities, I chanced upon a very interesting
cycle.
The first test was done on S&P500 daily prices, from 1950-01-03 to 2015-10-14. Using the cycle and shifting
its phase, we got some surprisingly smooth and regular average log-returns for the bull phase (green) and the
bear phase (red).

S&P 500 − Average log−return of the phase shifts


45
average log−return (bps)

40
35

open
30

close
25
20
15

As a comparison, by reshuffeling the closing prices in sequences slightly shorter than the period of our cycle,
in order to disrupt as little as possible the properties of the time serie (e.g. volatility), we visibly lose the
smoothness.

1
Average log−returns of the phase shifts (reshuffeled)
50
average log−return (bps)

40
30
20
10

Now we want to analyse the difference in terms of cumulative log-returns between the bull and the bear phase
(accrued through each phase shift from 1950-01-03 to 2015-10-14) on a close to close basis.

2
Difference of the cumulative log−returns (bull − bear)
average log−return (bps)

2
1
0
−1
−2

And also how linear the performance is in each phase for each phase shift, and how linear the difference
between the two performances is for each phase shift.

3
r2 of cumulative log−returns
1.0
0.8
0.6
r2

0.4
0.2
0.0

Interestingly in the second graph there is a plateau above 0.95 (blue line) r2 for the bull phase (green)
for phase shifts between point 13 and 18, associated with the highest difference in cumulative log-returns
(maximum 2.77 or 1598.21% in terms of overall return).
The most linear performance in the bull phase is point 16 (r2 0.9799), which is also the one with the highest
average cumulative return. The most linear performance for the difference between phases is point 18. Let’s
look at the performance for point 16 and 18 over time.

4
point 16
3
cum log−returns

2
1
0

0 200 400 600 800

5
point 18
3.0
cum log−returns

2.0
1.0
0.0

0 200 400 600 800

Both strategies suggest a significant dominance of the bull over the bear phase over time.
To corroborate the result we are going to run the same test on Nikkei 225 .

6
Nikkei 225 − Average log−return of the phase shift
50
average log−return (bps)

40
30

open
close
20
10

The graph still shows smooth average returns, although the location of the maximum is less clear. Again we
analyse the difference in terms of cumulative log-returns between the bull and the bear phase from 1955-01-04
to 2015-08-14 from close to close.

7
Difference of the cumulative log−returns (bull − bear)
3
2
cum log−returns

1
0
−1
−2
−3

And also how linear the performance is in each phase for each phase shift, and how linear the difference
between the two performances is for each phase shift.

8
r2 of cumulative log−returns
0.8
0.6
r2

0.4
0.2
0.0

5 10 15 20

shift

In the second graph the plateau for the bull phase is between points 12 and 15 above 0.90 (blue line) r2,
associated with the highest difference in cumulative log-returns (maximum 2.94 or 1885.77% in terms of
overall return).
The most linear performance in the bull phase is point 14 (r2 0.9513) and the most linear performance for
the difference is point 21 (point 18 is the second best), which also gives the highest cumulative return. Let’s
look at the perfromance for point 18 and 21 over time.

9
cum log−returns

0.0 1.0 2.0 3.0

0
200

10
400
point 18

600
point 21
3.0
cum log−returns

2.0
1.0
0.0

0 200 400 600

The first graph does not offer a clear dominance, at least in its first part. It should be noted that the peak of
the bear phase is on 1989-12-08 very close to the peak in the index, which may suggest that the difference
between the two phases is particularly pronounced in bear markets. The second graph is much more similar
to the one from S&P 500 where a dominance was clear.
So far we implicitly assumed that the phase shift is constant, but it may be subject to regimes, fluctuations
or patterns. To monitor how the phase shift behaves over time we can isolate for the most favourable shift in
each period (the one giving the highest average return) or alternatively over a certain window (the highest
average return over 3 adjacent periods) in order to filter some noise out.
It has to be noted that the method introduces a bias, in fact the best phase shifts are not simultaneously
compatible for an equal length for the period in the opposite phase.

11
6
4
2
0
−6 −4 −2

0 200 400 600

Index

The graph shows the optimal phase shift in each individual bull phase, the red line is a locally-weighted
polynomial regression (smoother span 2%) that gives a mild support for periodicity.
A spectrum analysis may be a more suitable tool for the task.

12
Raw periodogram for phase shifts (win = 1)
5e+00
spectrum

1e−01
5e−03

0.0 0.1 0.2 0.3 0.4 0.5

frequency
bandwidth = 7.7e−05

##
## Call:
## lm(formula = y ~ sin(2 * pi/per * t) + cos(2 * pi/per * t))
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.675 -4.685 -0.145 4.526 8.551
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.4361 0.1802 -2.420 0.0158 *
## sin(2 * pi/per * t) -0.0947 0.2551 -0.371 0.7106
## cos(2 * pi/per * t) 1.1114 0.2546 4.365 1.45e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.932 on 746 degrees of freedom
## Multiple R-squared: 0.02506, Adjusted R-squared: 0.02244
## F-statistic: 9.587 on 2 and 746 DF, p-value: 7.747e-05

13
5
0
y

−5

0 200 400 600

The result is not clear. The periodogram is rather flat with no obvious spike, however the p-value of the sin
fit and the intercept are above 1%. We can try now to find the best phase shift over a window of 3 periods,
sliding by one period each time. Averaging is a basic technique for reducing noise in a time serie.

14
6
4
2
0
−6 −4 −2

0 200 400 600

Index

Even in this case the locally-weighted polynomial regression (smoother span 2%) gives a mild support for
periodicity.

15
Raw periodogram for phase shifts (win = 3)
1e+02
1e+00
spectrum

1e−02

0.0 0.1 0.2 0.3 0.4 0.5

frequency
bandwidth = 7.7e−05

##
## Call:
## lm(formula = y ~ sin(2 * pi/per * t) + cos(2 * pi/per * t))
##
## Residuals:
## Min 1Q Median 3Q Max
## -8.8651 -4.4134 -0.2629 4.5188 9.0784
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.0983 0.1754 -0.560 0.575
## sin(2 * pi/per * t) 1.2985 0.2475 5.245 2.03e-07 ***
## cos(2 * pi/per * t) 1.4959 0.2485 6.019 2.76e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.8 on 746 degrees of freedom
## Multiple R-squared: 0.07893, Adjusted R-squared: 0.07646
## F-statistic: 31.96 on 2 and 746 DF, p-value: 4.803e-14

16
5
0
y

−5

0 200 400 600

This time the result is more meaningful. The spectrum shows a clear spike in the frequency domain and sin
function is significantly different form zero with a p-value close to 0, suggesting that the phase shift follows
its own cycle (with a period of 33.48).

17
Nikkei 225 − modulating phase shift
6
4
cum log−returns

2
0
−2

0 200 400 600

Index

The result is staggering. The difference between the cumulative log-returns is now 7.78.
Back to S&P500 , we are going to see if we can obtain a similar result applying the same method.

18
6
4
2
0
−2
−4
−6

0 200 400 600 800

Index

Even in this case the locally-weighted polynomial regression (smoother span 2%) gives a mild support for
periodicity.

19
Raw periodogram for phase shifts (win = 3)
1e+01
spectrum

1e−01
1e−03

0.0 0.1 0.2 0.3 0.4 0.5

frequency
bandwidth = 7.05e−05

##
## Call:
## lm(formula = y ~ sin(2 * pi/per * t) + cos(2 * pi/per * t))
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.5618 -3.8945 0.0291 3.8881 7.0755
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.2434 0.1438 1.693 0.0909 .
## sin(2 * pi/per * t) -1.0484 0.2033 -5.157 3.15e-07 ***
## cos(2 * pi/per * t) -0.8018 0.2034 -3.942 8.76e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.097 on 809 degrees of freedom
## Multiple R-squared: 0.04951, Adjusted R-squared: 0.04716
## F-statistic: 21.07 on 2 and 809 DF, p-value: 1.202e-09

20
6
4
2
0
y

−6 −4 −2

0 200 400 600 800

The spectrum shows a dominant frequency, associated to a period of 33.85, very close to the one found in
Nikkei. The sin function is also statistically significant.

21
S&P 500 − modulating phase shift
4
cum log−returns

3
2
1
0

0 200 400 600 800

The result is again impressive.

Conclusion

The results are encouraging. There is evidence of a well defined cycle, and it seems that the frequency
governing the cycle is affected by some some form of regular modulation. More evidence needs to be found
on other equity indices to confirm the result.
More effort should be made to deliver an accurate and complete estimate of the best phase shifts (the method
used in our analysis is biased) and to reduce the noise of the result. An extensive mapping of the variables
would give a complete picture of the dynamic of the cumulative log-returns, but it would also increase the
risk of severely biasing the model (overfitting), hence a cross-validation would be required to evaluate the
real performance.
An complement to the spectral analysis could be a Hidden Markov Model or a Switching Hidden Markov
Model taking different market regimes (bull/bear) into account.

22

You might also like