-
Notifications
You must be signed in to change notification settings - Fork 2
/
chap3.tex
216 lines (190 loc) · 13.2 KB
/
chap3.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
\chapter{Related Work}
\label{chapter:related-work}
This Chapter focuses on showcasing a series of works that should help the reader
understand what is the state of the different parts that compose the proposed
method presented in Chapter \ref{chapter:proposed-method}.
\section{Financial Forecasting}
\label{section:financial-forecasting}
Determining if a financial market should be traded is a process that can be
approached in different ways. For example, a straightforward method is to
analyze the financial health of a company to infer if it would be a good idea to
buy stock from it. This approach is known as fundamental analysis
\cite{Martinez-Jaramillo2009} and it is often contrasted to technical analysis,
which focuses on the analysis of historical prices of a financial market to
arrive at such inferences. Technical analysis involves any process that uses as
input the market prices and the output can usually be plotted along with the
market prices \cite{Achelis2000}. These processes are known as technical
indicators, which often focus on providing the chartist with information about a
market that would be difficult to infer by only looking at the raw price data.
Although some studies have suggested that technical analysis works because it is a
``self-fulfilling prophecy'' \cite{Salganik2008} \cite{Fund1992}, other studies
also suggest that its usefulness in market forecasting is important
\cite{Kadiri2015} \cite{Fund1992}.
This thesis suggests that a financial market's data should be preprocessed
before being used as input for a modelling algorithm. The preprocessing
algorithm showcased in the proposed method is very similar in nature to what a
technical indicator is. Furthermore, the preprocessing algorithm is based on the
idea of an existing technical indicator known as Fibonacci retracements. It can
also be noted that the preprocessing algorithm presented in this thesis shares
some similarity to fuzzy time series \cite{Cai2013}, as the price areas that it
outputs can be seen as price levels associated with a level of uncertainty.
Technical indicators can be used to forecast a market's prices, such as in the
case of candlestick patterns \cite{Nison1991} or linear regression
\cite{kutner2004applied} which, although it is used in other contexts involving
time series, could be considered a technical indicator if used to forecast a
financial market. One can add an extra layer in the forecasting process and use
the outputs from the technical indicators as inputs to another algorithm. For
example, Ijegwa et al. \cite{Ijegwa2014} uses four technical indicators as the
inputs for a fuzzy system that estimates the probability of a market's price
going up or down. This approach is similar to the one proposed in this thesis,
as the preprocessing algorithm is based on a technical indicator and it is used
as input for fuzzy systems that function as the rule systems for the agents in a
multi-agent system.
Arguably one of the most common methods used to forecast financial markets is
neural networks. For example, Castillo and Melin \cite{Castillo2001}
\cite{melin2007hybrid} use neural networks to forecast the prices of tomato and
green onion markets in the United States. One can also combine the idea of
preprocessing a market's prices using technical indicators and then use these
outputs as the inputs for a neural network, as in the work by O'Connor
\cite{Connor2005}. Neural networks were the first candidate for modelling the
agents' rules in the proposed method, as it is a common technique as described
in \cite{Grothmann2002}, but the use of fuzzy systems for this purpose seemed as
a better approach by the author of this thesis, as fuzzy systems are more
interpretable than the models generated by neural networks. As an example of a
similar approach to the aforementioned one, Gamil et al. \cite{Gamil2007} create
a multi-agent system that is tuned using a fuzzy system in order to create a
simulation of the NASDAQ index.
\section{Interpretation of Financial Markets}
\label{section:interpretation-of-financial-markets}
Technical indicators can be used to interpret the price data of financial
markets. For example, Wilder's Parabolic SAR can be used to determine if a
market has shifted its trend \cite{Wilder1978}. In the case of the proposed
method's preprocessing algorithm, its plots can be used to determine possible
price stagnation or bouncing areas. These interpretations are usually used to
decide if a market is a good candidate for trading. Forecasting algorithms can
be extended to the use of market interpretability: if a market can be easily
predicted, then it can be interpreted as a profitable market. As an example of
this approach, one can see the work by Brown et al. \cite{Brown2013}, where they
use a variation of a genetic algorithm to generate a set of rules that forecast
the prices of multiple stocks from the Dow Jones Index, and decide which stocks
to buy based on the performance obtained by the sets of rules.
The work by Brown et al. can be considered as a decision support
system. Decision support systems provide refined information about a situation
in order to help its users take a decision \cite{Keen1980}. The proposed method
can be used in this way by examining the decisions and rules that the agents
needed to follow in order to provide a simulation of a financial market. As a
notable example of a decision support system for market trading the reader can
examine the works by Tsang and Li \cite{Tsang2004} \cite{tsang1998eddie} where
they describe EDDIE, a tool based on a genetic programming algorithm and
decision trees used for market evaluation.
In addition to how one can use candlestick charts to interpret a market's
behavior \cite{Nison1991}, the volume of units traded can also be used to
provide interpretations. Blume et al. \cite{Blume1994} show in their work how
volume and price movements relate, and how this information can benefit the
agents' learning process in a multi-agent system.
There are also works that have focused on automatically finding patterns that
emerge in the market, such as in the works by Lo et al. \cite{Lo2000} and Neely
et al. \cite{Neely1997} where they try to find patterns in technical indicators
by using kernel regression and genetic programming, respectively.
\section{Multi-agent Systems}
\label{section:multi-agent-systems}
Some works related to multi-agent systems have already been mentioned in the
previous Sections of this Chapter, but as the proposed method is based
specifically on this technique, it is worth mentioning some additional
works. Multi-agent systems have commonly been used in the past decades to
describe financial markets, due to their capabilites to model very complex
systems. The reader can consult the works by Lebaron \cite{Lebaron2001} and
Samanidou \cite{Bundesbank2007} to learn more about how to apply this technique
to financial market modelling.
The proposed method started by following the recommendations in Shoham's work
\cite{Shoham1993} \cite{Shoham2009}, where agents are described as entities that
have a set of beliefs that determine how they perceive their environment. These
perceptions are then used as inputs to a rule system that dictate the actions
to be performed on their environment. Other works that implement this
methodology are the works by Samanidoe et al. \cite{Bundesbank2007} and Sherstov
and Stone\cite{Sherstov2005}, where they implement known economic models as the
agents' rules and see how they can model specific phenomena, such as economic
bubbles.
A work concerned with the use of multi-agent systems for the simulation of stock
markets is that proposed by Kendal et al. \cite{Kendall2003}, which describes a
method similar to the one proposed in this thesis regarding how multiple agents
are used to simulate different trader profiles in order to create a simulation
of the real market prices. Another similar approach to the proposed method is
the work by Chen \cite{Chen2001}, where populations of agents are evolved using
genetic programming to simulate the traders' behavior in a market, and then
connect these behaviors to psychological factors such as peer pressure.
\section{Evolutionary Algorithms}
\label{section:evolutionary-algorithms}
Different evolutionary algorithms were considered for the optimization stage of
the proposed method. Eberhart and Kennedy \cite{Eberhart2002} and Price and
Storn \cite{Price1997} describe the two principal alternatives that were
considered: particle swarm optimization and differential evolution. These
algorithms were considered because of their capabilities to find optimal
solutions in a continuous search space, while a genetic algorithm -- the
solution that was selected in the end -- can only handle discrete search
spaces. The reader can refer to the work by Back and Shwefel \cite{Back2008} and
Whitley \cite{Whitley1994} for a comparison among some interesting alternatives
that can be used in the proposed method instead of genetic algorithms. In
particular, a next step for the proposed method could be to upgrade its current
genetic algorithm to a variation of it, such as the compact genetic algorithm
proposed by Harik \cite{Harik1999}, which uses less computational resources than
a traditional genetic algorithm and is more efficient in its evaluations.
The optimization of Fuzzy systems using evolutionary algorithms can be regarded as
common practice. Some notable examples of this are the works by Thrift
\cite{Thrift1991} and Homaifar and McCormick \cite{Homaifar1995}, which use
genetic algorithms to find optimal combinations of parameters for the membership
functions in fuzzy systems.
\section{Fuzzy Systems}
\label{section:fuzzy-systems}
The fuzzy systems used to represent the agents' rules in the proposed method are
based, firstly, in the ideas of fuzzy sets by Zadeh \cite{Zadeh1965}. Secondly,
the idea of how inference systems can be created using Zadeh's fuzzy logic come
from the fuzzy systems created by Takagi and Sugeno \cite{Takagi1985} and, more
importantly, the one developed by Mamdani and Assilian \cite{Mamdani1975}, as
the fuzzy systems in the agents follow the architecture proposed in their work.
More specifically, the fuzzy systems used in the proposed method use
intuitionistic fuzzy sets as the membership functions, which were initially
proposed by Atanassov in \cite{Atanassov1986} and are further described in
\cite{Atanassov2003}. The purpose of using intuitionistic fuzzy sets instead of
Zadeh's traditional fuzzy sets is to increase the system's modelling
capabilities by introducing the concept of indeterminacy in the membership
functions. Indeterminacy plays a similar role to uncertainty in traditional
fuzzy sets, but adds an additional layer for representing uncertainty, similarly
to how type-2 fuzzy sets do it with their footprint of uncertainty
\cite{Mendel2002} \cite{Karnik2001}. If the reader is interested in reading more
about type-2 fuzzy sets, the works by Liang and Mendel \cite{Liang2000} and
Mendel et al. \cite{Mendel2006} are good starting points.
Intuitionistic fuzzy sets also have the advantage of providing an additional
layer of interpretation to the fuzzy system. In a similar fashion, Pedrycz's
shadowed sets \cite{Pedrycz1998} have the purpose of enhancing the
interpretation of traditional fuzzy sets.
\subsection{Implementations of Fuzzy Systems}
\label{section:implementations-of-fuzzy-systems}
%% implementations
%% This cpuld be a Subsection - Mario
A robust implementation in Java for the creation of fuzzy systems is presented
by Wagner in \cite{Wagner2013}. Although the toolkit does not provide many tools
for representing fuzzy systems graphically or for interacting with one, the
implementation provides libraries for building type-1, interval type-2 and
generalized type-2 fuzzy systems. The work by Castro et
al. \cite{castro2007interval} provides similar capabilities as the work by
Wagner, but in this case it is an implementation in Matlab. The author of this
thesis developed an implementation for building fuzzy systems in Clojure, which
is presented in \cite{Hernandez-Aguila2017} and the theory behind it is
described in \cite{Hernandez-aguila2016}. Although this system lacks an
implementation for type-2 fuzzy systems like the previous two implementations,
it does provide an implementation for intuitionistic fuzzy systems.
The implementation of fuzzy systems used in this thesis also proposes a new way
for representing intuitionistic fuzzy sets. The most common approach to
graphically representing an intuitionistic fuzzy set is by lattices. Examples of
this type of representation can be found in the works by Despi et
al. \cite{Despi2013}, and Deschrijver et al. \cite{Deschrijver2004}. This is a
popular approach to graphically representing an intuitionistic fuzzy set as it
enables more compact and concise mathematical expressions. Another
representation that is suitable for mathematical processes is that of a matrix,
and is discussed in detail in the works by Parvathi et al. \cite{Parvathi2014},
Çuvalcioglu et al. \cite{Yilmaz2015}, and Yilmaz et
al. \cite{Yilmaz2015a}. Other graphical representations for this kind of fuzzy
sets is by radar charts as in the work by Atanassova \cite{Atanassova2010} and
by geometrical representations, orthogonal projections and three-dimensional
representations, as found in the work by Szmidt and Kacprzyk \cite{Szmidt2000}.