SlideShare a Scribd company logo
1 of 34
1
An Analysis of South African GDP using Fourier and Periodogram Methods1
UNIVERSITY OF CAPE TOWN
An analysis of South African Gross Domestic Product
using Fourier and periodogram methods
Dissertation submitted
in partial fulfillment of the requirements
for the degree of Bachelor of Commerce (Honours)
in Financial Analysis and Portfolio Management
by
Daniel Thomson (THMDAN008)
Supervisor: Gary van Vuuren
2
An Analysis of South African GDP using Fourier and Periodogram Methods2
ABSTRACT
This paper provides an alternative method of analysis to determine the length of the South Afri-
can business cycle, as measured by changes in real gross domestic product. Using the spectral
methods of Fourier series and periodogram analysis, the length of this cycle is found to be 7.11
years. We use this cycle to provide a one year forecast of GDP and compare it to observed data.
We find promising forecast potential and demonstrate that forecast accuracy may be improved
by including a greatly reduced number of cycle components than contained in the original se-
ries. We conclude that Fourier analysis is effective in estimating the length of the business cycle,
but is vague in determining the current position of the economy on the business cycle. The
study proposes the use of wavelets to analyse macroeconomic data such as GDP as they do not
suffer from many of the limitations of Fourier analysis and provide a representation of the data
in the time and frequency domains simultaneously.
Theauthor would like to thank his dissertation supervisor, Gary van Vuuren, for the ongoing sup-
port, advice and expertise unselfishly given throughout the essay process.
PLAGIARISM DECLARATION
1. I know that plagiarism is wrong. Plagiarism is to use another’s work and pretend
that it is my own.
2. I have used the Harvard convention for citation and referencing. Each contribu-
tion to, and quotation in this tutorial from the work(s) of other people has been
contributed, and has been cited and referenced.
3. This dissertation represents my own work.
4. I have not allowed, and will not allow, anyone to copy my work.
Signature: Daniel Thomson
Date: Sunday, March 15, 2015
3
An Analysis of South African GDP using Fourier and Periodogram Methods3
1 Introduction
1.1 Spectral Analysis Methods
In finance and economics, the predominant method of analysing time-series data is usu-
ally to view these data in the time-domain, i.e., analysing changes of a series as it pro-
gresses through time. The problem in using only this approach to study financial da-
tasets is that all realisations are recorded at a predetermined frequency. This frequency
corresponds to whichever period the realisations are recorded at and the implicit as-
sumption is made that the relevant frequency to study the behaviour of the variable
matches with its sampling frequency (Masset, 2008). This can be construed as analysing
inflation figures with a one year time frame and presuming that the cycle will repeat it-
self the following year as the cycle is presumed to be one year long. The realisations of
financial and economic variables often depend on a number of frequency components
rather than just one so the time-domain approach alone will not be able to process the
information in the time-series precisely.
Spectral analysis methods that enable a frequency-domain representation of the data,
such as Fourier series and wavelet methods, are able to identify at which frequencies
the time series-series variable is active. The strength of the activity may be measured
using Fourier analysis to construct a periodogram – a graphic representation of the in-
tensity of a frequency component potted against the period at which it occurs. This
method is particularly attractive for the use of economic variables that exhibit cyclical
behaviour as the cycle length may be identified using the Fourier transform.
1.2 The Business Cycle in South Africa
Understanding the business cycle and having an approximate idea of its current position
enables participants in the economy to make informed decisions. Because business cy-
cle information is so valuable, much research has been done to identify its behaviour
and the South African business cycle is no exception.1 In fact, owing to South Africa’s
volatile political and economic history, modelling its behaviour provides a robust test to
structural breaks and regime shifts of any technique.2
1.3 Problem Statement
1 See Du Plessis et. al (2014), Bosch and Ruch (2012) and Venter (2005).
2 As explained in Aaron & Muellbauer (2002) and Chevillon (2009).
4
An Analysis of South African GDP using Fourier and Periodogram Methods4
This paper will examine and attempt to forecast South African Gross Domestic Product
(GDP) time-series data by applying Fourier series analysis. The author aims to identify
potentially significant cycles present and quantify the length of these cycles by examin-
ing the data in the frequency-domain rather than the time-domain, thus providing an
alternative method of business cycle analysis to those in the literature. Using single fre-
quency components or a combination will also provide an unprecedented perspective in
South African GDP forecasting. A further aim of this paper is that it will be able to pave
the way for further alternative methods of analysis of economic and financial variables,
wavelets in particular, through highlighting potential limitations of pure frequency-
domain analysis.
The remainder of this paper is structured as follows. In Section 2, a brief literature re-
view providing an overview of spectral methods applied to finance (Section 2.1) and
previous attempts at modelling South African GDP (Section 2.2) is given. Section 3 pro-
vides a description of the data used in the analysis (Section 3.1) and outlines the meth-
odologies employed (Sections 3.2 – 3.5). The results and discussion of the problem (Sec-
tions 4.1 – 4.2) are found in Section 4, where our forecasts are also found (Section 4.3).
The conclusions (Section 5.1) and recommendations (Section 5.2) for further study can
be found in Section 5.
5
An Analysis of South African GDP using Fourier and Periodogram Methods5
2 Literature review
Spectral analysis methods have a broad range of applications in the real world. “Indeed,
the Fourier integral formula…is regarded as one of the most fundamental result of mod-
ern mathematical analysis, and it has widespread physical and engineering applica-
tions” (Debnath, 2012) These include circuitry, spectroscopy, crystallography, imaging,
signal processing, communications. Fourier series have more recently gained traction as
a tool in finance and econometrics, from the early works of Granger (1966),
Cunnyngham (1963), Nerlove (1964) and others on simple economic time series in the
1960s to modern day applications in derivative pricing and ground-breaking wavelet
analysis.
This literature review focuses on the application to finance and econometrics. In partic-
ular, literature that describes practical uses of Fourier and Periodogram analysis as ap-
plied to modelling and forecasting economic data is presented.
In a first step, we review literature relating to spectral analysis and its application to
economic time series by way of Fourier and Periodogram analysis. We begin with Ham-
ilton (1994) and then include work with more emphasis on practical studies such as Liu
et al. (2012) and Omekara, Ekpenyong and Ekrete (2013).
In a second step, we investigate methods to model the South African business cycle and
forecast the GDP.
2.1 Spectral analysis and application to economic time-series
In his seminal work, Hamilton (1994) discussed spectral analysis and introduced the
frequency domain. Hamilton (1994) also explained the concepts of the population spec-
trum, the sample periodogram and estimation based on the population spectrum.3 An
analysis of US manufacturing data demonstrated the use of spectral methods on real
time series. Hamilton (1994) explains why adjustment (in the form of taking natural
logs) of the data must be performed, owing to the assumptions of a covariance-
stationary process4 implicit in the transform. To rid the data of seasonal effects which
3 Spectral analysis meaning the study of a variable over the frequency spectrum or frequency-domain.
4 For a mathematical definition of a covariance-stationary process, see Lindgren, Rootzén and Sandsten
(2013).
6
An Analysis of South African GDP using Fourier and Periodogram Methods6
showed up in the periodogram, (Hamilton, 1994) suggested using year-on-year growth
rates.
Shumway and Stoffer (2000) provide a wide range of time series analysis techniques
and applications, covering spectral analysis and filtering. A walk-through example on
real data is provided and the chapter contains detailed explanations and illustrations
including parametric and nonparametric estimation as mentioned in Masset (2008). For
more general and theoretical work on spectral analysis, see Granger and Hatanaka
(1964), Granger (1966) and Cunnyngham (1963).
Practical studies involving the application of spectral methods to economic data are
considered next. Granger & Morgenstern (1964) used Fourier analysis to study stock
market prices on New York stock price series. Granger and Morgenstern (1964) found
that stock prices followed the random-walk hypothesis in the short term, but long run
components were owed greater consideration than the hypothesis suggests. A flat spec-
trum of share price changes provided a non-parametric test of the random-walk hy-
pothesis. Seasonal variation and the business-cycle components were found to be large-
ly irrelevant in explaining the evolution of stock market prices.
Praetz (1973) studied Australian share prices and share price indices in the frequency
domain using spectral analysis methods. In contrast to the findings of Granger and Mor-
genstern (1964), they found small departures from the random-walk hypothesis in their
share price series from 1947 to 1968, although not large enough to abandon the hy-
pothesis as ‘a crude first approximation.’ Some clearly defined seasonal patterns ap-
peared in their study of share price indices and certain sectors were shown to lead or
lag the market as a whole. This evidence contrasted in comparison to Granger and Mor-
genstern’s (1964) and Godfrey, Granger and Morgenstern’s (1964) studies on the New
York Stock Exchange and the London Stock Exchange, where such patterns and lags
were far less significant. The authors gave a tentative conclusion that Australian share
markets were less efficient than their overseas counterparts.
Iacobucci (2003) elaborated on the issues of cross-spectral analysis and filtering, with
typical concepts of coherency and phase spectrum being broached. He applied this anal-
ysis to US inflation and unemployment data and showed that a Phillips relation existed
at typical business cycle components of 14 and six years. In his analysis, he showed how
cross-spectral analysis and filtering can be used to find correlation between the two fac-
7
An Analysis of South African GDP using Fourier and Periodogram Methods7
tors through the Phillips curve. An interesting result of this paper found that unem-
ployment leads inflation with the lag of inflation being one year.
Masset (2008) provided an easy-to-follow introduction to spectral and wavelet methods
of analysis with many practical examples using real economic data. A spectral analysis
on home prices in New York City covering the period January 1987 to May 2008 was
performed using both parametric and non-parametric methods to show the subsequent
difference in the power spectrum. It was found that the spectra from the non-
parametric methods (Periodogram and Welch method) contained more noise than the
spectra obtained from the parametric methods (Yule-Walker and Burg). The Fourier
analysis of the data confirmed that strong seasonalities affected home prices in New
York and had a particular frequency cycle of 12 months. The study then provided a dis-
cussion on filtering, before a more detailed exposition on wavelet analysis was put for-
ward as a way to overcome many of the shortfalls of Fourier transform and filtering
methods.
Liu et al. (2012) investigated business and growth cycles in the frequency domain by
running Fourier analyses on several data sources including electricity demand, foreign
currency data, monthly retail sales, quarterly GDP, labour market and productivity sta-
tistics from Statistics New Zealand. In their analysis of the GDP data, the data were
transformed using natural logarithms and detrended using the Hodrick-Prescott filter
before conducting Fourier analysis of the detrended transformed data. Using a periodo-
gram, definitive cycles corresponding to eight years and four-and-a-half years were
found. Because of the distance between energy spikes in the periodogram for the
aforementioned cycles, it was proposed that the cycle length varied between four-and-
a-half to eight years. The paper concluded that Fourier analysis could be used to detect
cyclical behaviour in any type of time series data, although they found no cyclical behav-
iour in the majority of the time series data they had tested and omitted from this paper.
Liu et al. (2012) proposed a natural extension to the paper on Fourier analysis, to wave-
let analysis.
Omekara, Ekpenyong and Ekrete (2013) used Fourier series analysis to identify cycles
in the Nigerian all-items monthly inflation rates from 2003 to 2011. A square root trans-
formation was used to increase stability and normality of the inflation rate data. Peri-
odogram analysis showed a short term and a long term cycle of 20 months and 51
8
An Analysis of South African GDP using Fourier and Periodogram Methods8
months respectively with the long cycle corresponding to the length of two different
government administrations that existed during the sample period. They then fitted a
general Fourier series model to the data and used the model to make reasonably accu-
rate short term monthly inflation rate forecasts from an out-of-sample period of Sep-
tember 2011 to September 2012.
More recent academic research (Masset, 2008 and Liu et al., 2012) of Fourier series of-
ten leads to a recommendation of wavelet analysis as a natural extension to the limited,
frequency-domain only methods such as Fourier transforms. Masset (2008) states that,
“Both spectral analysis and standard filtering methods have two main drawbacks: (i)
they impose strong restrictions regarding the possible processes underlying the dynam-
ics of the series (e.g. stationarity), and, (ii) they lead to a pure frequency-domain repre-
sentation of the data, i.e. all information from the time-domain representation is lost in
the operation.” A large proportion of the literature surrounding spectral analysis re-
volves around the study of wavelets, with Fourier analysis being part of the process of
its development. This paper presents a practical application of Fourier analysis to South
African GDP data and while a recommendation to further investigate these data using
wavelet analysis is made, a thorough investigation and review of wavelet analysis is be-
yond the scope of this study.
2.2 Models and forecasting methods applied to the SA business cycle
and GDP
Aron and Muellbauer (2002) developed a GDP forecasting model for South Africa to
measure interest rate effects on output. They preferred multistep forecasting models to
recursive forecasting with vector autoregressive (VAR) models because of the structural
breaks present in the South African economy. The multistep model consisted of a factor
model which was then evolved to a single equation equilibrium correction model with a
built in term for the stochastic trend. The model made forecasts for up to four quarters
and was tested for stability using sample breaks. Tests for normality and heteroscedas-
ticity yielded satisfactory results and the authors concluded their model was robust.
Chevillon (2009) draws on the research of Aron and Muellbauer (2002) and establishes
whether direct multi-step estimation can improve the accuracy of forecasts. They set up
779 different models and applied them to South African GDP data to see which gave the
9
An Analysis of South African GDP using Fourier and Periodogram Methods9
most accurate forecasts and coped best with the large number of regime changes and
structural breaks. They found that Aron and Muellbauer’s direct multi-step model per-
formed best within short time horizons and that multivariate and univariate models,
with DMS, worked well with intermediate to long term time horizons.
Du Plessis, Smit and Steinbach (2014) developed a dynamic stochastic general equilib-
rium (DSGE) model for the South African economy. The model uses Bayesian techniques
to incorporate prior information about the economy into the parameter estimates. Its
forecasting capability extends up to seven quarters and was tested against a panel of
professional forecasters and a random walk. It was found to outperform the profession-
al forecasters and the random walk, especially over longer time horizons, when used to
predict CPI inflation and GDP growth.
Venter (2005) discusses the methodology used by the South African Reserve Bank to
identify business cycle turning points. He explains that this methodology includes the
use of three composite business cycle indicators and two diffusion indexes. Leading,
lagging and coincident indicators make up the composites while movement in historic
and current diffusion indexes help to confirm whether changes in the economy are lo-
calised or all-encompassing.
Bosch and Ruch (2012) provided an alternative methodology to dating business cycle
turning points in South Africa. They used a Markov switching model and Bry-Boschan
method to date the turning points and found that the model estimates generally coin-
cided with the business cycle turning points determined by the SARB. They applied the
model to GDP data but also to 114 of the 186 stationary variables the SARB uses to date
the business cycle.5 Using Principle Component Analysis (PCA) on these variables pro-
vided the authors with correlation data that enabled a more accurate measure of the
business cycle turning points than using GDP data alone.
10
An Analysis of South African GDP using Fourier and Periodogram Methods10
3 Data Description and Methodology
3.1 Data Description
The data used are the GDP, measured in 2005 constant market prices, with monthly pe-
riodicity and seasonally adjusted at an annual rate. The period used for the in-sample
Fourier analysis is 28 February 1969 to 31 October 2011 and the period used for the
out-of sample forecast is 30 November 2011 to 31 October 2014. These data were ob-
tained from the South African Reserve Bank (SARB).6
GDP is defined by the SARB as “…the total value of all final goods and services produced
within the boundaries of a country in a particular period.” This study seeks a simple and
readily available proxy for South African economic activity from which to identify po-
tentially meaningful cycles. GDP, although not a perfect measure of the business cycle
(see Boehm and Summers, 1999), provides a reasonable measure of economic activity
and the business cycle, over a satisfactory sample period.
The Fourier analysis tool in Excel performs a Fast Fourier Transform (FFT) on data. This
version of the Fourier Transform enables much faster computing, but restricts the num-
ber of data points in the input to a power of two. Thus, the data selected are in monthly
terms instead of quarterly points, so that the sample period may cover an appropriate
time period of 512 months.
6 Available at: http://wwwrs.resbank.co.za/webindicators/SDDSDetail.aspx?DataItem=NRI6006D.
11
An Analysis of South African GDP using Fourier and Periodogram Methods11
4 Methodology
4.1 Remarks
This section outlines the methodology used to generate the study results. The Hodrick-
Prescott filter and the Baxter-King filter are described as time-domain methods to ex-
tract the trend and cycle components of a time-series. The results of these are used for
comparison to the frequency-domain approach used in this paper. We then show how
the GDP time-series is stationarised and de-trended by taking their natural logarithms.
The Fourier and periodogram analysis methods are explained with the defining equa-
tions shown. Lastly, we describe the forecasting method employed to measure the accu-
racy of certain frequency components in predicting GDP returns out to 12 months.
4.2 Time series filtering methods
4.2.1 The Hodrick-Prescott Filter
Hodrick and Prescott (1997) showed a procedure for representing a time series 𝑋𝑡 as
the sum of a smoothly-varying trend component 𝜏𝑡, and a cyclical component 𝑐𝑡, where,
𝑋𝑡 = 𝜏𝑡 + 𝑐𝑡 𝑡 = 1,2, … , 𝑇.
They find the trend component 𝜏𝑡 by choosing a positive value of 𝜆 and solving for
min{ ∑ ( 𝑦𝑡 − 𝜏𝑡)2
+ 𝜆 ∑ [( 𝜏𝑡+1 − 𝜏𝑡 ) − ( 𝜏𝑡 − 𝜏𝑡−1 )2}𝑇
𝑡=2
𝑇
𝑡=1 . The parameter 𝜆 is a smooth-
ing parameter which “penalises variability in the growth (trend) component series”
(Hodrick and Prescott, 1997). The larger the value of 𝜆, the smoother is the output se-
ries.
The HP filter has been criticised for a number of limitations and undesirable properties
(Ravn & Uhlig, 2002). Canova (1994 and 1998) found reason to use the HP filter to ex-
tract business cycles from macroeconomic data of average length of four to six years,
but was sceptical of the methodology used to determine key parameter inputs. Spurious
cycles and distorted estimates of the cyclical component when using the HP filter were
obtained by Harvey and Jaeger (1993). Cogley and Nason (1995) also found spurious
cycles when using the HP filter on difference-stationary input data. Application of the
HP filter to US time series data was found to alter measures of persistence, variability
and co-movement dramatically (King and Rebelo, 1993). Many of these critiques do not
provide sufficient compelling evidence to discourage use of the HP filter (van Vuuren,
2012). As a result, it remains widely-used among macroeconomists for detrending data
12
An Analysis of South African GDP using Fourier and Periodogram Methods12
which exhibit short term fluctuations superimposed on business cycle-like trends (Ravn
& Uhlig, 2002).
4.2.2 The Baxter-King Filter
In contrast to the HP filter, the Baxter and King (1999) filter introduced a third variable,
‘noise,’ to the time series equation.
Consider a time series function 𝑋( 𝑡) consisting of 3 components: a trend component 𝜏,
cyclical component 𝛾, and a ‘noise’ (random) component, 𝜖 such that
𝑋𝑡 = 𝜏𝑡 + 𝛾𝑡 + 𝜖𝑡 𝑡 = 1,2,… , 𝑇.
The Baxter-King filter removes the trend and ‘noise’ components, leaving the cycle
component. That is:
𝛾𝑡 = 𝑋𝑡 − 𝜏𝑡 − 𝜖𝑡 𝑡 = 1,2, …, 𝑇.
Guay and St-Amant (2005) estimated the ability of the HP and BK filters to extract the
business cycle component of macroeconomic time series using two different definitions
of the business cycle component. They first defined the duration of a business cycle to
be between six and 32 quarters, which is the definition of business cycle frequencies
used by Baxter and King. The second definition is made by discerning between perma-
nent and transitory components. Guay and St-Amant (2005) concluded that in both cas-
es, the filters performed adequately when the spectrum of the original series had a peak
at business-cycle frequencies. Low frequencies dominant in the spectrum were found to
provide a distorted business cycle. Their results suggest that the use of HP and BK filters
on series resembling the Granger shape of an economic variable may be problematic
(Guay and St-Amant, 2005).
We perform Fourier analysis on the cyclical components of the HP filter and the BK fil-
ter, 𝑐𝑡 & 𝛾𝑡 , for comparison and discuss the results in the next section.
4.3 Data Stationarity
Masset (2009) states that spectral methods such as Fourier transforms “…require the
data under investigation to be stationary.”7 In the literature, stationarity usually means
weak stationarity (covariance-stationary), unless otherwise specified. An augmented
Dickey-Fuller (ADF) test, used widely in statistics and econometrics, can be used to
7 For a comprehensive definition of strict stationarity and weak stationarity, see (Pelagatti, 2013)
13
An Analysis of South African GDP using Fourier and Periodogram Methods13
check for this condition. The results obtained from the ADF test on nominal GDP data
used failed to reject the null hypothesis that the index levels series is non-stationary. We
therefore take the natural logarithms of the time-series:
ln( 𝑥 𝑡)− ln(𝑥 𝑡−1)
where
𝑥 𝑡 and 𝑥 𝑡−1 are consecutive months in the series.
This transformation means we are studying the returns of the monthly GDP data, a sta-
tionary series.
4.4 Fourier Analysis
The basic idea of spectral analysis is to re-express the original time-series 𝑥( 𝑡) as a new
sequence 𝑋( 𝑓), which determines the importance of each new frequency component 𝑓
in the dynamics of the original series (Masset, 2008). This is achieved by using the dis-
crete version of the Fourier transform, which decomposes a periodic signal into its con-
stituent frequencies. Time series data that comprise periodic components can be writ-
ten as a sum of simple waves (that is oscillations of a single frequency) represented by
sine and cosine functions (Brown and Churchill, 1993). A Fourier series is an expansion
of a periodic function in terms of an infinite sum of sines and cosines by making use of
the orthogonality relationships of the sine and cosine functions (Askey and Haimo,
1996). The generalised Fourier series, obtained using the functions 𝑓1( 𝑥)= cos 𝑥and
𝑓2( 𝑥) = sin 𝑥 (which form a complete orthogonal system over [−𝜋, 𝜋]) gives the Fourier
series of a function𝑓( 𝑥):
𝑓( 𝑥) =
1
2
𝑎0 + ∑ 𝑎 𝑛
∞
𝑛=1
cos( 𝑛𝑥) + ∑ 𝑏 𝑛 sin(𝑛𝑥)
∞
𝑛=1
where
𝑎0 =
1
𝜋
∫ 𝑓( 𝑥) 𝑑𝑥
𝜋
−𝜋
𝑎 𝑛 =
1
𝜋
∫ 𝑓( 𝑥)cos( 𝑛𝑥) 𝑑𝑥
𝜋
−𝜋
𝑏 𝑛 =
1
𝜋
∫ 𝑓( 𝑥)sin( 𝑛𝑥) 𝑑𝑥
𝜋
−𝜋
14
An Analysis of South African GDP using Fourier and Periodogram Methods14
For a function 𝑓(𝑥) periodic on an interval [0,2L] instead of [−𝜋, 𝜋] , a simple change of
variables can be used to transform the interval of integration from [−𝜋, 𝜋] to [0,2L]. Let
𝑥 =
𝜋𝑥′
𝐿
and 𝑑𝑥 =
𝜋𝑑𝑥′
𝐿
Solving for 𝑥′
and substituting into Equation 3 gives (Krantz, 1999):
𝑓( 𝑥′) =
1
2
𝑎0 + ∑ 𝑎 𝑛
∞
𝑛=1
cos(
𝑛𝜋𝑥′
𝐿
) + ∑ 𝑏 𝑛 sin(
𝑛𝜋𝑥′
𝐿
)
∞
𝑛=1
where
𝑎0 =
1
𝐿
∫ 𝑓( 𝑥′) 𝑑𝑥
2𝐿
0
𝑎 𝑛 =
1
𝐿
∫ 𝑓( 𝑥′)cos(
𝑛𝜋𝑥′
𝐿
) 𝑑𝑥
2𝐿
0
𝑏 𝑛 =
1
𝐿
∫ 𝑓( 𝑥′)sin (
𝑛𝜋𝑥′
𝐿
) 𝑑𝑥.
2𝐿
0
A periodogram plotting those frequency components with the greatest intensity or am-
plitude against the period shows which components bear significant meaning and which
components are random ‘noise.’ In cyclical data, it may be found that a few frequencies
are able to model the behaviour of the series relatively accurately. “The ‘noise’ (low am-
plitude) frequencies may be discarded and a new, ‘cleaner’ time-series –free of noise and
comprising only time-series signals characterised by the dominant frequencies-may thus
be constructed (van Vuuren, 2014).”
4.5 A forecast of GDP
We make a forecast using the most important (highest amplitude) frequency compo-
nents to test the fit of these components to out-of-sample GDP data. A 12 month forecast
is shown in the results section. We used a fan chart with bounds equal to the standard
deviation scaled with the square root of time out to 12 months. Both one standard devia-
tion and two standard deviations are used to model the error bands.
Forecasts using (a) the highest amplitude wave, (b) highest and second highest ampli-
tude waves and (c) first five highest amplitude waves are constructed.
15
An Analysis of South African GDP using Fourier and Periodogram Methods15
5 Results and Discussion
5.1 Results
5.1.1 Data
The data are a time-series of seasonally adjusted, nominal GDP in millions of Rands, tak-
en monthly from February 1971 to September 2013. In Figure 1 it is clear that an up-
ward trend exists, although cyclical variations are difficult to discern. The discrete Fou-
rier transform assumes that the input signal (GDP time-series) is statistically stationary,
i.e. it has a constant mean through time. This is a fair assumption, because if the data
were taken as is (due to the convex growth curve), vastly more weight would be given
to more recent fluctuations as the scale has increased greatly in the latter years, relative
to the initial years. This would not be an accurate representation of the time series and
the Fourier analysis would not effectively identify cycles.
Figure 1: Nominal GDP in Millions of Rands, seasonally adjusted from February 1971 to
September 2013.
Source: South African ReserveBank8
We performed an ADF test shown in Table 1 to confirm the data were non-stationary.
The ADF test examines the inputs for the existence of a unit-root in the context of a hy-
pothesis test. If a unit-root exists, we reject the null hypothesis and accept the alterna-
tive hypothesis that this root exists. The results showed that our assumption was cor-
rect and that we needed to perform a transformation to stationarise the data.
To stationarise the data, the natural logarithm difference from month to month was cal-
culated to produce the percentage returns series shown in Figure 2. These returns do
8 Available at: http://wwwrs.resbank.co.za/webindicators/SDDSDetail.aspx?DataItem=NRI6006.
0.0
0.5
1.0
1.5
2.0
2.5
3.0
Jan-70 Jan-74 Jan-78 Jan-82 Jan-86 Jan-90 Jan-94 Jan-98 Jan-02 Jan-06 Jan-10 Jan-14
Rand(Trillion)
Monthly nominal GDP
February 1971 - September 2013
16
An Analysis of South African GDP using Fourier and Periodogram Methods16
not scale with time and have a non-trending mean, so these are suitable for use in the
Fourier analysis framework.
Figure 2: De-trended GDP returns series using first differences.
Source: Author’s calculations
In the case of returns over the sample period from February 1971 to September 2013,
the mean monthly return is 1.05%. This positive average produces the upward ‘trend’
observed in the monthly GDP level in Figure 1. We are interested in identifying the cy-
clical changes around this trend.
Because of the volatility in the returns series, we apply two filtering methods which ex-
tract the trend and cycle components from the series and produce a smoother returns
series. These are the Hodrick-Prescott Filter and the Baxter-King Filter. The log returns
series is plotted alongside the filtered series in Figure 3. A table of summary statistics
illustrating the effectiveness of the filters in capturing the trend and filtering through
the noise is shown in Table 2 below.
-2%
-1%
0%
1%
2%
3%
4%
5%
Jan-70 Jan-74 Jan-78 Jan-82 Jan-86 Jan-90 Jan-94 Jan-98 Jan-02 Jan-06 Jan-10 Jan-14
Returns(%)
Log Returns of Monthly GDP
February 1971 - September 2013
17
An Analysis of South African GDP using Fourier and Periodogram Methods17
Figure 3: De-trended GDP series comparison with Hodrick-Prescott filtered series and
Baxter-King filtered series.
Source: Authors calculations usingNumXL software.
Table 2: Summary statistics illustrating the effects of filtering
The standard deviation of the log returns series is 0.64%, whilst the HP and BK filtered
series produce less variation with standard deviations of 0.33% and 0.36% respectively.
The filtered data also contain less excess kurtosis than the unfiltered returns series
while there is a positive skew in the unfiltered series and negative skew of less magni-
tude in the filtered series. A Bera-Jarque test of normality (Table 3) confirmed that the
data were not normally distributed. Severe excess-kurtosis and a positive skew, shown
in a histogram plot with a normal distribution curve for comparison in Figure 4 below,
characterise the monthly GDP returns series.
-2%
-1%
0%
1%
2%
3%
4%
5%
Jan-70 Jan-74 Jan-78 Jan-82 Jan-86 Jan-90 Jan-94 Jan-98 Jan-02 Jan-06 Jan-10 Jan-14
MonthlyReturns
Returns Series
February 1971 - September 2013
LogReturns HP Filter BK Filter
Log
Return HP Filter BK Filter
Mean 1.05% 1.05% 1.05%
Standard Deviation 0.64% 0.33% 0.36%
Skewness 1.21 -0.62 -0.13
Excess Kurtosis 6.44 0.92 0.94
Summary Statistics
18
An Analysis of South African GDP using Fourier and Periodogram Methods18
Figure 4: Frequency distribution of log returns series compared with the normal distri-
bution curve.
Source: Authors calculation usingNumXL software.
Valueintervals on thehorizontal axis aredetermined bytheFreedman-Diaconis choicebin rulein NumXL.
5.1.2 Fourier Analysis
Using the discrete version of the Fourier transform, the time-series of GDP returns is
transformed from a representation in the time-domain into the frequency-domain. The
time-series is decomposed into a series of sine and cosine waves occurring at different
frequencies with different intensities,9 which in summation are able to exactly mimic the
behaviour of the original signal. The power or amplitude of each frequency component
(which explains the importance of the particular frequency in making up the original
signal) is plotted against its period in Figure 5 below. The period is defined as
1
frequency
and is shown in months. The filtered series show much less static than the unfiltered
series as they rid the data of random deviations or ‘noise.' The periodogram omits peri-
ods longer than 180 months, which distort our analysis.
9 Intensity, power and amplitude are used inter-changeably.
0%
5%
10%
15%
20%
25%
-1.6% -1.1% -0.5% 0.1% 0.6% 1.2% 1.8% 2.3% 2.9% 3.4% 4.0%
Frequency
Return (%)
Distributionof Returns
February 1971 - September 2013
Frequency
Normal
19
An Analysis of South African GDP using Fourier and Periodogram Methods19
Figure 5: Periodogram plotting power against period of transformed returns data, HP
filtered data and BK filtered data
Source: Authors calculations.
In Figure 6 below, we consider the 15 frequencies with the highest intensities. Beyond
these and including the frequencies with lesser amplitude below, the remaining fre-
quencies are pure random ‘noise’ and do not help in explaining the business cycle.
Figure 6: Bar graph showing the 15 components with the highest amplitude.
Source: van Vuuren (2014).
There are two clearly dominant frequencies above, which differ substantially from the
others. These are at a period of 512.0 and 85.3 months, or frequencies of 0.00195 and
0.01172 cycles per month respectively. In simple terms, the periodogram states that
one cycle occurs per given period. For the period of 85.3 months, this means that 1 cycle
occurs every 85.3 months. Similarly, the model states that 1 cycle occurs every 512.0
months. The entire length of the sample data set is made up of 512 months however, so
0.00%
0.02%
0.04%
0.06%
0.08%
0.10%
0.12%
0.14%
0 20 40 60 80 100 120 140 160 180
Power(Amplitude)
Period (months)
Periodogramof ReturnsLog Returns
HP filtered
BK filtered
512
85.3
64
13.8 170.7 102.4
24.4
17.7 6.1 12.5 34.1 16 25.6 73.1 256
0.00%
0.05%
0.10%
0.15%
0.20%
0.25%
0.30%
0.35%
Amplitude(%)
Cycle period (months)
Components rankedby amplitude
20
An Analysis of South African GDP using Fourier and Periodogram Methods20
naturally, one cycle would occur that covers this period and this cycle is not necessarily
repetitive. This all-encompassing cycle has harmonic waves of 2 𝑛
and includes cycles
occurring at periods of 2, 4, 8, 16, 32, 64, 128, 256 and 512. In Figure 6, the harmonics
occurring at 16, 64, 256 and 512 months are all included in the 15 highest power com-
ponents. There is no literature regarding the South African business cycle as having a
period of 512 , 256 or 64 months, but Botha (2004) found evidence that a cycle exists
and that cycle lasted 7.00 years. Her result serves as evidence for us to reject the cycles
at the harmonics of 2 𝑛
periods and focus on the period of 85.33 months, corresponding
to a period of 7.11 years.
5.1.3 Forecast Potential
Using the frequencies with the highest relative power in the dataset, we produce a 12
month forecast and compare it to out-of-sample data of the same period.
Figure 7 shows a 12 month forecast from October 2013 to October 2014 using the single
frequency component with period of 85.33 months or 7.11 years. This frequency
showed the highest amplitude (0.3%) in the Fourier analysis. Our model error bands
are produced by multiplying the standard deviation of the reconstructed input signal
with the square root of time from the last in-sample data point. In this case, September
2013 is the last data point. This product is then added and subtracted from the input
signal return to produce a ‘fan-like’ forecast zone, implying that the accuracy of the
forecast decreases as one projects further into the future. Lastly, out-of-sample ob-
served data from October 2013 to October 2014 are plotted alongside the forecast
framework.
21
An Analysis of South African GDP using Fourier and Periodogram Methods21
Figure 7: Fan chart showing the 85.33 period reconstructed signal with error bands of
one standard deviation scaled with the square root of time against observed out-of-
sample GDP returns from October 2013 to October 2014.
Source: van Vuuren (2014).
Figure 7 clearly shows that the observed data do not fall within the forecast zone for the
majority of the 12 month time horizon forecast. The standard deviation of returns from
the reconstructed input signal to September 2013 is 0.18%, whilst the standard devia-
tion of the observed data is 0.64% and 0.54% in the out-of-sample 12-month period.
This volatility distorts the effectiveness of the forecast and for this reason we recom-
mend using quarterly GDP data and moving averages in future studies to smooth the
effects of short-term fluctuations, in line with Botha (2004) who states that “Statistics
on a daily, weekly or monthly basis tend to contain too much static.” Sherman and Kolk
(1996) assert that the best time interval to use in cyclical analysis is quarterly data.
Because our log transformation of the data rendered the returns time-series approxi-
mately normal, we operate on the assumption that about two-thirds (0.683) of the
monthly returns should fall between one standard deviation above and below the mean
value of our reconstructed signal. In Figure 8 below, we use error bands based on two
standard deviations to be 95% confident of our forecast model values.
Figure 8: Fan chart showing the 85.33 period reconstructed signal with error bands of
two standard deviations scaled with the square root of time against observed out-of-
sample GDP returns from October 2013 to October 2014.
-1.0%
-0.5%
0.0%
0.5%
1.0%
1.5%
2.0%
2.5%
3.0%
3.5%
Jun-13 Aug-13 Oct-13 Dec-13 Feb-14 Apr-14 Jun-14 Aug-14 Oct-14
MonthlyReturns
Forecast using 1 cycle component and1 standarddeviationerror bands
Observed GDP
±1
22
An Analysis of South African GDP using Fourier and Periodogram Methods22
Source: Authors calculations.
At the 95% level of confidence, the forecast using the 7.11 year, single-period frequency
still fails to encapsulate the values for the 12 months of real data.
We now show the effect of adding a further sine wave with the second highest ampli-
tude to the forecast model in Figure 9. This sine wave has a much shorter wavelength of
period 13.84 months (1.15 years) and a higher frequency (0.072 cycles per month). It
acts to convolute the original sine wave and error bands. Figure 9(a) shows error bands
of one standard deviation and (b) shows error bands of two standard deviations, scaled
with the square root of time, as before.
Figure 9: Fan chart showing reconstructed signal using first two components plotted
against observed out-of-sample GDP returns from October 2013 to October 2014: (a)
shows error bands of one standard deviation, (b) shows bands of two standard devia-
tions.
(a)
-1.0%
-0.5%
0.0%
0.5%
1.0%
1.5%
2.0%
2.5%
3.0%
3.5%
Jun-13 Aug-13 Oct-13 Dec-13 Feb-14 Apr-14 Jun-14 Aug-14 Oct-14
MonthlyReturns Forecast using 1 cycle component and2 standarddeviationerror bands
Observed GDP
1 component forecast
±2
-1.0%
-0.5%
0.0%
0.5%
1.0%
1.5%
2.0%
2.5%
3.0%
3.5%
Jun-13 Aug-13 Oct-13 Dec-13 Feb-14 Apr-14 Jun-14 Aug-14 Oct-14
MonthlyReturns
Forecast using 2 cycle components and1 standarddeviationerror bands
Observed GDP
2 component forecast±1
23
An Analysis of South African GDP using Fourier and Periodogram Methods23
Source: Authors calculations.
(b)
Source: Authors calculations.
Including every one of the 512 sinusoidal waves will fully replicate or reconstruct the
observed signal. By adding consecutive waves, the reconstructed signal resembles the
observed signal more closely. Thus, the sine wave of period 1.15 years added to the
wave of 7.11 years produces a forecast signal which mimic the in-sample data more ac-
curately. Whilst in (a) it is difficult to see any improvement in the observed data falling
within the forecast zone, the result in (b) encapsulates a greater proportion of the ob-
served signal than when only the first sine wave was used.
Finally, we show the forecast based on the first five significant frequencies in Figure 10
and see that there is little improvement from including a further three frequency com-
ponents. Each additional wave added has less amplitude or significance in explaining
the original time-series, so the marginal gains from including more waves diminishes
the more waves we add:
-1.0%
-0.5%
0.0%
0.5%
1.0%
1.5%
2.0%
2.5%
3.0%
3.5%
Jun-13 Aug-13 Oct-13 Dec-13 Feb-14 Apr-14 Jun-14 Aug-14 Oct-14
MonthlyReturns
Forecast using 2 cycle components and2 standarddeviationerror bands
Observed GDP
2 component forecast
±2
24
An Analysis of South African GDP using Fourier and Periodogram Methods24
Figure 10: Fan chart showing reconstructed signal using first five components plotted
against observed out-of-sample GDP returns from October 2013 to October 2014: (a)
shows error bands of one standard deviation, (b) shows two standard deviations.
(a)
Source: Authors calculations.
(b)
Source: Authors calculations
5.2 Discussion
5.2.1 Summary of Results
Spectral analysis provides an alternative method of, in this case, business cycle analysis,
to the traditional method used by the South African Reserve Bank and Venter (2005) of
micro and macro-economic indicators which lead, coincide with and lag the economy.
The result of this study, from 512 months of GDP data, showed that a significant cycle
exists with a period of 7.11 years over the period February 1971 to September 2013.
-1.0%
-0.5%
0.0%
0.5%
1.0%
1.5%
2.0%
2.5%
3.0%
3.5%
Jun-13 Aug-13 Oct-13 Dec-13 Feb-14 Apr-14 Jun-14 Aug-14 Oct-14
MonthlyReturns
Forecast using 5 cycle components and1 standarddeviationerror bands
Observed GDP
5 component forecast
±1
-1.0%
-0.5%
0.0%
0.5%
1.0%
1.5%
2.0%
2.5%
3.0%
3.5%
Jun-13 Aug-13 Oct-13 Dec-13 Feb-14 Apr-14 Jun-14 Aug-14 Oct-14
MonthlyReturns
Forecast using 5 cycle components and2 standarddeviationerror bands
Observed GDP
5 component forecast
±2
25
An Analysis of South African GDP using Fourier and Periodogram Methods25
We found the 3rd highest power frequency component to have a period twice that of the
component with the highest frequency and put forward that this is a harmonic of the
85.33 month cycle and not a significant cycle of its own.
5.2.2 Forecast Accuracy
Forecasting using the established seven year cycle with a frequency of 0.01172 cycles
per month and including up to five frequencies returned somewhat disappointing re-
sults. Examining the data in Figure 11 below, it is clear that the majority of returns
(81%) are between one standard deviation above and below the mean value of 1.06%.
However, in the time period of the forecast, returns were out of this range as shown in
Figure 12.
Figure 11: De-trended GDP returns series showing the historic mean with one standard
deviation above and below the mean from February 1971 to October 2014.
Source: Authors calculations.
-1.75%
-0.75%
0.25%
1.25%
2.25%
3.25%
4.25%
5.25%
Jan-70 Jan-74 Jan-78 Jan-82 Jan-86 Jan-90 Jan-94 Jan-98 Jan-02 Jan-06 Jan-10 Jan-14
MonthlyReturns
Historic StandardDeviationof Returns
Observed GDP Mean
±1
26
An Analysis of South African GDP using Fourier and Periodogram Methods26
Figure 12: De-trended GDP returns series showing the historic mean with one standard
deviation above and below the mean from the 12 months before the forecast period be-
gins in October 2013 to October 2014.
Source: Authors calculations.
Viewing the time series as being made up of a general trend, cyclical component and er-
ror component, one may investigate the behaviour of each of these as in Omekara
(2013). They assessed each component separately before putting them together to form
a forecast equation. Specifically, they estimated the error component by assessing the
autocorrelation function of the residual for randomness. If the residual is not random,
as in their case, a first order autoregressive model may be fitted to the error values
(Omekara, 2013). The Baxter-King filter separates a time-series into the three compo-
nents mentioned, but it is critical to use the appropriate parameters in the filter to pro-
duce meaningful results. Further studies may be able to establish these parameters and
use the BK filtered data to run Fourier analysis. If serial autocorrelation is present in the
error component and can be taken into account via an autoregressive model as part of
the forecast equation, the forecast accuracy may improve.
5.2.3 Dating the Cycle
Fourier analysis does not identify the start and end points of a cycle. Liu et al. (2012)
contend that with the length of a cycle identified, one can infer the start and end points.
This is the reverse of the method used in Bry and Boschan (1971), where the length of a
cycle is inferred by finding the start and end points first. This paper does not attempt to
provide turning point dates and business cycle phase changes as in Botha (2004), alt-
hough further study over a longer time period using the first few ‘important’ frequency
-1.0%
-0.5%
0.0%
0.5%
1.0%
1.5%
2.0%
Sep-12 Jan-13 May-13 Sep-13 Jan-14 May-14 Sep-14
MonthlyReturns
Historic StandardDeviationof Returns
October 2012-October 2014
Observed GDP
Mean
±1
27
An Analysis of South African GDP using Fourier and Periodogram Methods27
components may provide useful insight in dating previous business cycles. Use of quar-
terly data and moving average or filtering methods would help to control the volatility
that characterises the monthly data in this study.
5.2.4 Comments on the data
The Discrete Fourier Transform tool in Excel (Cooley-Tukey version) requires 2 𝑛
data
inputs up to a maximum of 512 entries. It is for this reason that we chose monthly fig-
ures and not quarterly figures, as 512 quarters of GDP data are not easily available. The
problem statement of this paper was to measure and forecast South African GDP cycles
using Fourier analysis. Over the period used in the analysis, many structural breaks,
sanctions imposed and lifted, and regime shifts have taken place as noted in Aaron &
Muellbauer (2002) and Chevillon (2009). These have had destabilising effects on the
economy of South Africa and are reflected in the GDP data under review. Fourier analy-
sis identified a clear seven year cycle but much noise was present, making forecasting
using the single cycle rather inaccurate and ineffective in coping with volatile breaks in
the data.
28
An Analysis of South African GDP using Fourier and Periodogram Methods28
6 Conclusion and Recommendations
6.1 Conclusion
Using Fourier and periodogram analysis to study South African GDP from February
1971 to September 2013, this paper showed that a clear individual cycle existed, lasting
approximately seven years. This result, though obtained using an alternative quantita-
tive approach, compares favourably with the result of Botha (2004), who found a seven
year cycle in quarterly South African GDP from 1961 to 2003. We found that a simple
log transformation enables the use of Fourier analysis methods and that filtering using
the Hodrick-Prescott and Baxter-King filters helps to get rid of the majority of random
‘noise’ whilst still preserving the integrity of explanatory cycles present in the data.
Forecasting using solely the frequency component corresponding to the seven year pe-
riod showed limited usefulness when compared to observed data in the forecast period.
We showed that the conviction of a forecast can be improved by increasing the error
bands of the forecast from one standard deviation to two standard deviations.
The results also showed that forecast accuracy improves as successive frequency com-
ponents with the next highest amplitudes are added to the seven year base wavelength.
These improvements show diminishing marginal utility as lower amplitudes are used.
6.2 Recommendations for further study
6.2.1 Business Cycle Data Representation
This paper used nominal GDP as a proxy for the SA business cycle. GDP growth is
termed as “the most natural indicator” of an economy’s aggregate business cycle by the
Basel Committee for Banking Supervision (BCBS), however, a number of macroeconom-
ic indicators with useful business cycle information could have been used. These include
aggregate real credit growth, the credit-to-real GDP growth ratio and the leading, lag-
ging and co-incident indicators used by the SARB to measure the business cycle. The
BCBS considers real credit growth as a “natural measure of supply” since boom periods
leading to a peak in the business cycle are characterized by rapid credit expansion and
credit contraction has typically heralded credit crunches (van Vuuren, 2012). For a
comprehensive study of the use of Fourier series methods in detecting the length and
timing of South african business cycles, the above data should also be analysed.
29
An Analysis of South African GDP using Fourier and Periodogram Methods29
6.2.2 Data Selection
We found that monthly data contained too much variation. Quarterly data combined
with the use of weighted moving averages and filtering would help to smooth volatility
in the short term and should be considered in further studies. Using the Discrete Fourier
Transform tool in Excel requires that the number of inputs be a multiple of 2 𝑛
. We rec-
ommend, in the South African case, using 256 quarters (768 months) to ensure the reli-
ability of the results, with the caveat that economic, environmental and political factors
may have changed considerably over this period.
6.2.3 Method of Return Calculation
This paper calculated returns by taking the natural logarithms of month-to-month GDP
levels and not month-on-month returns. Our method produces monthly changes with
less autocorrelation than using month-on-month data, which gives an annual change.
Post study, the author generated a periodogram by the same methods, using month-on-
month data and found the seven year cycle with the same intensity as a result, although
the 13.8 month cycle which had the second highest amplitude was not present as a rele-
vant frequency component.
6.2.4 Power Spectrum Estimation
6.2.5 This paper made use of the non-parametric, periodogram method to calculate the
power of a frequency component. Masset (2008) compared the parametric
methods of Yule-Walker and Burg and the non-parametric methods of the peri-
odogram and Welch method. The non-parametric methods contained more
‘noise’ over the spectrum and the difference between the periodogram and
Welch method was much greater than the difference in the parametric methods.
Preceding Fourier analysis, one should ensure the most suitable method to esti-
mate the power spectrum is used or provide a comparison of the results before
further analysis. Forecasting Issues
Separate modelling of the components of the time-series
This paper made use of unfiltered returns data as the Fourier tool used was able to
separate the cyclical components from the general trend internally. However, using the
Baxter-King filtered returns or any method that can separate the trend, cycle and error
components of a time series will allow future studies to attempt to model the error
30
An Analysis of South African GDP using Fourier and Periodogram Methods30
component identified if it is not random, as in Omekara (2013). This may improve the
accuracy of forecasts.
Determining the current position of the economy on the business cycle
The methods used to determine the length of the SA business cycle provided satisfacto-
ry results in this paper, but ascertaining the approximate current position of the econ-
omy on the business cycle was not addressed in full. For this purpose, further studies
should include Fourier analysis and forecasting of various measures of the business cy-
cle, not only the rate of GDP growth. Phase differences between leading, lagging and co-
incident cycles may provide valuable information to pin-point the current position of
the economy and a composite cycle of such indicators may provide a more accurate
forecast.
Statistical Measurement of Forecast Accuracy
The forecasts in this paper were not tested by any statistical measure of significance
and thus cannot be compared to other forecast tools. Although testing may become rig-
orous, at a minimum, we suggest testing for correlation and performing a simple regres-
sion to predict future GDP returns based on the path of the reconstructed signal. A mul-
tiple regression hypothesis test may yield helpful results regarding the significance of
each frequency component in predicting future values. The author found that the peri-
odogram performed this function by ordering components according to amplitude, but a
multiple regression could prove this statistically.
6.2.6 Wavelets
Wavelets are relatively new tools in economics and finance. They are a very attractive
way of analysing financial datasets as they are able to represent data series from both
the time and frequency perspectives simultaneously. Hence, they permit to break down
the activity of the market into different frequency components and to study the dynam-
ics of each of these components separately. They do not suffer from some of the limita-
tions of standard frequency-domain methods, like Fourier anlaysis used in this paper,
and can be employed to study a financial variable, whose evolution through time is dic-
tated by the interaction of a variety of different frequency components. These compo-
nents may behave according to non-trivial (non-cyclical) dynamics – e.g., regime shifts,
31
An Analysis of South African GDP using Fourier and Periodogram Methods31
jumps, long-term trends (Masset, 2008).10 Due to the complex nature and presence of
such non-trivial dynamics in South African GDP data under study, the author strongly
suggests using wavelet analysis on South African and other similar GDP datasets which
are characterised by non-cyclical dynamics.
10 For a non-technical introduction to wavelets and their benefits compared to pure-frequency domain
analysis, see Masset (2008).
32
An Analysis of South African GDP using Fourier and Periodogram Methods32
Bibliography
Baxter, M., & King, R.G., 1999. Measuring business cycles: approximate band-pass filters
for economic time series. The Review of Economics and Statistics, 81(4), 575-593.
Bry, G., & Boschan, C., 1971. Cyclical analysis of time series: selected procedures and com-
puter programs. New York: Columbia University Press.
Bosch, A., and Ruch, F., 2013. An Alternative Business Cycle Dating Procedure for South
Africa. South African Journal of Economics, 81: 491–516.
Canova, F., 1994. Detrending and turning points. European Economic Review, 38(3-4),
614-623.
Canova, F., 1998. Detrending the business cycle. Journal of Monetary Economics, 41, 475-
512.
Chevillon, G., 2009. Multi-step forecasting in emerging economies: An investigation of
the South African GDP. International Journal of Forecasting, 25(3), pp.602–628.
Cogley, T., & Nason, J. M., 1995. Effects of the Hodrick-Prescott Filter on trend and
difference stationarytime series: implications for business cycle research. Journal of
Economic Dynamics and Control, 19, 253-278.
Cunnyngham, J., 1963. Spectral analysis of time series. Working Paper No. 16, U.S.
Department of Commerce, Bureau of Census, New York.
Debnath, L., 2011. A short biography of Joseph Fourier and historical development of
Fourier series and Fourier transforms. International Journal of Mathematical Education
in Science and Technology, 43(5), pp.1–24.
Granger, C.W.J., 1966. The typical spectral shape of an economic variable. Econometrica,
34(1), 150-161
Granger, C.W.J., & Morgenstern., 1964. Spectral Analysis of Stock Market Prices. Kyklos,
34(1), 150-161.
Guay, A., and St-Amant, P., 2005. Do the Hodrick-Prescott and Baxter-King filters Provide
a Good Approximation of Business Cycles? Annales d'Economie et de Statistique, No. 77
(Jan. - March., 2005) pp. 133-155
Hamilton, J.D., 1994. Time Series Analysis, Princeton.
Harvey, A. C., & Jaeger, A., 1993. Detrending, stylized facts and the business cycle. Journal
of Applied Econometrics, 8, 231-247.
Hodrick, R.J., & Prescott, E.C., 1997. Postwar U.S. business cycles: an empirical
investigation. Journal of Money, Credit, and Banking, 29(1), 1-16.
Iacobucci, A., 2003. Spectral Analysis for Economic Time Series, Documents de Travail de
I'OFCE.
Aron, J., and Muellbauer, J., 2002. Evidence from a GDP Forecasting Model For South
Africa IMF Staff Papers , Vol . 49 , IMF Annual Research Conference ( 2002 ), pp . 185-
213
King, R. G., & Rebelo, S. T., 1993. Low frequency filtering and real business cycles. Journal
of Economic Dynamics and Control, 17(1-2), 207-231.
33
An Analysis of South African GDP using Fourier and Periodogram Methods33
Lindgren, G., Rootzén, H and Sandsten, M., 2013. Stationary stochastic processes for sci-
entists and engineers. Chapman and Hall, USA, 200p.
Liu, L., Paki, E., Stonehouse, J., and You, J.,, 2012. Cycle Identification : An old approach to
( relatively ) new statistics. NZAE Annual Conference, Statistics New Zealand
Masset, P., 2008. Analysis of Financial Time-series using Fourier and Wavelet Methods.
… )-Faculty of Economics and Social Science, (October), pp.1–36. Available at:
https://psutn2009.googlecode.com/svn-history/r5/trunk/SSRN-id1289420.pdf.
Nerlove, M., 1964. Spectral analysis of seasonal adjustment procedures. Econometrica,
32: 241-286.
Omekara, C. O., Ekpenyong, E., J., and Ekrete, M., P., 20142014. Modelling the Nigerian
Inflation Rates Using Periodogram and Fourier Series Analysis .[pdf] Lagos: Nigerian
Central Bank.
Plessis, S., Smit, B. & Steinbach, R., 2014. South African Reserve Bank Working Paper
Series A medium - sized open economy DSGE model of South Africa. , (July).
Praetz, P.D., 1973. A spectral analysis of Australian share prices. Australian Economic Pa-
pers, 12: 70–78. doi: 10.1111/j.1467-8454.1973.tb00296.x
Ravn, M. O., & Uhlig, H., 2002. On Adjusting the Hodrick Prescott Filter for the Frequency
of Observations. The Review of Economics and Statistics, 84(2), 371-375.
Shumway, R.H. & Stoffer, D.S., 2000. Time Series Analysis and Its Applications, Available
at: http://www.springer.com/statistics/statistical+theory+and+methods/book/978-0-
387-29317-2.
Telser, L.G., Granger, C.W.J. & Hatanaka, M., 1967. Spectral Analysis of Economic Time
Series. Journal of the American Statistical Association, 62(November), p.687. Available at:
http://www.jstor.org/stable/2283996?origin=crossref.
Venter, J.C., 2005. Reference Turning Points in the South African Business Cycle: Recent
Developments. SARB Quarterly Bulletin, (September), pp.61–70. Available at:
http://www.esaf.org/internet/Publication.nsf/LADV/EE79538CB86F96DA422570830
04E8875/$File/ART092005.pdfnhttp://www.oecd.org/dataoecd/54/26/34898202.p
df.
van Vuuren, G., 2014. Private communication.
van Vuuren, G., 2012. Basel III Countercyclical capital rules: implications for South Afri-
ca. South African Journal of Economic and Management Sciences, 15(3): 76 – 89.
34
An Analysis of South African GDP using Fourier and Periodogram Methods34
Appendix
Table 1 (a) Augmented Dickey-Fuller test for stationarity: monthly GDP levels:
Stationary test
Test Stat P-Value C.V. Stationary? 5.0%
ADF
No Const -2.2 2.5% -1.9 FALSE
Const-Only -5.8 0.1% -2.9 FALSE
Const+ Trend -7.1 0.0% -1.6 FALSE
Const+Trend+Trend^2 -7.4 0.0% -1.6 FALSE
Table 1 (b) Augmented Dickey-Fuller test for stationarity: monthly GDP returns:
Stationarytest
Test Stat P-Value C.V. Stationary? 5.0%
ADF
No Const -2.2 2.5% -1.9 TRUE
Const-Only -5.8 0.1% -2.9 TRUE
Const+ Trend -7.1 0.0% -1.6 TRUE
Const+Trend+Trend^2 -7.4 0.0% -1.6 TRUE
Table 3 Jarque-Bera test of normality on monthly returns series from February 1971-
September 2013
Normality test Z-Score Critical Value p-Value Pass? Significance Level=0.05
Jarque-Bera 988.90 5.99 0.0% FALSE

More Related Content

Similar to Daniel Thomson - Final

A multifractality measure of stock market efficiency in asean region
A multifractality measure of stock market efficiency in asean regionA multifractality measure of stock market efficiency in asean region
A multifractality measure of stock market efficiency in asean regionAlexander Decker
 
Demand forecasting
Demand forecastingDemand forecasting
Demand forecastingdkamalim92
 
International Review of Economics and Finance 20 (2011) 485–49.docx
International Review of Economics and Finance 20 (2011) 485–49.docxInternational Review of Economics and Finance 20 (2011) 485–49.docx
International Review of Economics and Finance 20 (2011) 485–49.docxmariuse18nolet
 
FIRE ADMIN UNIT 1 .orct121320#ffffff#fa951a#FFFFFF#e7b3513VERSON.docx
FIRE ADMIN UNIT 1 .orct121320#ffffff#fa951a#FFFFFF#e7b3513VERSON.docxFIRE ADMIN UNIT 1 .orct121320#ffffff#fa951a#FFFFFF#e7b3513VERSON.docx
FIRE ADMIN UNIT 1 .orct121320#ffffff#fa951a#FFFFFF#e7b3513VERSON.docxAKHIL969626
 
Demande forecasating
Demande forecasatingDemande forecasating
Demande forecasatingAntriksh Cool
 
An Econometric Model for Inflation Rates in the Volta Region of Ghana
An Econometric Model for Inflation Rates in the Volta Region of GhanaAn Econometric Model for Inflation Rates in the Volta Region of Ghana
An Econometric Model for Inflation Rates in the Volta Region of Ghanaiosrjce
 
An Econometric Model for Inflation Rates in the Volta Region of Ghana
An Econometric Model for Inflation Rates in the Volta Region of GhanaAn Econometric Model for Inflation Rates in the Volta Region of Ghana
An Econometric Model for Inflation Rates in the Volta Region of Ghanaiosrjce
 
Time Series Data Analysis for Forecasting – A Literature Review
Time Series Data Analysis for Forecasting – A Literature ReviewTime Series Data Analysis for Forecasting – A Literature Review
Time Series Data Analysis for Forecasting – A Literature ReviewIJMER
 
vatter_wu_chavez_yu_2014
vatter_wu_chavez_yu_2014vatter_wu_chavez_yu_2014
vatter_wu_chavez_yu_2014Thibault Vatter
 
"Fuzzy based approach for weather advisory system”
"Fuzzy based approach for weather advisory system”"Fuzzy based approach for weather advisory system”
"Fuzzy based approach for weather advisory system”iosrjce
 
Technology Forecasting - Monitoring and Intelligence Methods
Technology Forecasting - Monitoring and Intelligence MethodsTechnology Forecasting - Monitoring and Intelligence Methods
Technology Forecasting - Monitoring and Intelligence MethodsMufaddal Nullwala
 
marketing group.docx
marketing group.docxmarketing group.docx
marketing group.docxDerashmelaku
 
A var analysis of singapore's monetary transmission mechanism
A var analysis of singapore's monetary transmission mechanismA var analysis of singapore's monetary transmission mechanism
A var analysis of singapore's monetary transmission mechanismtvvip741963
 
Comparison of exponential smoothing and neural network method to forecast ric...
Comparison of exponential smoothing and neural network method to forecast ric...Comparison of exponential smoothing and neural network method to forecast ric...
Comparison of exponential smoothing and neural network method to forecast ric...TELKOMNIKA JOURNAL
 

Similar to Daniel Thomson - Final (20)

A multifractality measure of stock market efficiency in asean region
A multifractality measure of stock market efficiency in asean regionA multifractality measure of stock market efficiency in asean region
A multifractality measure of stock market efficiency in asean region
 
Demand forecasting.
Demand forecasting.Demand forecasting.
Demand forecasting.
 
Demand forecasting
Demand forecastingDemand forecasting
Demand forecasting
 
International Review of Economics and Finance 20 (2011) 485–49.docx
International Review of Economics and Finance 20 (2011) 485–49.docxInternational Review of Economics and Finance 20 (2011) 485–49.docx
International Review of Economics and Finance 20 (2011) 485–49.docx
 
Panel data content
Panel data contentPanel data content
Panel data content
 
FIRE ADMIN UNIT 1 .orct121320#ffffff#fa951a#FFFFFF#e7b3513VERSON.docx
FIRE ADMIN UNIT 1 .orct121320#ffffff#fa951a#FFFFFF#e7b3513VERSON.docxFIRE ADMIN UNIT 1 .orct121320#ffffff#fa951a#FFFFFF#e7b3513VERSON.docx
FIRE ADMIN UNIT 1 .orct121320#ffffff#fa951a#FFFFFF#e7b3513VERSON.docx
 
Demande forecasating
Demande forecasatingDemande forecasating
Demande forecasating
 
An Econometric Model for Inflation Rates in the Volta Region of Ghana
An Econometric Model for Inflation Rates in the Volta Region of GhanaAn Econometric Model for Inflation Rates in the Volta Region of Ghana
An Econometric Model for Inflation Rates in the Volta Region of Ghana
 
An Econometric Model for Inflation Rates in the Volta Region of Ghana
An Econometric Model for Inflation Rates in the Volta Region of GhanaAn Econometric Model for Inflation Rates in the Volta Region of Ghana
An Econometric Model for Inflation Rates in the Volta Region of Ghana
 
Time Series Data Analysis for Forecasting – A Literature Review
Time Series Data Analysis for Forecasting – A Literature ReviewTime Series Data Analysis for Forecasting – A Literature Review
Time Series Data Analysis for Forecasting – A Literature Review
 
vatter_wu_chavez_yu_2014
vatter_wu_chavez_yu_2014vatter_wu_chavez_yu_2014
vatter_wu_chavez_yu_2014
 
Real Exchange Returns and Real Stock Price Returns in Nigeria: An Econometric...
Real Exchange Returns and Real Stock Price Returns in Nigeria: An Econometric...Real Exchange Returns and Real Stock Price Returns in Nigeria: An Econometric...
Real Exchange Returns and Real Stock Price Returns in Nigeria: An Econometric...
 
Beamer slide(hfd)
Beamer slide(hfd)Beamer slide(hfd)
Beamer slide(hfd)
 
"Fuzzy based approach for weather advisory system”
"Fuzzy based approach for weather advisory system”"Fuzzy based approach for weather advisory system”
"Fuzzy based approach for weather advisory system”
 
M017369095
M017369095M017369095
M017369095
 
Hrm1
Hrm1Hrm1
Hrm1
 
Technology Forecasting - Monitoring and Intelligence Methods
Technology Forecasting - Monitoring and Intelligence MethodsTechnology Forecasting - Monitoring and Intelligence Methods
Technology Forecasting - Monitoring and Intelligence Methods
 
marketing group.docx
marketing group.docxmarketing group.docx
marketing group.docx
 
A var analysis of singapore's monetary transmission mechanism
A var analysis of singapore's monetary transmission mechanismA var analysis of singapore's monetary transmission mechanism
A var analysis of singapore's monetary transmission mechanism
 
Comparison of exponential smoothing and neural network method to forecast ric...
Comparison of exponential smoothing and neural network method to forecast ric...Comparison of exponential smoothing and neural network method to forecast ric...
Comparison of exponential smoothing and neural network method to forecast ric...
 

Daniel Thomson - Final

  • 1. 1 An Analysis of South African GDP using Fourier and Periodogram Methods1 UNIVERSITY OF CAPE TOWN An analysis of South African Gross Domestic Product using Fourier and periodogram methods Dissertation submitted in partial fulfillment of the requirements for the degree of Bachelor of Commerce (Honours) in Financial Analysis and Portfolio Management by Daniel Thomson (THMDAN008) Supervisor: Gary van Vuuren
  • 2. 2 An Analysis of South African GDP using Fourier and Periodogram Methods2 ABSTRACT This paper provides an alternative method of analysis to determine the length of the South Afri- can business cycle, as measured by changes in real gross domestic product. Using the spectral methods of Fourier series and periodogram analysis, the length of this cycle is found to be 7.11 years. We use this cycle to provide a one year forecast of GDP and compare it to observed data. We find promising forecast potential and demonstrate that forecast accuracy may be improved by including a greatly reduced number of cycle components than contained in the original se- ries. We conclude that Fourier analysis is effective in estimating the length of the business cycle, but is vague in determining the current position of the economy on the business cycle. The study proposes the use of wavelets to analyse macroeconomic data such as GDP as they do not suffer from many of the limitations of Fourier analysis and provide a representation of the data in the time and frequency domains simultaneously. Theauthor would like to thank his dissertation supervisor, Gary van Vuuren, for the ongoing sup- port, advice and expertise unselfishly given throughout the essay process. PLAGIARISM DECLARATION 1. I know that plagiarism is wrong. Plagiarism is to use another’s work and pretend that it is my own. 2. I have used the Harvard convention for citation and referencing. Each contribu- tion to, and quotation in this tutorial from the work(s) of other people has been contributed, and has been cited and referenced. 3. This dissertation represents my own work. 4. I have not allowed, and will not allow, anyone to copy my work. Signature: Daniel Thomson Date: Sunday, March 15, 2015
  • 3. 3 An Analysis of South African GDP using Fourier and Periodogram Methods3 1 Introduction 1.1 Spectral Analysis Methods In finance and economics, the predominant method of analysing time-series data is usu- ally to view these data in the time-domain, i.e., analysing changes of a series as it pro- gresses through time. The problem in using only this approach to study financial da- tasets is that all realisations are recorded at a predetermined frequency. This frequency corresponds to whichever period the realisations are recorded at and the implicit as- sumption is made that the relevant frequency to study the behaviour of the variable matches with its sampling frequency (Masset, 2008). This can be construed as analysing inflation figures with a one year time frame and presuming that the cycle will repeat it- self the following year as the cycle is presumed to be one year long. The realisations of financial and economic variables often depend on a number of frequency components rather than just one so the time-domain approach alone will not be able to process the information in the time-series precisely. Spectral analysis methods that enable a frequency-domain representation of the data, such as Fourier series and wavelet methods, are able to identify at which frequencies the time series-series variable is active. The strength of the activity may be measured using Fourier analysis to construct a periodogram – a graphic representation of the in- tensity of a frequency component potted against the period at which it occurs. This method is particularly attractive for the use of economic variables that exhibit cyclical behaviour as the cycle length may be identified using the Fourier transform. 1.2 The Business Cycle in South Africa Understanding the business cycle and having an approximate idea of its current position enables participants in the economy to make informed decisions. Because business cy- cle information is so valuable, much research has been done to identify its behaviour and the South African business cycle is no exception.1 In fact, owing to South Africa’s volatile political and economic history, modelling its behaviour provides a robust test to structural breaks and regime shifts of any technique.2 1.3 Problem Statement 1 See Du Plessis et. al (2014), Bosch and Ruch (2012) and Venter (2005). 2 As explained in Aaron & Muellbauer (2002) and Chevillon (2009).
  • 4. 4 An Analysis of South African GDP using Fourier and Periodogram Methods4 This paper will examine and attempt to forecast South African Gross Domestic Product (GDP) time-series data by applying Fourier series analysis. The author aims to identify potentially significant cycles present and quantify the length of these cycles by examin- ing the data in the frequency-domain rather than the time-domain, thus providing an alternative method of business cycle analysis to those in the literature. Using single fre- quency components or a combination will also provide an unprecedented perspective in South African GDP forecasting. A further aim of this paper is that it will be able to pave the way for further alternative methods of analysis of economic and financial variables, wavelets in particular, through highlighting potential limitations of pure frequency- domain analysis. The remainder of this paper is structured as follows. In Section 2, a brief literature re- view providing an overview of spectral methods applied to finance (Section 2.1) and previous attempts at modelling South African GDP (Section 2.2) is given. Section 3 pro- vides a description of the data used in the analysis (Section 3.1) and outlines the meth- odologies employed (Sections 3.2 – 3.5). The results and discussion of the problem (Sec- tions 4.1 – 4.2) are found in Section 4, where our forecasts are also found (Section 4.3). The conclusions (Section 5.1) and recommendations (Section 5.2) for further study can be found in Section 5.
  • 5. 5 An Analysis of South African GDP using Fourier and Periodogram Methods5 2 Literature review Spectral analysis methods have a broad range of applications in the real world. “Indeed, the Fourier integral formula…is regarded as one of the most fundamental result of mod- ern mathematical analysis, and it has widespread physical and engineering applica- tions” (Debnath, 2012) These include circuitry, spectroscopy, crystallography, imaging, signal processing, communications. Fourier series have more recently gained traction as a tool in finance and econometrics, from the early works of Granger (1966), Cunnyngham (1963), Nerlove (1964) and others on simple economic time series in the 1960s to modern day applications in derivative pricing and ground-breaking wavelet analysis. This literature review focuses on the application to finance and econometrics. In partic- ular, literature that describes practical uses of Fourier and Periodogram analysis as ap- plied to modelling and forecasting economic data is presented. In a first step, we review literature relating to spectral analysis and its application to economic time series by way of Fourier and Periodogram analysis. We begin with Ham- ilton (1994) and then include work with more emphasis on practical studies such as Liu et al. (2012) and Omekara, Ekpenyong and Ekrete (2013). In a second step, we investigate methods to model the South African business cycle and forecast the GDP. 2.1 Spectral analysis and application to economic time-series In his seminal work, Hamilton (1994) discussed spectral analysis and introduced the frequency domain. Hamilton (1994) also explained the concepts of the population spec- trum, the sample periodogram and estimation based on the population spectrum.3 An analysis of US manufacturing data demonstrated the use of spectral methods on real time series. Hamilton (1994) explains why adjustment (in the form of taking natural logs) of the data must be performed, owing to the assumptions of a covariance- stationary process4 implicit in the transform. To rid the data of seasonal effects which 3 Spectral analysis meaning the study of a variable over the frequency spectrum or frequency-domain. 4 For a mathematical definition of a covariance-stationary process, see Lindgren, Rootzén and Sandsten (2013).
  • 6. 6 An Analysis of South African GDP using Fourier and Periodogram Methods6 showed up in the periodogram, (Hamilton, 1994) suggested using year-on-year growth rates. Shumway and Stoffer (2000) provide a wide range of time series analysis techniques and applications, covering spectral analysis and filtering. A walk-through example on real data is provided and the chapter contains detailed explanations and illustrations including parametric and nonparametric estimation as mentioned in Masset (2008). For more general and theoretical work on spectral analysis, see Granger and Hatanaka (1964), Granger (1966) and Cunnyngham (1963). Practical studies involving the application of spectral methods to economic data are considered next. Granger & Morgenstern (1964) used Fourier analysis to study stock market prices on New York stock price series. Granger and Morgenstern (1964) found that stock prices followed the random-walk hypothesis in the short term, but long run components were owed greater consideration than the hypothesis suggests. A flat spec- trum of share price changes provided a non-parametric test of the random-walk hy- pothesis. Seasonal variation and the business-cycle components were found to be large- ly irrelevant in explaining the evolution of stock market prices. Praetz (1973) studied Australian share prices and share price indices in the frequency domain using spectral analysis methods. In contrast to the findings of Granger and Mor- genstern (1964), they found small departures from the random-walk hypothesis in their share price series from 1947 to 1968, although not large enough to abandon the hy- pothesis as ‘a crude first approximation.’ Some clearly defined seasonal patterns ap- peared in their study of share price indices and certain sectors were shown to lead or lag the market as a whole. This evidence contrasted in comparison to Granger and Mor- genstern’s (1964) and Godfrey, Granger and Morgenstern’s (1964) studies on the New York Stock Exchange and the London Stock Exchange, where such patterns and lags were far less significant. The authors gave a tentative conclusion that Australian share markets were less efficient than their overseas counterparts. Iacobucci (2003) elaborated on the issues of cross-spectral analysis and filtering, with typical concepts of coherency and phase spectrum being broached. He applied this anal- ysis to US inflation and unemployment data and showed that a Phillips relation existed at typical business cycle components of 14 and six years. In his analysis, he showed how cross-spectral analysis and filtering can be used to find correlation between the two fac-
  • 7. 7 An Analysis of South African GDP using Fourier and Periodogram Methods7 tors through the Phillips curve. An interesting result of this paper found that unem- ployment leads inflation with the lag of inflation being one year. Masset (2008) provided an easy-to-follow introduction to spectral and wavelet methods of analysis with many practical examples using real economic data. A spectral analysis on home prices in New York City covering the period January 1987 to May 2008 was performed using both parametric and non-parametric methods to show the subsequent difference in the power spectrum. It was found that the spectra from the non- parametric methods (Periodogram and Welch method) contained more noise than the spectra obtained from the parametric methods (Yule-Walker and Burg). The Fourier analysis of the data confirmed that strong seasonalities affected home prices in New York and had a particular frequency cycle of 12 months. The study then provided a dis- cussion on filtering, before a more detailed exposition on wavelet analysis was put for- ward as a way to overcome many of the shortfalls of Fourier transform and filtering methods. Liu et al. (2012) investigated business and growth cycles in the frequency domain by running Fourier analyses on several data sources including electricity demand, foreign currency data, monthly retail sales, quarterly GDP, labour market and productivity sta- tistics from Statistics New Zealand. In their analysis of the GDP data, the data were transformed using natural logarithms and detrended using the Hodrick-Prescott filter before conducting Fourier analysis of the detrended transformed data. Using a periodo- gram, definitive cycles corresponding to eight years and four-and-a-half years were found. Because of the distance between energy spikes in the periodogram for the aforementioned cycles, it was proposed that the cycle length varied between four-and- a-half to eight years. The paper concluded that Fourier analysis could be used to detect cyclical behaviour in any type of time series data, although they found no cyclical behav- iour in the majority of the time series data they had tested and omitted from this paper. Liu et al. (2012) proposed a natural extension to the paper on Fourier analysis, to wave- let analysis. Omekara, Ekpenyong and Ekrete (2013) used Fourier series analysis to identify cycles in the Nigerian all-items monthly inflation rates from 2003 to 2011. A square root trans- formation was used to increase stability and normality of the inflation rate data. Peri- odogram analysis showed a short term and a long term cycle of 20 months and 51
  • 8. 8 An Analysis of South African GDP using Fourier and Periodogram Methods8 months respectively with the long cycle corresponding to the length of two different government administrations that existed during the sample period. They then fitted a general Fourier series model to the data and used the model to make reasonably accu- rate short term monthly inflation rate forecasts from an out-of-sample period of Sep- tember 2011 to September 2012. More recent academic research (Masset, 2008 and Liu et al., 2012) of Fourier series of- ten leads to a recommendation of wavelet analysis as a natural extension to the limited, frequency-domain only methods such as Fourier transforms. Masset (2008) states that, “Both spectral analysis and standard filtering methods have two main drawbacks: (i) they impose strong restrictions regarding the possible processes underlying the dynam- ics of the series (e.g. stationarity), and, (ii) they lead to a pure frequency-domain repre- sentation of the data, i.e. all information from the time-domain representation is lost in the operation.” A large proportion of the literature surrounding spectral analysis re- volves around the study of wavelets, with Fourier analysis being part of the process of its development. This paper presents a practical application of Fourier analysis to South African GDP data and while a recommendation to further investigate these data using wavelet analysis is made, a thorough investigation and review of wavelet analysis is be- yond the scope of this study. 2.2 Models and forecasting methods applied to the SA business cycle and GDP Aron and Muellbauer (2002) developed a GDP forecasting model for South Africa to measure interest rate effects on output. They preferred multistep forecasting models to recursive forecasting with vector autoregressive (VAR) models because of the structural breaks present in the South African economy. The multistep model consisted of a factor model which was then evolved to a single equation equilibrium correction model with a built in term for the stochastic trend. The model made forecasts for up to four quarters and was tested for stability using sample breaks. Tests for normality and heteroscedas- ticity yielded satisfactory results and the authors concluded their model was robust. Chevillon (2009) draws on the research of Aron and Muellbauer (2002) and establishes whether direct multi-step estimation can improve the accuracy of forecasts. They set up 779 different models and applied them to South African GDP data to see which gave the
  • 9. 9 An Analysis of South African GDP using Fourier and Periodogram Methods9 most accurate forecasts and coped best with the large number of regime changes and structural breaks. They found that Aron and Muellbauer’s direct multi-step model per- formed best within short time horizons and that multivariate and univariate models, with DMS, worked well with intermediate to long term time horizons. Du Plessis, Smit and Steinbach (2014) developed a dynamic stochastic general equilib- rium (DSGE) model for the South African economy. The model uses Bayesian techniques to incorporate prior information about the economy into the parameter estimates. Its forecasting capability extends up to seven quarters and was tested against a panel of professional forecasters and a random walk. It was found to outperform the profession- al forecasters and the random walk, especially over longer time horizons, when used to predict CPI inflation and GDP growth. Venter (2005) discusses the methodology used by the South African Reserve Bank to identify business cycle turning points. He explains that this methodology includes the use of three composite business cycle indicators and two diffusion indexes. Leading, lagging and coincident indicators make up the composites while movement in historic and current diffusion indexes help to confirm whether changes in the economy are lo- calised or all-encompassing. Bosch and Ruch (2012) provided an alternative methodology to dating business cycle turning points in South Africa. They used a Markov switching model and Bry-Boschan method to date the turning points and found that the model estimates generally coin- cided with the business cycle turning points determined by the SARB. They applied the model to GDP data but also to 114 of the 186 stationary variables the SARB uses to date the business cycle.5 Using Principle Component Analysis (PCA) on these variables pro- vided the authors with correlation data that enabled a more accurate measure of the business cycle turning points than using GDP data alone.
  • 10. 10 An Analysis of South African GDP using Fourier and Periodogram Methods10 3 Data Description and Methodology 3.1 Data Description The data used are the GDP, measured in 2005 constant market prices, with monthly pe- riodicity and seasonally adjusted at an annual rate. The period used for the in-sample Fourier analysis is 28 February 1969 to 31 October 2011 and the period used for the out-of sample forecast is 30 November 2011 to 31 October 2014. These data were ob- tained from the South African Reserve Bank (SARB).6 GDP is defined by the SARB as “…the total value of all final goods and services produced within the boundaries of a country in a particular period.” This study seeks a simple and readily available proxy for South African economic activity from which to identify po- tentially meaningful cycles. GDP, although not a perfect measure of the business cycle (see Boehm and Summers, 1999), provides a reasonable measure of economic activity and the business cycle, over a satisfactory sample period. The Fourier analysis tool in Excel performs a Fast Fourier Transform (FFT) on data. This version of the Fourier Transform enables much faster computing, but restricts the num- ber of data points in the input to a power of two. Thus, the data selected are in monthly terms instead of quarterly points, so that the sample period may cover an appropriate time period of 512 months. 6 Available at: http://wwwrs.resbank.co.za/webindicators/SDDSDetail.aspx?DataItem=NRI6006D.
  • 11. 11 An Analysis of South African GDP using Fourier and Periodogram Methods11 4 Methodology 4.1 Remarks This section outlines the methodology used to generate the study results. The Hodrick- Prescott filter and the Baxter-King filter are described as time-domain methods to ex- tract the trend and cycle components of a time-series. The results of these are used for comparison to the frequency-domain approach used in this paper. We then show how the GDP time-series is stationarised and de-trended by taking their natural logarithms. The Fourier and periodogram analysis methods are explained with the defining equa- tions shown. Lastly, we describe the forecasting method employed to measure the accu- racy of certain frequency components in predicting GDP returns out to 12 months. 4.2 Time series filtering methods 4.2.1 The Hodrick-Prescott Filter Hodrick and Prescott (1997) showed a procedure for representing a time series 𝑋𝑡 as the sum of a smoothly-varying trend component 𝜏𝑡, and a cyclical component 𝑐𝑡, where, 𝑋𝑡 = 𝜏𝑡 + 𝑐𝑡 𝑡 = 1,2, … , 𝑇. They find the trend component 𝜏𝑡 by choosing a positive value of 𝜆 and solving for min{ ∑ ( 𝑦𝑡 − 𝜏𝑡)2 + 𝜆 ∑ [( 𝜏𝑡+1 − 𝜏𝑡 ) − ( 𝜏𝑡 − 𝜏𝑡−1 )2}𝑇 𝑡=2 𝑇 𝑡=1 . The parameter 𝜆 is a smooth- ing parameter which “penalises variability in the growth (trend) component series” (Hodrick and Prescott, 1997). The larger the value of 𝜆, the smoother is the output se- ries. The HP filter has been criticised for a number of limitations and undesirable properties (Ravn & Uhlig, 2002). Canova (1994 and 1998) found reason to use the HP filter to ex- tract business cycles from macroeconomic data of average length of four to six years, but was sceptical of the methodology used to determine key parameter inputs. Spurious cycles and distorted estimates of the cyclical component when using the HP filter were obtained by Harvey and Jaeger (1993). Cogley and Nason (1995) also found spurious cycles when using the HP filter on difference-stationary input data. Application of the HP filter to US time series data was found to alter measures of persistence, variability and co-movement dramatically (King and Rebelo, 1993). Many of these critiques do not provide sufficient compelling evidence to discourage use of the HP filter (van Vuuren, 2012). As a result, it remains widely-used among macroeconomists for detrending data
  • 12. 12 An Analysis of South African GDP using Fourier and Periodogram Methods12 which exhibit short term fluctuations superimposed on business cycle-like trends (Ravn & Uhlig, 2002). 4.2.2 The Baxter-King Filter In contrast to the HP filter, the Baxter and King (1999) filter introduced a third variable, ‘noise,’ to the time series equation. Consider a time series function 𝑋( 𝑡) consisting of 3 components: a trend component 𝜏, cyclical component 𝛾, and a ‘noise’ (random) component, 𝜖 such that 𝑋𝑡 = 𝜏𝑡 + 𝛾𝑡 + 𝜖𝑡 𝑡 = 1,2,… , 𝑇. The Baxter-King filter removes the trend and ‘noise’ components, leaving the cycle component. That is: 𝛾𝑡 = 𝑋𝑡 − 𝜏𝑡 − 𝜖𝑡 𝑡 = 1,2, …, 𝑇. Guay and St-Amant (2005) estimated the ability of the HP and BK filters to extract the business cycle component of macroeconomic time series using two different definitions of the business cycle component. They first defined the duration of a business cycle to be between six and 32 quarters, which is the definition of business cycle frequencies used by Baxter and King. The second definition is made by discerning between perma- nent and transitory components. Guay and St-Amant (2005) concluded that in both cas- es, the filters performed adequately when the spectrum of the original series had a peak at business-cycle frequencies. Low frequencies dominant in the spectrum were found to provide a distorted business cycle. Their results suggest that the use of HP and BK filters on series resembling the Granger shape of an economic variable may be problematic (Guay and St-Amant, 2005). We perform Fourier analysis on the cyclical components of the HP filter and the BK fil- ter, 𝑐𝑡 & 𝛾𝑡 , for comparison and discuss the results in the next section. 4.3 Data Stationarity Masset (2009) states that spectral methods such as Fourier transforms “…require the data under investigation to be stationary.”7 In the literature, stationarity usually means weak stationarity (covariance-stationary), unless otherwise specified. An augmented Dickey-Fuller (ADF) test, used widely in statistics and econometrics, can be used to 7 For a comprehensive definition of strict stationarity and weak stationarity, see (Pelagatti, 2013)
  • 13. 13 An Analysis of South African GDP using Fourier and Periodogram Methods13 check for this condition. The results obtained from the ADF test on nominal GDP data used failed to reject the null hypothesis that the index levels series is non-stationary. We therefore take the natural logarithms of the time-series: ln( 𝑥 𝑡)− ln(𝑥 𝑡−1) where 𝑥 𝑡 and 𝑥 𝑡−1 are consecutive months in the series. This transformation means we are studying the returns of the monthly GDP data, a sta- tionary series. 4.4 Fourier Analysis The basic idea of spectral analysis is to re-express the original time-series 𝑥( 𝑡) as a new sequence 𝑋( 𝑓), which determines the importance of each new frequency component 𝑓 in the dynamics of the original series (Masset, 2008). This is achieved by using the dis- crete version of the Fourier transform, which decomposes a periodic signal into its con- stituent frequencies. Time series data that comprise periodic components can be writ- ten as a sum of simple waves (that is oscillations of a single frequency) represented by sine and cosine functions (Brown and Churchill, 1993). A Fourier series is an expansion of a periodic function in terms of an infinite sum of sines and cosines by making use of the orthogonality relationships of the sine and cosine functions (Askey and Haimo, 1996). The generalised Fourier series, obtained using the functions 𝑓1( 𝑥)= cos 𝑥and 𝑓2( 𝑥) = sin 𝑥 (which form a complete orthogonal system over [−𝜋, 𝜋]) gives the Fourier series of a function𝑓( 𝑥): 𝑓( 𝑥) = 1 2 𝑎0 + ∑ 𝑎 𝑛 ∞ 𝑛=1 cos( 𝑛𝑥) + ∑ 𝑏 𝑛 sin(𝑛𝑥) ∞ 𝑛=1 where 𝑎0 = 1 𝜋 ∫ 𝑓( 𝑥) 𝑑𝑥 𝜋 −𝜋 𝑎 𝑛 = 1 𝜋 ∫ 𝑓( 𝑥)cos( 𝑛𝑥) 𝑑𝑥 𝜋 −𝜋 𝑏 𝑛 = 1 𝜋 ∫ 𝑓( 𝑥)sin( 𝑛𝑥) 𝑑𝑥 𝜋 −𝜋
  • 14. 14 An Analysis of South African GDP using Fourier and Periodogram Methods14 For a function 𝑓(𝑥) periodic on an interval [0,2L] instead of [−𝜋, 𝜋] , a simple change of variables can be used to transform the interval of integration from [−𝜋, 𝜋] to [0,2L]. Let 𝑥 = 𝜋𝑥′ 𝐿 and 𝑑𝑥 = 𝜋𝑑𝑥′ 𝐿 Solving for 𝑥′ and substituting into Equation 3 gives (Krantz, 1999): 𝑓( 𝑥′) = 1 2 𝑎0 + ∑ 𝑎 𝑛 ∞ 𝑛=1 cos( 𝑛𝜋𝑥′ 𝐿 ) + ∑ 𝑏 𝑛 sin( 𝑛𝜋𝑥′ 𝐿 ) ∞ 𝑛=1 where 𝑎0 = 1 𝐿 ∫ 𝑓( 𝑥′) 𝑑𝑥 2𝐿 0 𝑎 𝑛 = 1 𝐿 ∫ 𝑓( 𝑥′)cos( 𝑛𝜋𝑥′ 𝐿 ) 𝑑𝑥 2𝐿 0 𝑏 𝑛 = 1 𝐿 ∫ 𝑓( 𝑥′)sin ( 𝑛𝜋𝑥′ 𝐿 ) 𝑑𝑥. 2𝐿 0 A periodogram plotting those frequency components with the greatest intensity or am- plitude against the period shows which components bear significant meaning and which components are random ‘noise.’ In cyclical data, it may be found that a few frequencies are able to model the behaviour of the series relatively accurately. “The ‘noise’ (low am- plitude) frequencies may be discarded and a new, ‘cleaner’ time-series –free of noise and comprising only time-series signals characterised by the dominant frequencies-may thus be constructed (van Vuuren, 2014).” 4.5 A forecast of GDP We make a forecast using the most important (highest amplitude) frequency compo- nents to test the fit of these components to out-of-sample GDP data. A 12 month forecast is shown in the results section. We used a fan chart with bounds equal to the standard deviation scaled with the square root of time out to 12 months. Both one standard devia- tion and two standard deviations are used to model the error bands. Forecasts using (a) the highest amplitude wave, (b) highest and second highest ampli- tude waves and (c) first five highest amplitude waves are constructed.
  • 15. 15 An Analysis of South African GDP using Fourier and Periodogram Methods15 5 Results and Discussion 5.1 Results 5.1.1 Data The data are a time-series of seasonally adjusted, nominal GDP in millions of Rands, tak- en monthly from February 1971 to September 2013. In Figure 1 it is clear that an up- ward trend exists, although cyclical variations are difficult to discern. The discrete Fou- rier transform assumes that the input signal (GDP time-series) is statistically stationary, i.e. it has a constant mean through time. This is a fair assumption, because if the data were taken as is (due to the convex growth curve), vastly more weight would be given to more recent fluctuations as the scale has increased greatly in the latter years, relative to the initial years. This would not be an accurate representation of the time series and the Fourier analysis would not effectively identify cycles. Figure 1: Nominal GDP in Millions of Rands, seasonally adjusted from February 1971 to September 2013. Source: South African ReserveBank8 We performed an ADF test shown in Table 1 to confirm the data were non-stationary. The ADF test examines the inputs for the existence of a unit-root in the context of a hy- pothesis test. If a unit-root exists, we reject the null hypothesis and accept the alterna- tive hypothesis that this root exists. The results showed that our assumption was cor- rect and that we needed to perform a transformation to stationarise the data. To stationarise the data, the natural logarithm difference from month to month was cal- culated to produce the percentage returns series shown in Figure 2. These returns do 8 Available at: http://wwwrs.resbank.co.za/webindicators/SDDSDetail.aspx?DataItem=NRI6006. 0.0 0.5 1.0 1.5 2.0 2.5 3.0 Jan-70 Jan-74 Jan-78 Jan-82 Jan-86 Jan-90 Jan-94 Jan-98 Jan-02 Jan-06 Jan-10 Jan-14 Rand(Trillion) Monthly nominal GDP February 1971 - September 2013
  • 16. 16 An Analysis of South African GDP using Fourier and Periodogram Methods16 not scale with time and have a non-trending mean, so these are suitable for use in the Fourier analysis framework. Figure 2: De-trended GDP returns series using first differences. Source: Author’s calculations In the case of returns over the sample period from February 1971 to September 2013, the mean monthly return is 1.05%. This positive average produces the upward ‘trend’ observed in the monthly GDP level in Figure 1. We are interested in identifying the cy- clical changes around this trend. Because of the volatility in the returns series, we apply two filtering methods which ex- tract the trend and cycle components from the series and produce a smoother returns series. These are the Hodrick-Prescott Filter and the Baxter-King Filter. The log returns series is plotted alongside the filtered series in Figure 3. A table of summary statistics illustrating the effectiveness of the filters in capturing the trend and filtering through the noise is shown in Table 2 below. -2% -1% 0% 1% 2% 3% 4% 5% Jan-70 Jan-74 Jan-78 Jan-82 Jan-86 Jan-90 Jan-94 Jan-98 Jan-02 Jan-06 Jan-10 Jan-14 Returns(%) Log Returns of Monthly GDP February 1971 - September 2013
  • 17. 17 An Analysis of South African GDP using Fourier and Periodogram Methods17 Figure 3: De-trended GDP series comparison with Hodrick-Prescott filtered series and Baxter-King filtered series. Source: Authors calculations usingNumXL software. Table 2: Summary statistics illustrating the effects of filtering The standard deviation of the log returns series is 0.64%, whilst the HP and BK filtered series produce less variation with standard deviations of 0.33% and 0.36% respectively. The filtered data also contain less excess kurtosis than the unfiltered returns series while there is a positive skew in the unfiltered series and negative skew of less magni- tude in the filtered series. A Bera-Jarque test of normality (Table 3) confirmed that the data were not normally distributed. Severe excess-kurtosis and a positive skew, shown in a histogram plot with a normal distribution curve for comparison in Figure 4 below, characterise the monthly GDP returns series. -2% -1% 0% 1% 2% 3% 4% 5% Jan-70 Jan-74 Jan-78 Jan-82 Jan-86 Jan-90 Jan-94 Jan-98 Jan-02 Jan-06 Jan-10 Jan-14 MonthlyReturns Returns Series February 1971 - September 2013 LogReturns HP Filter BK Filter Log Return HP Filter BK Filter Mean 1.05% 1.05% 1.05% Standard Deviation 0.64% 0.33% 0.36% Skewness 1.21 -0.62 -0.13 Excess Kurtosis 6.44 0.92 0.94 Summary Statistics
  • 18. 18 An Analysis of South African GDP using Fourier and Periodogram Methods18 Figure 4: Frequency distribution of log returns series compared with the normal distri- bution curve. Source: Authors calculation usingNumXL software. Valueintervals on thehorizontal axis aredetermined bytheFreedman-Diaconis choicebin rulein NumXL. 5.1.2 Fourier Analysis Using the discrete version of the Fourier transform, the time-series of GDP returns is transformed from a representation in the time-domain into the frequency-domain. The time-series is decomposed into a series of sine and cosine waves occurring at different frequencies with different intensities,9 which in summation are able to exactly mimic the behaviour of the original signal. The power or amplitude of each frequency component (which explains the importance of the particular frequency in making up the original signal) is plotted against its period in Figure 5 below. The period is defined as 1 frequency and is shown in months. The filtered series show much less static than the unfiltered series as they rid the data of random deviations or ‘noise.' The periodogram omits peri- ods longer than 180 months, which distort our analysis. 9 Intensity, power and amplitude are used inter-changeably. 0% 5% 10% 15% 20% 25% -1.6% -1.1% -0.5% 0.1% 0.6% 1.2% 1.8% 2.3% 2.9% 3.4% 4.0% Frequency Return (%) Distributionof Returns February 1971 - September 2013 Frequency Normal
  • 19. 19 An Analysis of South African GDP using Fourier and Periodogram Methods19 Figure 5: Periodogram plotting power against period of transformed returns data, HP filtered data and BK filtered data Source: Authors calculations. In Figure 6 below, we consider the 15 frequencies with the highest intensities. Beyond these and including the frequencies with lesser amplitude below, the remaining fre- quencies are pure random ‘noise’ and do not help in explaining the business cycle. Figure 6: Bar graph showing the 15 components with the highest amplitude. Source: van Vuuren (2014). There are two clearly dominant frequencies above, which differ substantially from the others. These are at a period of 512.0 and 85.3 months, or frequencies of 0.00195 and 0.01172 cycles per month respectively. In simple terms, the periodogram states that one cycle occurs per given period. For the period of 85.3 months, this means that 1 cycle occurs every 85.3 months. Similarly, the model states that 1 cycle occurs every 512.0 months. The entire length of the sample data set is made up of 512 months however, so 0.00% 0.02% 0.04% 0.06% 0.08% 0.10% 0.12% 0.14% 0 20 40 60 80 100 120 140 160 180 Power(Amplitude) Period (months) Periodogramof ReturnsLog Returns HP filtered BK filtered 512 85.3 64 13.8 170.7 102.4 24.4 17.7 6.1 12.5 34.1 16 25.6 73.1 256 0.00% 0.05% 0.10% 0.15% 0.20% 0.25% 0.30% 0.35% Amplitude(%) Cycle period (months) Components rankedby amplitude
  • 20. 20 An Analysis of South African GDP using Fourier and Periodogram Methods20 naturally, one cycle would occur that covers this period and this cycle is not necessarily repetitive. This all-encompassing cycle has harmonic waves of 2 𝑛 and includes cycles occurring at periods of 2, 4, 8, 16, 32, 64, 128, 256 and 512. In Figure 6, the harmonics occurring at 16, 64, 256 and 512 months are all included in the 15 highest power com- ponents. There is no literature regarding the South African business cycle as having a period of 512 , 256 or 64 months, but Botha (2004) found evidence that a cycle exists and that cycle lasted 7.00 years. Her result serves as evidence for us to reject the cycles at the harmonics of 2 𝑛 periods and focus on the period of 85.33 months, corresponding to a period of 7.11 years. 5.1.3 Forecast Potential Using the frequencies with the highest relative power in the dataset, we produce a 12 month forecast and compare it to out-of-sample data of the same period. Figure 7 shows a 12 month forecast from October 2013 to October 2014 using the single frequency component with period of 85.33 months or 7.11 years. This frequency showed the highest amplitude (0.3%) in the Fourier analysis. Our model error bands are produced by multiplying the standard deviation of the reconstructed input signal with the square root of time from the last in-sample data point. In this case, September 2013 is the last data point. This product is then added and subtracted from the input signal return to produce a ‘fan-like’ forecast zone, implying that the accuracy of the forecast decreases as one projects further into the future. Lastly, out-of-sample ob- served data from October 2013 to October 2014 are plotted alongside the forecast framework.
  • 21. 21 An Analysis of South African GDP using Fourier and Periodogram Methods21 Figure 7: Fan chart showing the 85.33 period reconstructed signal with error bands of one standard deviation scaled with the square root of time against observed out-of- sample GDP returns from October 2013 to October 2014. Source: van Vuuren (2014). Figure 7 clearly shows that the observed data do not fall within the forecast zone for the majority of the 12 month time horizon forecast. The standard deviation of returns from the reconstructed input signal to September 2013 is 0.18%, whilst the standard devia- tion of the observed data is 0.64% and 0.54% in the out-of-sample 12-month period. This volatility distorts the effectiveness of the forecast and for this reason we recom- mend using quarterly GDP data and moving averages in future studies to smooth the effects of short-term fluctuations, in line with Botha (2004) who states that “Statistics on a daily, weekly or monthly basis tend to contain too much static.” Sherman and Kolk (1996) assert that the best time interval to use in cyclical analysis is quarterly data. Because our log transformation of the data rendered the returns time-series approxi- mately normal, we operate on the assumption that about two-thirds (0.683) of the monthly returns should fall between one standard deviation above and below the mean value of our reconstructed signal. In Figure 8 below, we use error bands based on two standard deviations to be 95% confident of our forecast model values. Figure 8: Fan chart showing the 85.33 period reconstructed signal with error bands of two standard deviations scaled with the square root of time against observed out-of- sample GDP returns from October 2013 to October 2014. -1.0% -0.5% 0.0% 0.5% 1.0% 1.5% 2.0% 2.5% 3.0% 3.5% Jun-13 Aug-13 Oct-13 Dec-13 Feb-14 Apr-14 Jun-14 Aug-14 Oct-14 MonthlyReturns Forecast using 1 cycle component and1 standarddeviationerror bands Observed GDP ±1
  • 22. 22 An Analysis of South African GDP using Fourier and Periodogram Methods22 Source: Authors calculations. At the 95% level of confidence, the forecast using the 7.11 year, single-period frequency still fails to encapsulate the values for the 12 months of real data. We now show the effect of adding a further sine wave with the second highest ampli- tude to the forecast model in Figure 9. This sine wave has a much shorter wavelength of period 13.84 months (1.15 years) and a higher frequency (0.072 cycles per month). It acts to convolute the original sine wave and error bands. Figure 9(a) shows error bands of one standard deviation and (b) shows error bands of two standard deviations, scaled with the square root of time, as before. Figure 9: Fan chart showing reconstructed signal using first two components plotted against observed out-of-sample GDP returns from October 2013 to October 2014: (a) shows error bands of one standard deviation, (b) shows bands of two standard devia- tions. (a) -1.0% -0.5% 0.0% 0.5% 1.0% 1.5% 2.0% 2.5% 3.0% 3.5% Jun-13 Aug-13 Oct-13 Dec-13 Feb-14 Apr-14 Jun-14 Aug-14 Oct-14 MonthlyReturns Forecast using 1 cycle component and2 standarddeviationerror bands Observed GDP 1 component forecast ±2 -1.0% -0.5% 0.0% 0.5% 1.0% 1.5% 2.0% 2.5% 3.0% 3.5% Jun-13 Aug-13 Oct-13 Dec-13 Feb-14 Apr-14 Jun-14 Aug-14 Oct-14 MonthlyReturns Forecast using 2 cycle components and1 standarddeviationerror bands Observed GDP 2 component forecast±1
  • 23. 23 An Analysis of South African GDP using Fourier and Periodogram Methods23 Source: Authors calculations. (b) Source: Authors calculations. Including every one of the 512 sinusoidal waves will fully replicate or reconstruct the observed signal. By adding consecutive waves, the reconstructed signal resembles the observed signal more closely. Thus, the sine wave of period 1.15 years added to the wave of 7.11 years produces a forecast signal which mimic the in-sample data more ac- curately. Whilst in (a) it is difficult to see any improvement in the observed data falling within the forecast zone, the result in (b) encapsulates a greater proportion of the ob- served signal than when only the first sine wave was used. Finally, we show the forecast based on the first five significant frequencies in Figure 10 and see that there is little improvement from including a further three frequency com- ponents. Each additional wave added has less amplitude or significance in explaining the original time-series, so the marginal gains from including more waves diminishes the more waves we add: -1.0% -0.5% 0.0% 0.5% 1.0% 1.5% 2.0% 2.5% 3.0% 3.5% Jun-13 Aug-13 Oct-13 Dec-13 Feb-14 Apr-14 Jun-14 Aug-14 Oct-14 MonthlyReturns Forecast using 2 cycle components and2 standarddeviationerror bands Observed GDP 2 component forecast ±2
  • 24. 24 An Analysis of South African GDP using Fourier and Periodogram Methods24 Figure 10: Fan chart showing reconstructed signal using first five components plotted against observed out-of-sample GDP returns from October 2013 to October 2014: (a) shows error bands of one standard deviation, (b) shows two standard deviations. (a) Source: Authors calculations. (b) Source: Authors calculations 5.2 Discussion 5.2.1 Summary of Results Spectral analysis provides an alternative method of, in this case, business cycle analysis, to the traditional method used by the South African Reserve Bank and Venter (2005) of micro and macro-economic indicators which lead, coincide with and lag the economy. The result of this study, from 512 months of GDP data, showed that a significant cycle exists with a period of 7.11 years over the period February 1971 to September 2013. -1.0% -0.5% 0.0% 0.5% 1.0% 1.5% 2.0% 2.5% 3.0% 3.5% Jun-13 Aug-13 Oct-13 Dec-13 Feb-14 Apr-14 Jun-14 Aug-14 Oct-14 MonthlyReturns Forecast using 5 cycle components and1 standarddeviationerror bands Observed GDP 5 component forecast ±1 -1.0% -0.5% 0.0% 0.5% 1.0% 1.5% 2.0% 2.5% 3.0% 3.5% Jun-13 Aug-13 Oct-13 Dec-13 Feb-14 Apr-14 Jun-14 Aug-14 Oct-14 MonthlyReturns Forecast using 5 cycle components and2 standarddeviationerror bands Observed GDP 5 component forecast ±2
  • 25. 25 An Analysis of South African GDP using Fourier and Periodogram Methods25 We found the 3rd highest power frequency component to have a period twice that of the component with the highest frequency and put forward that this is a harmonic of the 85.33 month cycle and not a significant cycle of its own. 5.2.2 Forecast Accuracy Forecasting using the established seven year cycle with a frequency of 0.01172 cycles per month and including up to five frequencies returned somewhat disappointing re- sults. Examining the data in Figure 11 below, it is clear that the majority of returns (81%) are between one standard deviation above and below the mean value of 1.06%. However, in the time period of the forecast, returns were out of this range as shown in Figure 12. Figure 11: De-trended GDP returns series showing the historic mean with one standard deviation above and below the mean from February 1971 to October 2014. Source: Authors calculations. -1.75% -0.75% 0.25% 1.25% 2.25% 3.25% 4.25% 5.25% Jan-70 Jan-74 Jan-78 Jan-82 Jan-86 Jan-90 Jan-94 Jan-98 Jan-02 Jan-06 Jan-10 Jan-14 MonthlyReturns Historic StandardDeviationof Returns Observed GDP Mean ±1
  • 26. 26 An Analysis of South African GDP using Fourier and Periodogram Methods26 Figure 12: De-trended GDP returns series showing the historic mean with one standard deviation above and below the mean from the 12 months before the forecast period be- gins in October 2013 to October 2014. Source: Authors calculations. Viewing the time series as being made up of a general trend, cyclical component and er- ror component, one may investigate the behaviour of each of these as in Omekara (2013). They assessed each component separately before putting them together to form a forecast equation. Specifically, they estimated the error component by assessing the autocorrelation function of the residual for randomness. If the residual is not random, as in their case, a first order autoregressive model may be fitted to the error values (Omekara, 2013). The Baxter-King filter separates a time-series into the three compo- nents mentioned, but it is critical to use the appropriate parameters in the filter to pro- duce meaningful results. Further studies may be able to establish these parameters and use the BK filtered data to run Fourier analysis. If serial autocorrelation is present in the error component and can be taken into account via an autoregressive model as part of the forecast equation, the forecast accuracy may improve. 5.2.3 Dating the Cycle Fourier analysis does not identify the start and end points of a cycle. Liu et al. (2012) contend that with the length of a cycle identified, one can infer the start and end points. This is the reverse of the method used in Bry and Boschan (1971), where the length of a cycle is inferred by finding the start and end points first. This paper does not attempt to provide turning point dates and business cycle phase changes as in Botha (2004), alt- hough further study over a longer time period using the first few ‘important’ frequency -1.0% -0.5% 0.0% 0.5% 1.0% 1.5% 2.0% Sep-12 Jan-13 May-13 Sep-13 Jan-14 May-14 Sep-14 MonthlyReturns Historic StandardDeviationof Returns October 2012-October 2014 Observed GDP Mean ±1
  • 27. 27 An Analysis of South African GDP using Fourier and Periodogram Methods27 components may provide useful insight in dating previous business cycles. Use of quar- terly data and moving average or filtering methods would help to control the volatility that characterises the monthly data in this study. 5.2.4 Comments on the data The Discrete Fourier Transform tool in Excel (Cooley-Tukey version) requires 2 𝑛 data inputs up to a maximum of 512 entries. It is for this reason that we chose monthly fig- ures and not quarterly figures, as 512 quarters of GDP data are not easily available. The problem statement of this paper was to measure and forecast South African GDP cycles using Fourier analysis. Over the period used in the analysis, many structural breaks, sanctions imposed and lifted, and regime shifts have taken place as noted in Aaron & Muellbauer (2002) and Chevillon (2009). These have had destabilising effects on the economy of South Africa and are reflected in the GDP data under review. Fourier analy- sis identified a clear seven year cycle but much noise was present, making forecasting using the single cycle rather inaccurate and ineffective in coping with volatile breaks in the data.
  • 28. 28 An Analysis of South African GDP using Fourier and Periodogram Methods28 6 Conclusion and Recommendations 6.1 Conclusion Using Fourier and periodogram analysis to study South African GDP from February 1971 to September 2013, this paper showed that a clear individual cycle existed, lasting approximately seven years. This result, though obtained using an alternative quantita- tive approach, compares favourably with the result of Botha (2004), who found a seven year cycle in quarterly South African GDP from 1961 to 2003. We found that a simple log transformation enables the use of Fourier analysis methods and that filtering using the Hodrick-Prescott and Baxter-King filters helps to get rid of the majority of random ‘noise’ whilst still preserving the integrity of explanatory cycles present in the data. Forecasting using solely the frequency component corresponding to the seven year pe- riod showed limited usefulness when compared to observed data in the forecast period. We showed that the conviction of a forecast can be improved by increasing the error bands of the forecast from one standard deviation to two standard deviations. The results also showed that forecast accuracy improves as successive frequency com- ponents with the next highest amplitudes are added to the seven year base wavelength. These improvements show diminishing marginal utility as lower amplitudes are used. 6.2 Recommendations for further study 6.2.1 Business Cycle Data Representation This paper used nominal GDP as a proxy for the SA business cycle. GDP growth is termed as “the most natural indicator” of an economy’s aggregate business cycle by the Basel Committee for Banking Supervision (BCBS), however, a number of macroeconom- ic indicators with useful business cycle information could have been used. These include aggregate real credit growth, the credit-to-real GDP growth ratio and the leading, lag- ging and co-incident indicators used by the SARB to measure the business cycle. The BCBS considers real credit growth as a “natural measure of supply” since boom periods leading to a peak in the business cycle are characterized by rapid credit expansion and credit contraction has typically heralded credit crunches (van Vuuren, 2012). For a comprehensive study of the use of Fourier series methods in detecting the length and timing of South african business cycles, the above data should also be analysed.
  • 29. 29 An Analysis of South African GDP using Fourier and Periodogram Methods29 6.2.2 Data Selection We found that monthly data contained too much variation. Quarterly data combined with the use of weighted moving averages and filtering would help to smooth volatility in the short term and should be considered in further studies. Using the Discrete Fourier Transform tool in Excel requires that the number of inputs be a multiple of 2 𝑛 . We rec- ommend, in the South African case, using 256 quarters (768 months) to ensure the reli- ability of the results, with the caveat that economic, environmental and political factors may have changed considerably over this period. 6.2.3 Method of Return Calculation This paper calculated returns by taking the natural logarithms of month-to-month GDP levels and not month-on-month returns. Our method produces monthly changes with less autocorrelation than using month-on-month data, which gives an annual change. Post study, the author generated a periodogram by the same methods, using month-on- month data and found the seven year cycle with the same intensity as a result, although the 13.8 month cycle which had the second highest amplitude was not present as a rele- vant frequency component. 6.2.4 Power Spectrum Estimation 6.2.5 This paper made use of the non-parametric, periodogram method to calculate the power of a frequency component. Masset (2008) compared the parametric methods of Yule-Walker and Burg and the non-parametric methods of the peri- odogram and Welch method. The non-parametric methods contained more ‘noise’ over the spectrum and the difference between the periodogram and Welch method was much greater than the difference in the parametric methods. Preceding Fourier analysis, one should ensure the most suitable method to esti- mate the power spectrum is used or provide a comparison of the results before further analysis. Forecasting Issues Separate modelling of the components of the time-series This paper made use of unfiltered returns data as the Fourier tool used was able to separate the cyclical components from the general trend internally. However, using the Baxter-King filtered returns or any method that can separate the trend, cycle and error components of a time series will allow future studies to attempt to model the error
  • 30. 30 An Analysis of South African GDP using Fourier and Periodogram Methods30 component identified if it is not random, as in Omekara (2013). This may improve the accuracy of forecasts. Determining the current position of the economy on the business cycle The methods used to determine the length of the SA business cycle provided satisfacto- ry results in this paper, but ascertaining the approximate current position of the econ- omy on the business cycle was not addressed in full. For this purpose, further studies should include Fourier analysis and forecasting of various measures of the business cy- cle, not only the rate of GDP growth. Phase differences between leading, lagging and co- incident cycles may provide valuable information to pin-point the current position of the economy and a composite cycle of such indicators may provide a more accurate forecast. Statistical Measurement of Forecast Accuracy The forecasts in this paper were not tested by any statistical measure of significance and thus cannot be compared to other forecast tools. Although testing may become rig- orous, at a minimum, we suggest testing for correlation and performing a simple regres- sion to predict future GDP returns based on the path of the reconstructed signal. A mul- tiple regression hypothesis test may yield helpful results regarding the significance of each frequency component in predicting future values. The author found that the peri- odogram performed this function by ordering components according to amplitude, but a multiple regression could prove this statistically. 6.2.6 Wavelets Wavelets are relatively new tools in economics and finance. They are a very attractive way of analysing financial datasets as they are able to represent data series from both the time and frequency perspectives simultaneously. Hence, they permit to break down the activity of the market into different frequency components and to study the dynam- ics of each of these components separately. They do not suffer from some of the limita- tions of standard frequency-domain methods, like Fourier anlaysis used in this paper, and can be employed to study a financial variable, whose evolution through time is dic- tated by the interaction of a variety of different frequency components. These compo- nents may behave according to non-trivial (non-cyclical) dynamics – e.g., regime shifts,
  • 31. 31 An Analysis of South African GDP using Fourier and Periodogram Methods31 jumps, long-term trends (Masset, 2008).10 Due to the complex nature and presence of such non-trivial dynamics in South African GDP data under study, the author strongly suggests using wavelet analysis on South African and other similar GDP datasets which are characterised by non-cyclical dynamics. 10 For a non-technical introduction to wavelets and their benefits compared to pure-frequency domain analysis, see Masset (2008).
  • 32. 32 An Analysis of South African GDP using Fourier and Periodogram Methods32 Bibliography Baxter, M., & King, R.G., 1999. Measuring business cycles: approximate band-pass filters for economic time series. The Review of Economics and Statistics, 81(4), 575-593. Bry, G., & Boschan, C., 1971. Cyclical analysis of time series: selected procedures and com- puter programs. New York: Columbia University Press. Bosch, A., and Ruch, F., 2013. An Alternative Business Cycle Dating Procedure for South Africa. South African Journal of Economics, 81: 491–516. Canova, F., 1994. Detrending and turning points. European Economic Review, 38(3-4), 614-623. Canova, F., 1998. Detrending the business cycle. Journal of Monetary Economics, 41, 475- 512. Chevillon, G., 2009. Multi-step forecasting in emerging economies: An investigation of the South African GDP. International Journal of Forecasting, 25(3), pp.602–628. Cogley, T., & Nason, J. M., 1995. Effects of the Hodrick-Prescott Filter on trend and difference stationarytime series: implications for business cycle research. Journal of Economic Dynamics and Control, 19, 253-278. Cunnyngham, J., 1963. Spectral analysis of time series. Working Paper No. 16, U.S. Department of Commerce, Bureau of Census, New York. Debnath, L., 2011. A short biography of Joseph Fourier and historical development of Fourier series and Fourier transforms. International Journal of Mathematical Education in Science and Technology, 43(5), pp.1–24. Granger, C.W.J., 1966. The typical spectral shape of an economic variable. Econometrica, 34(1), 150-161 Granger, C.W.J., & Morgenstern., 1964. Spectral Analysis of Stock Market Prices. Kyklos, 34(1), 150-161. Guay, A., and St-Amant, P., 2005. Do the Hodrick-Prescott and Baxter-King filters Provide a Good Approximation of Business Cycles? Annales d'Economie et de Statistique, No. 77 (Jan. - March., 2005) pp. 133-155 Hamilton, J.D., 1994. Time Series Analysis, Princeton. Harvey, A. C., & Jaeger, A., 1993. Detrending, stylized facts and the business cycle. Journal of Applied Econometrics, 8, 231-247. Hodrick, R.J., & Prescott, E.C., 1997. Postwar U.S. business cycles: an empirical investigation. Journal of Money, Credit, and Banking, 29(1), 1-16. Iacobucci, A., 2003. Spectral Analysis for Economic Time Series, Documents de Travail de I'OFCE. Aron, J., and Muellbauer, J., 2002. Evidence from a GDP Forecasting Model For South Africa IMF Staff Papers , Vol . 49 , IMF Annual Research Conference ( 2002 ), pp . 185- 213 King, R. G., & Rebelo, S. T., 1993. Low frequency filtering and real business cycles. Journal of Economic Dynamics and Control, 17(1-2), 207-231.
  • 33. 33 An Analysis of South African GDP using Fourier and Periodogram Methods33 Lindgren, G., Rootzén, H and Sandsten, M., 2013. Stationary stochastic processes for sci- entists and engineers. Chapman and Hall, USA, 200p. Liu, L., Paki, E., Stonehouse, J., and You, J.,, 2012. Cycle Identification : An old approach to ( relatively ) new statistics. NZAE Annual Conference, Statistics New Zealand Masset, P., 2008. Analysis of Financial Time-series using Fourier and Wavelet Methods. … )-Faculty of Economics and Social Science, (October), pp.1–36. Available at: https://psutn2009.googlecode.com/svn-history/r5/trunk/SSRN-id1289420.pdf. Nerlove, M., 1964. Spectral analysis of seasonal adjustment procedures. Econometrica, 32: 241-286. Omekara, C. O., Ekpenyong, E., J., and Ekrete, M., P., 20142014. Modelling the Nigerian Inflation Rates Using Periodogram and Fourier Series Analysis .[pdf] Lagos: Nigerian Central Bank. Plessis, S., Smit, B. & Steinbach, R., 2014. South African Reserve Bank Working Paper Series A medium - sized open economy DSGE model of South Africa. , (July). Praetz, P.D., 1973. A spectral analysis of Australian share prices. Australian Economic Pa- pers, 12: 70–78. doi: 10.1111/j.1467-8454.1973.tb00296.x Ravn, M. O., & Uhlig, H., 2002. On Adjusting the Hodrick Prescott Filter for the Frequency of Observations. The Review of Economics and Statistics, 84(2), 371-375. Shumway, R.H. & Stoffer, D.S., 2000. Time Series Analysis and Its Applications, Available at: http://www.springer.com/statistics/statistical+theory+and+methods/book/978-0- 387-29317-2. Telser, L.G., Granger, C.W.J. & Hatanaka, M., 1967. Spectral Analysis of Economic Time Series. Journal of the American Statistical Association, 62(November), p.687. Available at: http://www.jstor.org/stable/2283996?origin=crossref. Venter, J.C., 2005. Reference Turning Points in the South African Business Cycle: Recent Developments. SARB Quarterly Bulletin, (September), pp.61–70. Available at: http://www.esaf.org/internet/Publication.nsf/LADV/EE79538CB86F96DA422570830 04E8875/$File/ART092005.pdfnhttp://www.oecd.org/dataoecd/54/26/34898202.p df. van Vuuren, G., 2014. Private communication. van Vuuren, G., 2012. Basel III Countercyclical capital rules: implications for South Afri- ca. South African Journal of Economic and Management Sciences, 15(3): 76 – 89.
  • 34. 34 An Analysis of South African GDP using Fourier and Periodogram Methods34 Appendix Table 1 (a) Augmented Dickey-Fuller test for stationarity: monthly GDP levels: Stationary test Test Stat P-Value C.V. Stationary? 5.0% ADF No Const -2.2 2.5% -1.9 FALSE Const-Only -5.8 0.1% -2.9 FALSE Const+ Trend -7.1 0.0% -1.6 FALSE Const+Trend+Trend^2 -7.4 0.0% -1.6 FALSE Table 1 (b) Augmented Dickey-Fuller test for stationarity: monthly GDP returns: Stationarytest Test Stat P-Value C.V. Stationary? 5.0% ADF No Const -2.2 2.5% -1.9 TRUE Const-Only -5.8 0.1% -2.9 TRUE Const+ Trend -7.1 0.0% -1.6 TRUE Const+Trend+Trend^2 -7.4 0.0% -1.6 TRUE Table 3 Jarque-Bera test of normality on monthly returns series from February 1971- September 2013 Normality test Z-Score Critical Value p-Value Pass? Significance Level=0.05 Jarque-Bera 988.90 5.99 0.0% FALSE