Skip to content
All library documents

Interpreting Amplitude and Phase in Fourier-Based Market Cycles

Article Quant Q&A · Author: mac13k

Summary

The document questions how to identify dominant cycles in stock prices using a discrete Fourier transform. It describes a cycle-selection approach that emphasizes large spectral amplitudes, then examines whether that criterion is sufficient when nearby frequency components have different phase angles.

An example uses roughly four thousand daily observations and shows a local amplitude peak at a period of about 12.44 samples. Several adjacent components also have notable amplitudes but differing phases. The author observes that summing these components produces a very different waveform from plotting only the peak component, and asks whether an envelope or another treatment is more appropriate. The example motivates a useful caution: nearby spectral peaks and their phases affect the reconstructed signal. The post is an open question, however, and supplies no validated procedure, predictive evidence, or trading results for resolving the ambiguity.

Key ideas

  • A large Fourier amplitude alone may not determine how a market cycle should be represented.
  • Nearby frequency components can have meaningful amplitudes and different phases.
  • Adding neighboring components can substantially change the reconstructed waveform.
  • The example raises the issue but does not establish a cycle-selection rule or trading edge.

Tags

Full text
# Stock market cycles with Fourier Transform - amplitude vs. phase


# Stock market cycles with Fourier Transform - amplitude vs. phase












There is this Wikipedia article on cycles in stock market data, which describes a 5-step process of finding dominant cycles in price data where step 2 reads:

> Step 2: Subsequently, a cycles engine performs a spectral analysis based on an optimized Discrete Fourier Transform (DFT) and then isolates those cycles that are repetitive and have the largest amplitudes.

Now here is the issue: when looking at the amplitude spectrum of DFT of a time series it may make sense, but then what about the phase of the corresponding components? Let me illustrate my issue with the example. Let's say I calculate DFT of the signal from around 4k samples, so there is a very fine resolution of the high frequency/low period components. In the amplitude spectrum using numerical or visual methods I find a local maximum at 1.04 (row #349, column 'amp'):

```
                               coeff      freq         w       amp        ph    c     period
347  (-341.737858288+1419.41730018j)  0.079899  0.502018  0.672335  1.807059  0.0  12.515850
348    (385.34656135-2047.44320284j)  0.080129  0.503465  0.959425 -1.384764  0.0  12.479885
349  (-1137.33333723+1957.67508513j)  0.080359  0.504912  1.042630  2.097099  0.0  12.444126
350   (969.672144511-1569.38982154j)  0.080589  0.506358  0.849546 -1.017344  0.0  12.408571
351  (-914.401398452+857.116113024j)  0.080820  0.507805  0.577162  2.388520  0.0  12.373219
```

So there is a peak with the top at 1.04 corresponding to the cycle with the period of 12.44 samples (in this very case 1 sample = 1 day) and if I follow the guidelines from the article [1] I should select this cycle as (one of) the dominant in the price data. But what about its nearest neighbors in the amplitude spectrum? One can see that the 5 consecutive cycles with the top one in the middle that have significant amplitudes, but much different phases (the 'ph' column in the table above, values are in radians). If I select and plot the top one only I will get a simple sine wave, but if I add 2 or 4 neighbors the plot will be more complicated with amplitude reaching way above 1.04 up to the sum of all composite amplitudes when the cycle tops come in sync as pictured in the figure below where the top subplot is showing the top cycle, the middle one the sum of the top cycle and 2 nearest neighbors, and the bottom one the the sum of the top cycle and 4 nearest neighbors:

Apparently the middle and bottom plots are very different from the top one, so I'm wondering how such issue should be dealt with? Perhaps the envelope could be used as the dominant cycle instead? If the phase angles were not so spread out, maybe a cycle of an average phase could be fitted in, but what can be done about the cycles that have similar amplitudes and frequencies, but much different phases?

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.