Trigonometric Regression for Finding Cycles

The following computer programs and examples solve the cycle problems in Chapter 11.


The FORTRAN program TRIG1 and the subroutine LINREG are used to find the single-frequency representation of the copper cycle. The program output is clearly separated into the following information:

  1. Input data, where each time period is the average cash price for a calendar quarter.
  2. The solution to the linear regression, giving the detrending line. With b = .267, there is an inflationary bias of +.267¢ per quarter.
  3. The detrended data resulting from subtracting the line values (2) from the original data (1).
  4. Intermediate values for α, ω, and T.
  5. The constant values a and b for the normal equations solving the single-frequency problem.
  6. The cycle resulting from the detrended data.
  7. The final cycle with the trend added back.

The results show a copper cycle of approximately 8.4 quarters, or slightly more than 2½ years.

An additional test was run on monthly cash corn prices from 1964 through 1983 to see if the seasonal cycle dominated the detrended pattern. The linear regression equation used for detrending was calculated as:


showing only a 1¢ per bushel per month rate of inflation, despite the bull markets in 1973 and 1980 through 1981. The cycle showed a period of 21.4 months, with the last highs in the ...

Get New Trading Systems and Methods, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.