90
Agent-based computational model for crude oil futures market Jo˜ ao Miguel Pereira Abrantes Thesis to obtain the Master of Science Degree in Engineering Physics Supervisors: Prof. Tiago Morais Delgado Domingos Prof. Carlos Augusto Santos Silva Examination Comitee Chairperson: Prof. Lu´ ıs Filipe Moreira Mendes Supervisor: Prof. Tiago Morais Delgado Domingos Members of the Committee: Prof. Jo˜ ao Carlos de Carvalho S´ a Seixas Prof. Miguel St. Aubyn June, 2014

Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

  • Upload
    others

  • View
    4

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Agent-based computational model for crude oil

futures market

Joao Miguel Pereira Abrantes

Thesis to obtain the Master of Science Degree in

Engineering Physics

Supervisors: Prof. Tiago Morais Delgado Domingos

Prof. Carlos Augusto Santos Silva

Examination Comitee

Chairperson: Prof. Luıs Filipe Moreira Mendes

Supervisor: Prof. Tiago Morais Delgado Domingos

Members of the Committee: Prof. Joao Carlos de Carvalho Sa Seixas

Prof. Miguel St. Aubyn

June, 2014

Page 2: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,
Page 3: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Acknowledgments

This project marks the end of a journey that would not be possible without the invaluable help of

some people whom I have the pleasure to thank.

First, I would like to thank all the people involved in this project. Thanks to Prof. Tiago Domingos

and Prof. Tania Sousa for their guidance in the preparation of this thesis, as well as Joao Magalhaes for

his suggestions and patience in the computational part of the work. I would also like to thank Prof. Carlos

Silva for being available to be my co-advisor and for his corrections. I am also grateful to everybody

in Environment and Energy Scientific Area of IN+ who welcomed me so well. In particular, I would

specially like to thank Nuno Sarmento for always being available to solve the logistic issues.

Last, but certainly not least, I would like to thank my father Jose, my mother Luısa and my brothers

Filipe and Pedro. All the support they have provided me over the years was the greatest gift anyone has

ever given me. Finally, I would like to send a special greeting to my friends, especially to Condesso and

Tiago who accompanied me on this Physics adventure. To all, my sincere thanks.

This work is supported by project “Energy Wars” (QREN 7929), funded by QREN/FEDER.

i

Page 4: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,
Page 5: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Abstract

The sharp rise in crude oil prices over the last decade has reinforced the interest of the scientific

community in understanding the major causes of price movements. In this sense, the increasing finan-

cialization of commodity markets as well as the existence of speculators in the crude oil market can be

two possible reasons for high price volatility and financial instability.

The purpose of this thesis was to develop and test an agent-based computational model for the crude

oil futures market, which simulates the crude oil price evolution through speculative behaviour of the

market participants. This speculative component was modelled by the interaction of heterogeneous agents

(fundamentalists, chartists, contrarians and noise traders) with learning ability, which adapt their beliefs

and change their investment strategies over time according to their past performance, measured by the

number of winning trades. Finally, each agent decides the number of investment positions and submits

orders to buy or sell futures contracts. The crude oil price increases (decreases) whether there is an excess

of demand (supply).

The results revealed that the intermittent behaviour that characterizes the oscillations of agents’

strategies as well as the non stationarity of market activity are crucial to the emergence of stylized facts,

namely the absence of autocorrelations in returns, heavy-tailed distribution of returns and volatility

clustering.

This model is presented as a starting point to further research about the key factors that replicate

the oil price as well as the importance of speculation on its formation.

Keywords

Agent-based model, Behavioural Finance, Computational Finance, Crude oil price, Heterogeneous

agents.

iii

Page 6: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,
Page 7: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Resumo

O aumento do preco do petroleo na ultima decada tem vindo a reforcar o interesse cientıfico em

perceber as maiores causas das suas fluctuacoes. Neste sentido, a financeirizacao dos mercados bem como

a existencia de especuladores podem explicar os perıodos de alta volatilidade e instabilidade financeira.

O principal objectivo da tese consistiu no desenvolvimento de um modelo computacional baseado em

agentes, que simula a evolucao do preco do petroleo atraves do comportamento especulativo dos agentes

financeiros. Esta componente especulativa foi modelada atraves da interaccao de agentes heterogeneos

(fundamentais, tecnicos, contrarios e investidores ingenuos) com capacidade de aprendizagem, que adap-

tam sucessivamente as suas expectativas tendo em conta as performances passadas das suas estrategias.

Finalmente, cada agente decide o numero de posicoes de investimento e submete ordens de compra ou

venda de contractos de futuros de petroleo. O preco do petroleo aumenta (diminui) se existir um excesso

de procura (oferta).

Os resultados revelaram que a intermitencia que caracteriza a variacao da fraccao de cada tipo de

estrategia, bem como a nao estacionariedade do numero de agentes no mercado sao cruciais para o

aparecimento dos factos estilizados, nomeadamente a ausencia de autocorrelacao nas series de retornos,

a rejeicao da hipotese de normalidade dos retornos diarios e o facto de eventos extremos de magnitude

semelhante estarem agrupados ao longo do tempo.

Este modelo apresenta-se como um ponto de partida para pesquisa futura sobre os os factores fun-

damentais que permitem a replicacao do preco do petroleo e sobre a importancia da especulacao na sua

formacao.

Palavras Chave

Agentes heterogeneos, Financas Comportamentais, Financas Computacionais, Modelos baseados em

agentes, Preco do petroleo.

v

Page 8: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,
Page 9: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Contents

1 Introduction 1

2 What drives crude oil prices? 7

2.1 The Market Oil Pricing System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2.2 Historical Analysis of Crude Oil Prices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

2.3 World Oil Consumption and Production . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.4 The Role of Market Fundamentals and Speculation . . . . . . . . . . . . . . . . . . . . . . 14

2.4.1 Demand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.4.2 Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

2.4.3 Speculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3 Crude Oil Financial Markets 23

3.1 The Pricing of Commodity Contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

3.2 Stylized Facts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

3.2.1 Absence of Autocorrelations in Returns . . . . . . . . . . . . . . . . . . . . . . . . 26

3.2.2 Heavy-tailed Distribution of Returns . . . . . . . . . . . . . . . . . . . . . . . . . . 27

3.2.3 Volatility Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

4 Agent-based Modelling 31

4.1 Foundations of Agent-based Modelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

4.2 Agent-based Modelling in Financial Markets . . . . . . . . . . . . . . . . . . . . . . . . . . 32

4.3 Literature Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

4.3.1 SFI Artificial Stock Market . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

4.3.2 Lux and Marchesi Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

4.3.3 Adaptive Belief Systems Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

4.4 ABMs for Crude Oil Financial Markets . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

5 ABM for the crude oil futures market 49

5.1 Description and Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

5.1.1 Economic Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5.1.2 Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

5.1.3 Agents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

5.1.4 Market Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

vii

Page 10: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

5.2 Simulation Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

5.2.1 Simulation Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

5.2.2 Simulation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

5.3 Stylized Facts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

5.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

6 Conclusions and Future Work 65

Bibliography 69

viii

Page 11: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

List of Figures

2.1 World energy consumption by fuel, 1990-2040 based on data in the EIA IEO 2013. . . . . 7

2.2 World oil prices in three cases, 1990-2040 based on data in the EIA IEO 2013. . . . . . . . 8

2.3 Nominal monthly crude oil spot price of WTI (black) and Brent Blend (blue) benchmarks

(1987-2013) based on data of the EIA. Source: Thomson Reuters. . . . . . . . . . . . . . 10

2.4 Nominal monthly crude oil spot price of WTI (black) and Brent Blend (blue) benchmarks

(1987-2004) based on data of the EIA. Source: Thomson Reuters. . . . . . . . . . . . . . 11

2.5 Nominal monthly crude oil spot price of WTI (black) and Brent Blend (blue) benchmarks

(2004-2013) based on data of the EIA. Source: Thomson Reuters. . . . . . . . . . . . . . 12

2.6 World liquids production and consumption by region (2010-2040). Source: (EIA, 2013). . 14

2.7 Nominal annual WTI crude oil price, World GDP and liquid fuels consumption. Source:

EIA and OECD Statistics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.8 Nominal monthly WTI crude oil price and US and Euro short-term interest rates. Source:

EIA and OECD Statistics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

2.9 Nominal monthly WTI crude oil price and changes in World (OPEC and Non-OPEC)

liquid fuels production. Source: EIA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2.10 WTI crude oil futures price spread and OECD liquid fuels inventory based on data of the

EIA. Source: Thomson Reuters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2.11 Average daily open interest in crude oil futures on U.S. exchanges based on data of the

EIA. Source: NYMEX Group. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.12 Cumulative effects of supply, demand and speculative demand on real crude oil price.

Source: (Kilian and Murphy, 2013). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

3.1 Autocorrelation function of WTI crude oil spot price logarithmic returns. . . . . . . . . . 27

3.2 Histogram of crude oil spot price logarithmic returns, kernel estimator of the density and

normal distribution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

3.3 Logarithmic returns of crude oil spot price from 02/01/1986 to 02/01/2014. . . . . . . . . 29

3.4 Behaviour of autocorrelation functions of raw, squared and absolute spot price logarithmic

returns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

5.1 Functional diagram of our ABM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

ix

Page 12: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

5.2 Example of the evolution of crude oil prices and application of technical trading rules

moving average crossover (left), mean reverting moving average (right) and fundamental

GDP forecasting rule (bottom). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

5.3 Simple simulation of 100 market participants with only two available strategies (H = 2)

during a period of 1000 trading days: moving average crossover chartists (black) vs mean

reverting chartists (blue). β = 0.4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

5.4 Simple simulation of 100 market participants with only two available strategies (H = 2)

during a period of 1000 trading days: moving average crossover chartists (black) vs GDP

fundamentalists (blue). β = 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

5.5 Simulated crude oil price path (left) and logarithmic returns (right). . . . . . . . . . . . . 59

5.6 Simulated market indicators: market activity (top left); daily volatility (top right); GDP

time series (bottom left); market activity vs daily volatility (bottom right). . . . . . . . . 59

5.7 Market fraction of each type of market participants. . . . . . . . . . . . . . . . . . . . . . 60

5.8 Probability density function of logarithmic returns for empirical and simulated data. The

blue curve represents a normal distribution with the mean and standard deviation of

returns. The red curve represents the kernel density estimator. . . . . . . . . . . . . . . . 61

5.9 Complementary cumulative distribution function (ccdf) of normalized absolute logarithmic

returns |R(t)| for empirical (left) and simulated (right) data. Normalized returns are

computed as R(t) = (r(t) −M)/SD, where M and SD are the mean and the standard

deviation of r(t), respectively. The dots represent an estimate of the ccdf of |R(t)| related

to the empirical and simulated data. The solid line represents the ccdf from the standard

normal distribution. The dashed line is the power law fit P = A|R|−B with B = 3.25±0.04

(B = 3.53± 0.03) of the tail of the empirical (simulated) ccdf for |R(t)| > 2. . . . . . . . . 61

5.10 Behaviour of autocorrelation functions of empirical (left) and simulated (right) raw and

absolute logarithmic returns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

5.11 Estimate of the autocorrelation function of empirical (left) and simulated (right) absolute

logarithmic returns. The dots represent the autocorrelation of absolute returns |r(t)|.

Absolute returns are fitted with a power law decay P = A|R|−B with B = 0.54 ± 0.04

(B = 0.62± 0.02) for the empirical (simulated) data. . . . . . . . . . . . . . . . . . . . . . 63

5.12 Qualitative positioning of our ABM and comparison with other models. . . . . . . . . . . 64

x

Page 13: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

List of Tables

3.1 Descriptive statistics of WTI logarithmic returns. . . . . . . . . . . . . . . . . . . . . . . . 26

4.1 Condition bits of SFI artificial stock market. . . . . . . . . . . . . . . . . . . . . . . . . . . 41

5.1 Agents’ investment strategies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

5.2 List of model parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

5.3 Summary of the parameter set. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

xi

Page 14: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,
Page 15: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Abbreviations

ABM Agent-based Model

ABS Adaptive Belief Systems

BTU British Thermal Unit

CARA Constant Absolute Risk Aversion

CRRA Constant Relative Risk Aversion

EIA U.S. Energy Information Administration

GDP Gross Domestic Product

ICE Intercontinental Exchange

IEO International Energy Outlook 2013

IOCs International or Investor-owned Oil Companies

MU Monetary Units

NOCs National Oil Companies

NYMEX New York Mercantile Exchange

OECD Organisation for Economic Co-operation and Development

OPEC Organization of the Petroleum Exporting Countries

PRAs Price Reporting Agencies

SFI Santa Fe Institute

WTI West Texas Intermediate

xiii

Page 16: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,
Page 17: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

1Introduction

The main goal of this thesis is the design of an agent-based computational model (ABM) to simulate

crude oil futures financial market. It is expected that this model will simulate crude oil prices, which

are consistent with a set of financial stylized facts. In this sense, we intend to answer the question: Is

it possible to model the crude oil futures financial market, according to the observable behaviour of its

agents?

In order to solve this challenge, we will look at Economics and Finance through the lens of Physics.

In fact, this work seeks to explore the modification of Economics and Finance through the inspiration of

Physics and Social Sciences. But, what are their points of convergence and divergence?

Firstly, while Physics is an observational science, traditional Economics ideas are usually not tested

against empirical data. In this sense, we can say that Economics is not an observational science. In

particular, due to different nature of their data, the Social Sciences and Economics have a gap in terms

of data-oriented approaches and quantitative description of social phenomena. For example, the financial

markets are compared to a complex example of a real-world system, which evolves according to the

decisions of their market participants. As such, quantities like the agent’s behaviour and the rules of

decision-making can be hardly measured by the tools of economic theory.

Therefore, we can clearly identify the contribution of Physics to Economics. In fact, by applying

Physics methods to Economics and Finance, we can work with real market data and provide a systematic

and quantitative description of social and economic processes. Indeed, the insufficiency of traditional

economic tools in the last decade financial crisis, requires a mutual collaboration in which the economic

theories assume the starting point for new Physics contributions. All this points led to empirical and

theoretical developments under the term Econophysics1, which has grown in various directions such as

the stochastic analysis of financial time series’ properties and the agent-based modelling. The former

1Econophysics is a merge of the words Economics and Physics and was coined by H.E. Stanley in 1995. This interdisci-plinary field results from the interactions between Physics, Mathematics, Economics and Finance.

1

Page 18: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

contribution provides insights in the non trivial nature of the stochastic processes performed by stock

prices. On the other hand, the latter approach investigates the role of heterogeneity of agents and their

strategies in price dynamics. These various investigations are the subject of the present work.

In particular, financial markets are the first target for this interdisciplinary field, thanks to the avail-

ability of large amounts of financial data. The computerization of stock exchanges has lead to the

explosion of recorded data, which permits to compute intraday statistics with high frequency. Thus,

financial markets appear as a perfect playground where models can be repeatedly tested to demonstrate

their empirical evidences. Furthermore, there is the possibility of testing the fundamental ideas of the

Classical theory of Economics, such as the idea of equilibrium from traditional models and the Efficient

Markets Hypothesis, which has been the subject of unsolved debate for decades. The later concept is

often used to assert that markets do not need regulation, since they have power to get prices near their

“fundamental values”, and so never get too much out of balance. Indeed, the Efficient Markets Hypoth-

esis asserts that perfect efficiency reflects perfect information processing. Therefore, traders process each

new fraction of information and prices immediately go to their new equilibrium values.

The Classical theory of Economics reflects the interplay of the following principles:

• an equilibrium situation with equal independent representative agents which act more or less ratio-

nally, have the same information and process it in the same manner;

• price changes are caused by new information which arrives on the market. This new information

modifies the ratio between supply and demand and consequently the price, through a “mechanical”

equilibrium of the market. Indeed, this random process leads to the famous random walk model

(Pearson, 1905) and the corresponding Black and Scholes equations (Hull, 1997);

• large price changes are also due to the market reaction to external shocks that arrives to the

market in the form of new pieces of information such as businesses, political events or technological

discoveries. Therefore, a large price change is supposed to be associated to a considerable exogenous

event.

However, most of these principles have no empirical basis at all and there are considerable evidences

against this classical picture. Although it allows an analytical analysis of the problem, this approach

can not provide a perfect description of reality. In fact, in the Natural Sciences, there are few realistic

problems that can be treated exactly but still one can get a good understanding through computer

simulations.

Looking in detail, the classical assumptions made for the behaviour of the agents are far from reality.

In fact, the market participants can be very different from each other and might instead change their

ideas and strategies, interacting in a way that creates a rich internal dynamics in the market. Finally,

they are not all independent given, for example, the existence of episodes of herding behaviour, which

are completely neglected.

In terms of price changes, the most reasonable of the above principles is the fact that external news

are random and incoherent so the random walk appears reasonable as a simple modelling. However,

this classical picture includes many large market movements that occur in the absence of any apparent

2

Page 19: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

shock to the market and excess volatility. In particular, many studies have proved strong mathematical

regularities in market fluctuations that reflect this excess volatility, including the heavy-tailed character

of the distribution of market returns.

Thus, how to build models that go beyond the classical idea of equilibrium? Why not non-equilibrium

or agent-based models? Actually, there is a fraction of researchers that move beyond the restrictions of

equilibrium thinking. They use the computational power to create a real financial environment by sim-

ulating the behaviour of market participants and other financial players. In particular, the agent-based

models do not assume the equilibrium idea from the beginning, but rather let market behaviour emerge

naturally from the actions of interacting market participants. Therefore, these models allow to experi-

ment and analyse interdependencies between an agent composed micro level and the key macroeconomic

variables, such as GDP.

Taking advantage of the development of computer systems, the agent-based models represent a class

of models which have been introduced to allow the description of economic processes as dynamic systems

of heterogeneous agents with adaptive learning, interacting with each other by heuristic rules. Thus, the

heterogeneous agents can be characterized by the diversity of their preferences and abilities to learn and

process information, which results in different attitudes and investment positions. In sum, we want to

simulate an agent-based model of crude oil financial markets according to the follow building blocks:

• variable number of heterogeneous financial agents with several characteristics such as strategies,

wealth and behavioural parameters;

• market structure which includes the interaction between agents;

• pricing mechanism which depends on the balance between supply and demand of financial positions.

These building blocks have various ways of implementation according to a relation between realism and

analyticity, explained during the literature review of agent-based models applied to financial markets. In

addition, the dynamics of this type of models is able to reproduce the main stylized facts of financial

markets, demonstrating its validity.

In particular, our model is applied on the crude oil context and establishes the relationship between

the crude oil financial market and the macroeconomic environment from a speculative point of view. Due

to the importance of oil in the World Economy, its price fluctuations may have important macroeconomic

origins and consequences. On the one hand, we can distinguish price effects on both the supply and the

demand side. First, changes in the supply are associated, for example, to the behaviour of OPEC and

Non-OPEC countries, and to production costs involved in exploration, development and technological

innovation. Secondly, the past years have shown the combination of strong per capita income growth,

rapid industrialization and population growth in countries like China and India. In fact, besides the large

amount of oil that the Western World is still consuming, this emergent behaviour is responsible for the

recent strong growth in oil demand. On the other hand, the increasing “financialization” of commodity

markets has been gaining attention. As such, the existence of speculators in the crude oil market can be

a possible reason for high price volatility and financial instability.

3

Page 20: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

This thesis document is structured as follows. Chapter 2 provides the first comprehensive review

about what drives crude oil prices. In this sense, this chapter starts to describe the crude oil market

mechanism and present the most significant historical events that caused the last two historical oil crisis in

1990 and 2008. Then, we will look in detail at key features of crude oil demand and supply forces without

forgetting the role of commodity price speculation. Chapter 3 begins by presenting the pricing mechanism

of commodity futures contracts. After, we will present the statistical and financial explanation of the

key stylized facts of crude oil financial markets. These main empirical evidences and regularities will be

the basis of our model validation. In the chapter 4 a discussion of the advantage of ABMs over other

modelling approaches is given including a special emphasis on introducing ABMs in financial markets.

Then, will be presented all the literature review. First, the general outlines of ABMs will be described

in terms of heterogeneity and rationality, providing a valuable baseline for future research in this area.

Secondly, we will discuss three ABMs which well represent the development of this field in a schematic

way according to some design categories. The last section presents some references of ABMs in crude oil

financial market context. Chapter 5 presents the ABM developed in this thesis. Then we will present

the whole process of choosing the model parameters as well as the simulation results. The results are

evaluated according to the emergence of stylized facts. In addition, we intend to give explanations about

the origin of the stylized facts addressed in chapter 3. Finally, chapter 6 provides some closing outlines

and shares some further ideas for future research that we believe will be fruitful, based on the perspective

we have gained through this experience.

This thesis proposal stems from the project “Energy Wars”, which aims to create a simulator for the

interaction between Macroeconomics, the oil sector business decisions and the crude oil financial market.

This work is inserted in the latter part and aims to develop a model which simulates the different agents

as well as the crude oil price evolution.

Concerning the last model version, we introduce the learning ability of financial agents using a form

of evolutionary dynamics in which agents adapt their beliefs and change their business strategy over

time according to some measure of performance. This simple evolutionary property provides the vari-

ation of the market fraction allocated to each type of strategy, allowing to investigate the influence of

heterogeneous agents on the crude oil price dynamics. In fact, we report an increased heterogeneity in

the model, associated with the introduction of new parameters that allow characterizing the individual

behaviour of financial agents such as intensity of choice, memory and inertia. Besides these fact, the

current model allows the Pareto distribution of individual wealth in each trading period and contains

new trading strategies. In this sense, this version also includes the participation of contrarians and noise

traders.

All changes mentioned above were made from additions and modifications to the original C++ code

implemented by Joao Magalhaes. Note that the program structure is maintained.

Finally, the increased heterogeneity of agents in financial modelling of stock markets allows to generate

a greater diversity of preferences that, in turn, create a dynamic closer to reality, proven by replicating

some stylized facts of financial markets. The next step will be taken by uniting all parties involved in

the project. In this way, we can draw better conclusions about the key factors that control the oil price

4

Page 21: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

as well as evaluate the importance of speculation on its formation.

5

Page 22: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

6

Page 23: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

2What drives crude oil prices?

Crude oil is an exhaustible natural commodity that results from a complex mixture of hydrocarbons.

Beneath the Earth’s surface, its non-homogeneity is supported by the existence of various types around

the World with different qualities and characteristics. In this sense, crude oil can be characterized by

the geographical locations that it is produced in, which are known as crude oil benchmarks. These

benchmarks, including primary WTI, Brent Blend and Dubai and Oman, serve as a reference price for

buyers and sellers. Otherwise, crude oil can also be classified according to its density (light and heavy)

and sulphur content (sweet and sour). Given the influence of these parameters on crude oil prices, the

light sweet oils are more valuable and easier to process.

World energy consumption by fuel type, 1990-2040

Year

Qua

drill

ion

BTU

50

100

150

200

History EIA Forecast

34%

28%

22%

11%

5%

28%

27%

23%

15%

7%

1990 2000 2010 2020 2030 2040

Fuel TypeLiquids

Nuclear

Natural Gas

Coal

Renewables

Figure 2.1: World energy consumption by fuel, 1990-2040 (quadrillion BTU) based on data in the EIA IEO2013.

According to (EIA, 2013), oil will provide about 30% of the World’s energy mix in 2030 (see fig.2.1)

and is expected that will remain a vital source of energy and a key driver of the World’s economy. In a

7

Page 24: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

general view, the growth of the World’s economy needs more energy, the demand of important consumers

inflates the market and prices tend to increase (see fig.2.2). On the other hand, crude oil is one of the

most strategic commodities and plays a critical role on economic cycles and macroeconomics factors like

inflation, recession, economic growth and interest and exchange rates.

World Crude Oil Price in three cases, 1990-2040

Year

2011

$/b

bl, B

rent

Cru

de O

il

50

100

150

200 History EIA Forecast

1990 2000 2010 2020 2030 2040

Fuel TypeHigh Oil Price

Reference Price

Low Oil Price

Figure 2.2: World oil prices in three cases, 1990-2040 (2011 dollars per barrel, Brent crude oil) based on datain the EIA IEO 2013.The three price cases were developed by adjusting four key economic factors: Non-OPECpetroleum liquids supply; OPEC investment and production decisions; the economics of other liquids supply; andeconomic growth in Non-OECD countries.

This chapter starts to describe the crude oil market mechanism and present the most significant

historical events that caused the last two historical oil crisis in 1990 and 2008. Then, we look in detail

at key features of crude oil fundamentals demand and supply and discuss the role of commodity price

speculation.

2.1 The Market Oil Pricing System

The crude oil pricing mechanism has changed over the decades and there have been three important

monopolization degrees:

• until 1973, crude oil price was controlled by major multinational monopolist oil companies known

as Seven Sisters;1

• between 1973 and 1988, OPEC2 had spare capacity and took over oil price determination and

management;

• since 1986-1988 until present, the world oil market is a seller market where crude oil prices are deter-

mined through the market-based pricing mechanism, based on crude oil classifications at exchange

1The group comprised Anglo-Persian Oil Company, Gulf Oil, Standard Oil of California and Texaco, Royal Dutch Shell,Standard Oil of New Jersey and Standard Oil Company of New York.

2OPEC was founded in 1960 by five countries namely Iran, Iraq, Kuwait, Saudi Arabia and Venezuela that later joinedby nine other members: Qatar, Indonesia (suspended its membership from 2009), Libya, United Arab Emirates, Algeria,Nigeria, Ecuador (suspended its membership from 1992-2007), Angola and Gabon (terminated its membership in 1995).Currently, the Organization has a total of 12 member Countries and its objective is to organize oil policies in order tosecure and stable prices for crude oil producers; an efficient, economic and regular supply for consuming countries; and afair return on capital to oil industry agents.

8

Page 25: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

centers, such as the CME Group (formerly the NYMEX) or the ICE.

Thereafter, this led to the development of a complex structure of interlinked oil markets which consists

of spot and also physical forwards, futures, options and other derivative markets referred to as commercial

“paper markets”. In this sense, it is possible to identify two different market layers: the physical and the

financial. These layers are highly interconnected and form a complex network, which plays a role in the

price discovery process. According to (Fattouh, 2011), is still difficult to know which party has a higher

weight in the context of the oil market. But, who are the players and what factors contribute to the price

determination of an oil benchmark?

Firstly, as explained before, it is not only the oil producers and consumers that take part in crude

oil trading, but also institutional investors like hedgers, speculators and arbitragers. While hedgers want

to cover the risk of their investment positions avoiding adverse movements of the price of a commodity,

speculators are willing to take risks to gain profits. On the other hand, arbitrageurs attempt to profit

from price inefficiencies in the market by making simultaneous trades that offset each other and capturing

risk-free profits.

In crude oil market context, traders differ in their ability to trade and can be distinguished by two

main types of agents: commercial and non-commercial agents. The first ones are physically involved

in the oil market i.e. they supply (international and national oil companies) and consume (individuals,

transportation fleets, industrial manufacturers and power generators) oil and have the capacity to store

it. These agents are able to form rational expectations and essentially enter in the futures market to

hedge against price fluctuations by fixing the price that they will have to pay or receive for a future

delivery. In the supply side, producers have the opportunity to secure their income by selling futures

contracts. On the other side, consumers will buy futures contracts in order to set and reduce their future

costs. Non-commercial agents are not physically involved with oil market (merchants and financial market

participants) and are willing to take risks, having only imperfect information about the evolution of oil

price fundamentals.

Finally, we can identify the main factors of oil price determination process. Knowing a priori that the

oil price is affected by economical, political, financial, technological and meteorological factors, the market

pricing mechanism itself and the Price Reporting Agencies (PRAs) reflect how the oil market works. Note

that are providers of technical reports about physical transactions, which share daily assessments that

are used as benchmarks in the oil markets. Therefore, as argued by (Fattouh, 2011, p. 79),

if oil price levels are set in the futures market and if participants in these markets attach more

weight to future fundamentals rather than current fundamentals and/or if market participants

expect limited feedbacks from both the supply and demand side in response to oil price

changes, these expectations will be reflected in the different layers and will ultimately be

reflected in the assessed price.

9

Page 26: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

2.2 Historical Analysis of Crude Oil Prices

As with the other commodity prices, the crude oil price fluctuates in times of shortage or oversupply.

In the last years, crude oil prices showed significant variations, raised and decreased in different time

windows. The evolution of the barrel of crude oil spot price, between 1987 and 2013, can be seen in

figure 2.3. In this graph, we can verify that both prices (WTI and Brent Blend) tend to move together.

This evidence is justified by the fact that oil markets are globally integrated and variation quality and

location result in price differentials. Following, we will analyse the oil price developments in order to

explain price determinant factors and investigate quantitative and qualitative factors which caused the

last two historical oil crisis in 1990 (Persian Gulf War) and 2008 (oil price spike).3

Nominal WTI and Brent crude oil price

Year

$/bb

l

1990 1995 2000 2005 2010

2040

6080

100

120

WTI

Brent

Figure 2.3: Nominal monthly crude oil spot price of WTI (black) and Brent Blend (blue) benchmarks (1987-2013) based on data of the EIA. Source: Thomson Reuters.

After starting crude oil pricing through market-based mechanism, price stood at approximately 20

dollar per barrel until 1990’s Gulf War. The Kuwait’s invasion on August 2 by Iraqi troops led to a

fulminant decrease in production and started the third crude oil market price crisis. In 1990, prices

rose approximately from 17 dollar per barrel on June to 36 dollar by October. After 1990, crude oil

spot prices entered a period of constant decrease until March 1994 that price fixed to around 14 dollar

per barrel. Between 1994 and 1997 there was an oil price increase. In this period, the United States

economy was strong and Asian Pacific region was active, which led to an increase in World’s crude oil

consumption. Moreover, Russia cut its production in order to stabilize the prices. Crude oil price moved

from 14 dollar per barrel to approximately 25 dollar in January 1997. In 1997 there were two events:

OPEC increased its quota 2.5 million barrels per day and the Asian financial crisis exploded and the

Asian growth decreased in half. The combination of higher production and lower consumption led to a

crude oil spot price decrease of 25 to 11 dollar per barrel at the end of 1998. In 1999, OPEC started

to reduce its production 3 million barrels per day and prices increased to 25 dollar per barrel at the

3Data analysis will be performed with WTI crude oil spot price and all information is obtained from EIA.

10

Page 27: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

end of year and continued to rise up to 34 dollar per barrel in November 2000. After, the increase of

OPEC (3.7 million barrels per day) and Non-OPEC production, especially Russia, led to a price decrease

from 34 dollar per barrel in 2000 to 26 dollar per barrel in 2001. The crude oil spot prices kept falling

until 2002 with the Al-Qaeda terrorist attack of September 2001. The prices decreased to 19 dollar per

barrel in January 2002. In this year, there was a considerable production cut when OPEC decreased 1.5

million barrels per day and Non-OPEC decreased 426.500 barrels per day. The situation was reversed

when prices rose to 25 dollar per barrel in April 2002. Additionally, a reduction in Venezuela production

caused by a strike at Petroleos de Venezuela led to a crude oil spot price increase to 30 dollar per barrel

in September 2002 and 36 dollar per barrel in February 2003. In May 2003 prices decreased again to 28

dollar per barrel with OPEC increasing quota by 2.8 million barrels per day. The crude oil spot price

movement of WTI and Brent Blend benchmarks during this period is shown in figure 2.4.

Nominal WTI and Brent crude oil price

Year

$/bb

l

1990 1995 2000

1520

2530

35

WTI

Brent

Gulf War

World oil consumption increased (1994−1997)Russia production cut (1994−1997)

OPEC increased quota (1997)Asian financial crisis (1997)

Higher production/Lower consumption (1998−1999)

OPEC decreased quota (2000)

OPEC/Non−OPEC inccreased quota (2001)

11 September (2001)

Venezuela strike (2002)

Iraq War (2003)

Figure 2.4: Nominal monthly crude oil spot price of WTI (black) and Brent Blend (blue) benchmarks (1987-2004) based on data of the EIA. Source: Thomson Reuters.

In 2003, crude oil spot price began to rise rapidly until 2008. The crude oil price rose to 53 dollar per

barrel in October 2004 and then to 66 dollar in September 2005, rose to 74 dollar by July 2006, picked at

134 dollar per barrel in July 2008. Underlying this price rise, highlights the military action of the Western

world in Iraq, lower inventories in United States and OECD4 countries and rapid growth of United States

and Asian economy demand for oil. Consequently, OPEC increased its production quota and used the

spare capacity5 to meet the world oil consumption requirement and compensate reduction in production of

Iraq and Venezuela. This practice led to the depletion of spare production capacity and was not sufficient

to compensate the loss of OPEC production. There are many factors that influenced the evolution of

crude oil price such as petroleum reserves scarcity, worries about peak oil, level of inventories in the

United States and other consumers, speculation behaviours and some geopolitical events and natural

4The OECD is an international economic organisation of 34 countries founded in 1961 to stimulate economic progressand world trade and to promote policies that will improve the economic and social well-being of people.

5EIA defines spare capacity as the volume of production that can be brought on within 30 days and sustained for atleast 90 days.

11

Page 28: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

disasters (United States hurricane Katrina in 2005, North Korean missile tests in 2006, conflict between

Israel and Lebanon in 2006 and worries about Iranian nuclear plan). The Great Recession that began

in December 2007 and took particularly sharp downward in September 2008 caused that oil demand

declined in late 2008. Consequently, crude oil prices fell to 41 dollar per barrel in December 2008. In

the following three years, crude oil price increased successively until 110 dollar per barrel in April 2011.

After, it can be observed an oscillatory price behaviour between 106 dollar (March 2012) and 82 dollar

per barrel (June 2012). This price trend is mainly caused by disruption in oil production in Libya due

to the revolution (Arab Spring) and global concerns about Iran nuclear program. The price movement

during 2004-2013 is shown in fig.2.5.

Nominal WTI and Brent crude oil price

Year

$/bb

l

2004 2006 2008 2010 2012

4060

8010

012

0

WTI

BrentGlobal recession (2008)

Libyan revolution (2011)

Israel and Lebanon conflict (2006)

Katrina hurricane (2005)

North Korean missile tests (2006)

Rapid growth of United States

Asian oil demand

Low level of inventories

Figure 2.5: Nominal monthly crude oil spot price of WTI (black) and Brent Blend (blue) benchmarks (2004-2013) based on data of the EIA. Source: Thomson Reuters.

But what really determines the crude oil prices of a certain benchmark? In the next section, will be

further examined the potential determinants of crude oil market prices such as the fundamental factors,

i.e. demand and supply, as well as the speculative behaviour of financial market participants.

2.3 World Oil Consumption and Production

The previous analysis of crude oil prices between 1987 and 2013 identifies the main short-run influence

factors. Besides these, the current oil price is driven by demand and supply forces discussed in this topic.

Firstly, will be presented briefly the main areas of world oil consumption (OECD and Non-OECD) and

production (OPEC and Non-OPEC).6 In the next section, will be discussed in more detail the implications

of this forces in crude oil price behaviour.

According to (EIA, 2013) forecasts, world liquids consumption will increase from almost 87 million

barrels per day in 2010 to 115 million barrels per day in 2040. Consequently, petroleum and other liquids

will remain the world’s dominant fuel source, although their share of global primary energy consumption

decreases. This decrease is associated with the fact that many liquid users switch to other sources of energy

6All the information is based on data in the EIA IEO 2013.

12

Page 29: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

due to increase of the cost-competitiveness of other fuels. Petroleum and other liquid fuels consumption

in OECD areas like United States, Canada, Japan and Europe will remain relatively constant throughout

the projection, reaching 46.4 million barrels per day in 2040. The main reasons for this flat behaviour

are directly related to slow economic growth, population decline and policies to increase the efficiency of

motor vehicles.

In contrast, global liquids demand growth comes from Non-OECD countries (e.g. China and India)

due to their strong economic growth that increases consumption in the transportation and industrial

sectors. According to the projection, the Non-OECD share of world liquid fuels use rises from 47 percent

in 2010 to nearly 60 percent in 2040. In particular, Non-OECD Asia accounts for almost 70 percent of

the increase in global liquids demand, rising by more than 19 million barrels per day from 2010 to 2040.

On the other hand, the production can be distinguished in OPEC and Non-OPEC. According to

(EIA, 2013), the sources of production will meet the growing demand and World liquids production will

give a positive response to the significant increase in consumption of Non-OECD Asian countries. In

this sense, OPEC members contribute 13.8 million barrels per day to the growth of petroleum supplies

from 2010 to 2040, while Non-OPEC members contribute 11.5 million barrels per day over the same

period. This growth in total liquids production is mainly justified by exploration and development of

new and existing reserves (e.g. oil sands in Canada and pre-salt deep water fields in Brazil) thanks to

technological innovation. These technological advances allow oil drilling in areas of very difficult access

and therefore significantly increase oil extraction costs corresponding to an important investment share

for the industry.

Proved reserves of crude oil are the estimated quantity of energy sources that geological and engi-

neering data indicate can be recovered, with a reasonable level of certainty, from known reservoirs with

the existing equipment and under the existing operating conditions. These operating conditions includes

operational break-even price and contractual approvals in order to ensure the existence of oil reserves. In

January 2013, Venezuela is the country with the highest percentage of total oil proved reserves (18.2%)

and around one-half of the world’s proved oil reserves are located in the Middle East in countries like Saudi

Arabia (16.2%), Iran (9.4%), Iraq (8.6%), Kuwait (6.2%) and United Arab Emirates (6.0%). Non-OPEC

is mainly represented by Canada (10.6%) and Russia (4.9%).

13

Page 30: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

1

2

3

4

5

6

7

8

9

Change in world liquids production and consumption by region, 2010-2040 (million barrels per day)

0 5 10 15 20 25 30

ConsumptionProduction

1- OECD Europe2- OECD Asia3- OECD Americas4- Africa5- Non-OECD Europe and Eurasia6- Non-OECD Americas7- Middle East8- Non-OECD Asia9- World Total

Figure 2.6: World liquids production and consumption by region (2010-2040) based on data of the EIA. Thecombination of strong per capita income growth, rapid industrialization, higher energy intensity and rapid popu-lation growth in some emerging Non-OECD economies is responsible for the recent strong growth in oil demand.

2.4 The Role of Market Fundamentals and Speculation

Monthly producer prices for thousands of products over the period January 1945 through August

2005 and concludes that it is generally believed that since the 1973 oil crisis, oil and energy prices

have been more volatile than other commodity prices (Regnier, 2007). These large price fluctuations

are a recurrent aspect of the macroeconomic environment and represent a source of concern, worrying

consumers, producers and policy makers. But what is the cause? Analysts like James D. Hamilton

(Hamilton, 2008) offer two general causes:

• The world oil price represents a balance between supply and demand market forces;

• The speculative expectations are being responsible for the price volatility that occurs over days,

months, or years.

2.4.1 Demand

In Economics theory, a market equilibrium price depends on the elasticity of demand and is established

through competition such that the amount of goods or services sought by buyers is equal to the amount of

goods or services produced by sellers. Hence, elasticity of demand is a measure of the change of quantity

demanded of a good or service to a change in its price and depends on availability of substitutes and

their relative prices. In fact, this substitutes imply high price elasticity of demand.

In the crude oil demand context, the electricity generation is more elastic than the transport and

non-energy sectors. In the first case, the availability and cost of alternative energy sources as well as

its application time horizon justify the confidence for investing in substitutes. On the other hand, the

transport sector as one of the main oil consumers does not present a sufficient number of alternatives

14

Page 31: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

and oil can be considered as an essential good without substitute. However, the implementation of new

policies and technological developments suggest to further downward pressures upon demand. In terms

of energy policies, many developing countries control end-use prices, which inhibits consumer response

to market price changes.

Several analysts (see for example Kilian (2009), Helbling et al. (2008), Hamilton (2009)) argue that

GDP is an important factor for growing oil demand (see figure 2.7). In this sense, structural conditions of

each country’s economy influence the relationship between oil prices and economic growth. For example,

the combination of strong per capita income growth, rapid industrialization, higher energy intensity

and rapid population growth in some major emerging Non-OECD economies (e.g. China and India)

is responsible for the recent strong growth in oil demand. Otherwise, as mentioned in the previous

sub chapter, the flat behaviour of petroleum and other liquids fuels consumption in OECD countries is

mainly related to its slow economic growth and population decline. Thus, the consumption decreases

by the increase of crude oil prices and higher GDP assumptions or higher income elasticities of demand,

especially in fast growing economies of Non-OECD countries, may lead to a rise in oil prices or an increase

of OPEC market share of production. Therefore, OPEC may increase its power and its impact on market

control.

Figure 2.7: Nominal annual WTI crude oil price, World GDP and liquid fuels consumption. Data of panels (a),(e) and (f) is collected from EIA and all the GDP information (b), (c) and (d) is provided by OECD Statistics.There are several evidences that GDP is an important factor for growing oil demand, especially in Non-OECDeconomies.

Regarding to other financial variables, (Calvo, 2008) argues that the excess liquidity and declining

interest rates (see figure 2.8) can also influence the rising of oil prices. Note that the low interest rates

lead to a further expansion of the money supply, which also leads to an increase in oil demand. Indeed,

this rising of commodity prices is result of the excess liquidity in several countries and caused by the

low interest rates set by the central banks of seven developed nations (United States, Japan, France,

15

Page 32: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Germany, Italy, United Kingdom and Canada).

1995 2000 2005 2010

2060

100

Year

Dollars/bbl

a) Nominal WTI crude oil price

1995 2000 2005 2010

02

46

Year

% p

er a

nnum

b) US short-term interest rates

1995 2000 2005 2010

02

46

Year

% p

er a

nnum

c) Euro short-term interest rates

Figure 2.8: Nominal monthly WTI crude oil price and US and Euro short-term interest rates. Source: EIA andOECD Statistics.

Finally, we have to mention the effects of seasonal traditional factors in oil demand. Usually, oil

consumption increases during the travel season and for higher heating purposes. Thus, this increasing

demand for oil leads to an increase in oil prices.

According to the projections of (EIA, 2013), consumers outside the transportation and industrial

sectors will switch to other sources of energy due to rising prices of liquid fuels. These sectors are expected

to account for 92 percent of global liquid fuels demand in 2040. In addition, Non-OECD demand will

grow while OECD demand and global energy intensity7 exhibit a decreasing trend.

2.4.2 Supply

Demand forces alone cannot explain the persistent changes in crude oil prices seen in recent years.

Demand elasticity depends on the competitive market type and supply factors also play a fundamental

role. (Kaufmann, 2011) argues that oil prices are affected by its sources. This source effect is associated

with the behaviour of the two producer groups, OPEC and Non-OPEC countries (see figure 2.9), as well

as with all factors that influence the production costs of oil companies like exploration and development

of new and existing reserves, technological innovation in the petroleum supply chain and excess/storage

capacity levels.

Firstly, the behavioural differences discussed above imply that Non-OPEC countries are infra marginal

suppliers while OPEC countries are marginal suppliers. In fact, an infra marginal producer is willing

to part with lower price than the marginal producer would accept. Marginal suppliers are producers

able to increase (or decrease) their supply when demand increases (or decreases). If countries follow this

7Energy intensity is a measure of the energy efficiency of a country’s economy, which is calculated as units of energy perunit of GDP.

16

Page 33: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

trend, then production changes will have a considerable effect on crude oil prices, since any change of

Non-OPEC production that strengthens OPEC control will increase oil prices.

Non-OPEC producers, where oil production is mostly in the hands of NOCs and IOCs, are assumed

to be “price-takers” i.e. to produce until marginal costs equal the World price of oil and to restrict its

production to stabilize the market price. As a result, Non-OPEC producers tend to produce at or near

full capacity and have little spare capacity. Also, lower levels of Non-OPEC supply tend to put upward

pressure on prices by decreasing World global supply. The difference between estimated World demand

and estimated Non-OPEC supply is known as the “call on OPEC”. Thus, the greater the call on OPEC,

the greater is its ability to influence prices. OPEC may adjust member countries production targets

based on current and expectations of future supply and demand in order to influence prices. However,

this estimating process is especially challenging when market conditions are uncertain and are changing

rapidly.

Consequently, (Kaufmann, 1995) found that OPEC production strategy generally is consistent with

cooperation and non-cooperation behaviours. The first case of cooperation behaviour assume that OPEC

member countries matches output with existing demand through restrict its output from existing produc-

tion capacity to achieve price stability with allocating production quotas among them. In contrast, the

non-cooperation behaviour evidences the competition among themselves and with Non-OPEC producers

in order to get more market share of production.

On the other hand, the behaviour of crude oil price also depends on operation costs, development costs

and costs of discovery. In the long-term, research and technical progress reduce the price of oil through

innovations in exploration, production transportation and storage. For example, Non-OPEC production

mostly occurs in areas that have relatively high finding and production costs, as most of the lower cost

conventional oil resources are in OPEC member countries. As a result, Non-OPEC production usually

has a cost disadvantage compared to OPEC members. This cost is also linked with new production

technology developments, which may put downward pressure on crude oil prices.

The proved reserves have increased due to oil price shifts and technological changes. These reasons

allowed the extraction of new sources and increased the amount of oil extracted from a deposit. Geo-

graphically, the change in oil demand leads to the creation of new oil routes and oil price varies according

to producer-consumer distance. This feature may also increase the tanker fleet.

The influence of crude inventories, or the amount of crude oil that is stored, also plays an important

role and has impact on crude oil price trends since their level is sensitive to the relationship between the

current price and expectations of crude oil future prices. Inventories act as the balancing point between

supply and demand. During periods when production exceeds consumption, crude oil and petroleum

products can be stored for expected future use. In a nutshell, if market expectations indicate a change

toward relatively stronger future demand or lower future supply, prices for futures contracts will tend to

increase. On the other hand, a loss of current production or increase in current consumption will tend

to rise spot relative to futures prices and led to inventory draw downs to meet the current demand.

17

Page 34: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Figure 2.9: Nominal monthly WTI crude oil price and changes in World (OPEC and Non-OPEC) liquid fuelsproduction. Source: EIA. OPEC production acts to equilibrate the oil market. In particular, OPEC spareproduction levels were low (2003-2008), limiting its ability to respond to demand and price increases.

Figure 2.10: WTI crude oil futures price spread and OECD liquid fuels inventory based on data of the EIA.Source: Thomson Reuters. Liquid fuels inventory tends to follow the increases in future oil prices relative tocurrent prices and vice-versa.

Conversely, if futures prices rise relative to the current spot level, incentives to store oil will grow. On

the other hand, if market participants verify an increase in crude oil storage, this increase can indicate

that current production exceeds current consumption at the prevailing price. Spot prices will likely drop

to rebalance demand and supply forces. This balancing between current and future prices and between

supply and demand through inventories is one of the main relations between financial market participants

18

Page 35: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

and commercial companies with a physical interest in oil. In the figure 2.10, we verify that an increase

in the difference between the price of the oil futures contract 12 months ahead and the price of the next

month’s oil futures contract (spread) corresponds to an incentive to build inventories. However, given

the uncertainty of supply and demand, petroleum inventories are often seen as a unclear measure.

This uncertainty may increase the price volatility and so push up oil prices. It is also noted that

restrictions on the level of capacity available to refine specific high-grade petroleum products in the short

run also seem to be putting upward pressure on oil tanker rates at present, with consequences in oil

prices. To conclude, tight capacity is a result of unexpectedly high demand, and partly due to changes

in the global composition of demand and supply, with more tankers now being required to meet longer

supply lines from the Middle East to the dynamic Asian economies.

Another factor to take into account is the fact that Non-OPEC countries, which produce according

to their capacity, respond to the need to increase production. The time delay between the exploration

decision and production (typically 7 - 10 years) may cause large price fluctuations, especially when OPEC

countries are also producing near maximum capacity.

As mentioned in 2.3, according to the projections of (EIA, 2013), the World liquids production will

give a positive response to the growth of emergent economies. In addition, the next years are important

to attract investment in alternative fuels and there are a lot of scenarios about oil peak, by changing

supply and demand growth rates.

2.4.3 Speculation

What is speculation and how is it done on crude oil markets? The general economic concept is

defined in (Kilian and Murphy, 2013). A speculator is someone that buys any good not for current

consumption, but for future use from an economic point of view. Typically, speculative purchases of oil

will occur because the buyer (seller) is anticipating rising (falling) oil prices. Speculative buying/selling

may involve buying (selling) crude oil for physical storage leading to an accumulation (reduction) of oil

inventories, or it may involve buying/selling an oil futures contract, explained in next section.

In recent years, many financial layers have emerged around crude oil benchmarks and the speculative

demand represents one of the factors that possibly influence the oil price determination. These markets

have grown in terms of size, liquidity and sophistication and have attracted a diverse set of players both

physical and financial (pension funds, hedge funds, index investors, technical traders and high net worth

individuals) (Fattouh, 2011). They essentially wish to hedge their risk and to bet on oil price movements.

In this sense, the increasing “financialization” of oil futures markets (see figure 2.118) allowed speculation

to become a possible critical determinant of spot crude oil price.

According to (Fattouh et al., 2013), the presence of the financialization in oil futures markets is verified

in a wide variety of financial phenomena including oil price volatility changes, co-movement between oil

futures prices and other financial prices, a decreasing statistical dependence between oil inventories and

the oil price, and an increased influence of the decisions of financial investors.

8Open interest is the total number of futures contracts that are not closed or delivered on a particular day.

19

Page 36: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

2000 2005 2010

500

1000

1500

Year

Thou

sand

s of

con

tract

s

Average daily open interest in crude oil futures on US exchanges

Figure 2.11: Average daily open interest in crude oil futures on U.S. exchanges based on data of the EIA.Source: NYMEX Group. Open interest on crude oil futures exchanges has greatly increased in the last decade.

On the other hand, the increasing participation of financial investors in the oil futures markets is also

caused by improved knowledge of some economic variables which may possibly be associated with oil price

fluctuations. Besides the factors presented in sections 2.4.1 and 2.4.2, the scientific studies that surround

the dependence of crude oil price and global economic issues attract investors and increase the rationality

of their expectations. For example, in terms of speculative demand, the recent work (Chen et al., 2013)

studies the dependence between the oil price and the US dollar exchange rate. Given the importance of

the US dollar as the major currency in the oil markets, the negative relationship between oil prices and the

US exchange rate has attracted the interest of market agents. In particular, the analysis of dependence

between the oil price and the US dollar exchange rate provides important investment information for

speculators, hedgers, and arbitrageurs to make their trading strategies.

With the aim of analyse whether speculation has been driving the recent fluctuations in the crude oil

prices, we will describe briefly the six strands of the literature presented in (Fattouh et al., 2013). The

authors question the “popular view” that crude oil price cannot be explained by economic fundamentals

but by increased financialization of oil markets, which points to speculation as the main cause.

They firstly conclude that the oil price trends should be explained also based on common economic

fundamentals, refuting the attempts to link the increased participation of investors in oil futures markets

to evidence of increased co-movement among oil prices, other commodity prices and stock prices. This

co-movement is also found in markets in which index funds do not operate and for which there are no

exchange of futures.

Second, it is not convincing that there is a link from the positions taken by index fund traders in

particular to higher oil futures prices. Due to conflicting results in the literature, they argue that it

cannot be ruled out that this predictive power, if any, arises from traders positions responding to the oil

market fundamentals.

20

Page 37: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

The third object of research investigates if higher oil futures prices systematically precede increases in

the spot price of oil. In fact, there is no significant evidence that oil futures prices significantly improve

this type of forecast.

Fourth, they conclude that historically negative relationship between oil prices and oil inventories

cannot be insightful about quantitative importance of speculation in oil markets. They argue that

the absence or presence of speculative pressures in the oil market cannot be inferred from studying oil

inventory data without a fully specified structural model.

A fifth strand relies on structural vector autoregressive models to identify the role of speculation,

taking account of the mutual endogeneity of all oil market variables including the spot price and futures

price of oil. Thus, the authors consider that models are not sufficient supportive of speculation being an

important determinant of the real price of oil from 2003 until 2008. In fact, in the academic literature,

we can find several ideas that support or not the impact of speculation in oil price determination and

there is no consensus on how to model the global market for crude oil. Therefore, we can distinguish two

strands of the literature:

• the price of oil is determined by changes in oil inventories, which in turn reflect the expectations of

investors;

• the price of oil is determined between the fundamental forces (supply and demand), which represent,

respectively, the amount of produced and consumed oil (see Hamilton, 2008, 2009, Kilian, 2009).

For example, (Kilian and Murphy, 2013) presents a structural vector autoregressive model that allows

to qualify the importance of speculative demand for oil as well as supply and demand forces. Therefore,

the work establishes, for the first time, the convergence between each strand of the literature. The

expectations about future oil supply and future oil demand are represented by data on oil inventories,

which in turn reflect the shifts of the oil demand curve rather than the oil supply curve. This individual

analysis allows to highlight the effects of each factor in crude oil price fluctuations (see figure 2.12). Indeed,

results from the structural vector autoregressive model show that the supply shocks have a greater role

in explaining oil price fluctuations than previous estimates.

As we can see in figure 2.12 from (Kilian and Murphy, 2013), the authors also show that the largest

fluctuations in oil prices are associated with events related to the economic cycle. These events directly

influence the oil demand. In particular, contrary to the popular view that the movement of crude oil

prices between 2003 and 2008 (see figure 2.5) was associated with speculation, the demand shock had

a greater impact on price rising. However, they do not exclude the importance of speculation. In fact,

their structural-historical analysis show that the price fluctuations in some periods, namely in 1979, 1986,

1990 and 2002, cannot be explained without considering the speculative factor.

From the same figure 2.12, they also point out important considerations about the implications of

“peak oil” on oil price fluctuations. As to this relation, the last oil price fluctuations was caused primarily

by shifts in the global demand for oil. Therefore, it is expected that the oil price increases as the World

economy recovers. This fact, will raise some questions about reducing the energy consumption and

investing in alternative sources.

21

Page 38: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Figure 2.12: Cumulative effects of supply, demand and speculative demand on real crude oil price. Source:(Kilian and Murphy, 2013).

Finally, the recent explorations about the role of time-varying risk premium in oil futures markets

may help enhance the understanding of fluctuations in oil prices. However, these models still do not have

the capacity to explain in detail the crude oil price fluctuations.

To sum up, (Fattouh et al., 2013) argues that the absence of evidence in favour of speculation does not

mean that the financialization of oil futures markets does not matter. On the other hand, they highlight

the importance of the role of market heterogeneous expectations analysis, which is one of the objectives

of present study.

22

Page 39: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

3Crude Oil Financial Markets

In this chapter, we will firstly describe briefly the pricing mechanism of commodity futures contracts.

After, we will present the key stylized facts of crude oil financial markets with the aim of being able

validate our ABM.

3.1 The Pricing of Commodity Contracts

Commodities such as wheat, coffee, cocoa, sugar (soft commodities) or gold, rubber and oil (hard

commodities) trade through standardized contracts in terms of their characteristics (maturity, quantity

of commodity, quality or variety). These contracts are used by buyers and sellers of commodities to

control the price of future delivery and traders who want to profit from price fluctuations. Commodity

markets can include physical trading and financial derivatives. In an energy context, derivatives include

exchange-traded contracts such as futures and options, and over-the-counter derivatives such as forwards,

swaps and options1.

According to the research objectives, we will focus our attention on the futures contracts. However,

given the similarity between futures and forwards contracts, it is important to understand and clarify the

difference between them. First, we will start to define the two fundamental prices of each contract.

The spot price S(t) is the price at which a commodity can be bought or sold for immediate delivery.

For example, the spot price of an agricultural commodity tends to present a seasonal behaviour: the spot

prices rises just before a harvest, and decreases just after a harvest. Otherwise, the spot price fluctuations

of our target commodity are more difficult to interpret.

The futures price F (t, T ) corresponds to the price at which one can agree to buy or sell a commodity

at a given future time T without putting up any money now. The mechanism allows the futures price

1Exchange-traded derivative contracts are done on an organized futures exchange and require payment of an initialdeposit settled through a clearing house. In contrast, over-the-counter is done directly between two parties, without anysupervision.

23

Page 40: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

adjustment to balance demand to buy the commodity in the future with demand to sell it in the future.

In this sense, there is always someone in each side. This means that the total long interest (buy side) in

commodity contracts must equal the total short interest (sell side).

When the two periods t and T are equal, the futures price must equal the spot price,

F (t, t) ≡ S(t). (3.1)

Getting back to the difference between the two type of contracts, the main difference is the daily

settlement. In fact, daily settlement in futures trading is the process of settling the profit or loss made by

a futures position at the end of each trading day. Typically, the settlement price is set by determining the

weighted average price over a certain period of trading, typically shortly before the close of the market.

In more detail, when an investor opens a futures contract, the futures exchange will state a minimum

amount of money that one must deposit into its account. This original deposit of money is called the

initial margin. When its contract is liquidated, the investor will be refunded the initial margin plus or

minus any gains or losses that occur throughout of the futures contract period. The initial margin is

the minimum amount required to enter into a new futures contract, but the maintenance margin is the

lowest amount an account can reach before needing to be replenished.

For example, we consider that an investor had to deposit an initial margin of 1000 on a contract and

the maintenance margin level is 500. Then, a series of losses dropped the value of its account to 200.

This would then prompt the broker to make a margin call to you, requesting a deposit of at least an

additional 800 to bring the account back up to the initial margin level of 1000. Thus, we can conclude

that a futures contract is like a series of one-day forward contracts and is “marked to market”, which

means that there is a settlement and corresponding transfer of funds at the end of each trading day.

On the other hand, a futures contract is an agreement to deliver a specified quantity of a commodity

at a specified future date T, at a price to be paid at the time of delivery and are usually traded on

organized exchanges. The academic literature of commodity futures prices dates back to the Theory of

Normal Backwardation introduced by John Keynes (1930s), which compares futures prices to expected

future spot prices. He emphasized the financial risk posed by the necessity for carrying inventories of

agricultural products, suggesting that futures market should exist to reduce any substantial losses/gains

suffered. Thus, the theory is based on the definition of the basis that represents the difference between

the current futures price F (t, T ) maturing at time T and the current spot price S(t)

F (t, T )− S(t) = S(t, T )− S(t)− π(t, T ), (3.2)

where S(t, T ) is the spot price expected to prevail at time T and π(t, T ) is a risk premium.

Through the analysis of equation 3.2, in order to induce storage, futures price and expected spot

prices have to rise over time to compensate storage holders for the costs of storage. However, this cost

presents difficulties to explain downward futures curve. As a result, (Kaldor, 1939) introduced the Theory

of Storage that established the connection between spot and future prices, introducing the convenience

yield concept. This concept is reviewed in (Brennan and Schwartz, 1985) as the amount of benefit that

is associated with physically owning a particular good, rather than owning a futures contract for that

24

Page 41: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

good. For example, when there is a shortage of a particular good, it is better to already own the good

than to have to purchase it during the shortage at a higher price. The convenience yield corresponds to

the benefit of this situation.

According to (Coppola, 2008), the convenience yield in the crude oil market is important for two

fundamental reasons:

• the strategic benefit derived from the possession of the commodity;

• the relative scarcity that features this non-renewable resource.

Thus, the relation between futures and spot prices can be represented by

F (t, T ) = S(t) + (T − t)rt − ct,T . (3.3)

where rt represents the cost of storage per unit time and ct,T the convenience yield that in turn (Pindyck,

1994) is expressed as a function of the spot price, inventories level Nt and expected oil demand Qt+1

ct,T = c(S(t), Nt, Qt+1), (3.4)

while examined the behaviour of inventories and their role in the short-run dynamics of commodities

production and price. In fact, the convenience yield is high (low) when prices are high (low); changes

with the level of storage costs; has a seasonal behaviour; and is affected by changes in economic cycles.

3.2 Stylized Facts

In this sub chapter, we present a set of stylized facts arising from the statistical analysis of the

price time series in crude oil futures. According to (Cont, 2001), these empirical properties have the

particularity to be similar in almost all price series of stocks and commodities and market indexes for

various time periods.

The study of stylized facts is relatively recent (see for example Bollerslev et al. (1992), Brock and

De Lima (1995), Pagan (1996), Campbell et al. (1998)) and results from the availability of large amounts of

financial data that can be easily studied thanks to the exponential growth of computational power. In this

sense, the analysis of financial time series movements evolves from one based only on rational explanations

related to economic and political events to one based on a statistical standpoint empirical analysis, where

different types of series caused by different exogenous factors may have a common denominator.

The following presentation of stylized facts will follow the “pedagogical” approach of (Cont, 2001)

and aims to present the general properties that should a priori be present in any crude oil futures prices

time series reproduced in our model:

• absence of autocorrelation in returns;

• heavy-tailed distribution of returns;

• volatility clustering.

25

Page 42: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Beyond these stylized facts, there also other relevant effects which are present in financial markets such

as the gain/loss assymetry related to the assymetry of the distribution of returns, the negative correlation

between the volatility and the asset returns (leverage effect) and the correlation between volatility and

trading volume.

Before proceeding further, we will fix some notations. P (t) will denote the price of a financial asset.

Since the time scale used throughout the work corresponds to 1 business day (δt = 1), the logarithmic

return is defined as:

r(t, δt) =P (t)− P (t− δt)

P (t− δt)≈ lnP (t)− lnP (t− δt). (3.5)

The data used in this section consists of daily WTI crude oil spot prices from 02/01/1986 to 02/01/2014.2

3.2.1 Absence of Autocorrelations in Returns

The absence of autocorrelations in returns like other stylized facts offers two ways of explanation: a

financial one and a mathematical/statistical one.

Table 3.1: Descriptive statistics of WTI logarithmic returns.

WTI log returns

Mean 0.00019Median 0.00069

Maximum 0.19150Minimum -0.40640

Standard Deviation 0.02536Skewness -0.76204Kurtosis 17.95476

Number of observations 7064

The former one is due to the fact that the absence of significant linear correlations in asset prices

means that the sign of the next price fluctuation is unpredictable on average. Therefore, this widely

accepted stylized feature of daily returns, shows that each investment always has an associated risk and

the market itself has the ability to self-regulate in order to avoid situations of arbitrage opportunity.

Otherwise, if price variations exhibit significant correlation, this may be used to immediately follow a

strategy with expected profit. In addition, this market property proves the weak-form efficiency level

identified by tests of Eugene Fama in the 1960s. These tests found that short-run price movements

were mainly unpredictable by using past prices, which is consistent with a market that incorporates

information efficiently.

The latter shows us that the autocorrelation function of the price is given by

C(τ) = corr(r(t, δt), r(t+ τ, δt)), (3.6)

where corr is the sample correlation and τ represents the correlation time-lag. For example, figure 3.1

shows that the autocorrelation function of crude oil futures price rapidly decays to almost zero in a single

2Data is obtained from EIA.

26

Page 43: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

negotiation day. This fact is verified in (Cont, 2001) except for very short times (until few minutes),

where the correlation is negative.

0 200 400 600 800 1000

−0.

04−

0.02

0.00

0.02

0.04

Lag (days)

Autocorrelation function of crude oil spot price log returns (NYMEX)

Figure 3.1: Autocorrelation function of WTI crude oil spot price logarithmic returns. The series are the dailyreturn series of NYMEX from 1986 to 2014. As we can see, the correlation of returns is insignificant and therefore,the prices signal is unpredictable.

3.2.2 Heavy-tailed Distribution of Returns

The study of the distribution of asset returns is an attractive target for empirical research in financial

econometrics. In 1960s, Mandelbrot and Taylor (Mandelbrot and Taylor (1967)) argued that the Gaus-

sian distribution was not sufficient for modelling the distribution of asset returns and their heavy-tailed

character. This empirical evidence is a stylized fact observed in various financial markets.

The first statistical property that proves the non-Gaussian character is the kurtosis used in distribution

analysis as a sign of flattening and defined as

κ =〈(r(t, T )− 〈r(t, T )〉)4〉

σ4− 3, (3.7)

where σ is the standard deviation of logarithmic returns defined in equation 3.5. Thus, a positive value of

κ indicates a fat tail distribution, which is different from a Gaussian distribution with κ = 0 represented

in blue in the figure 5.8. But, what is the better distribution for modelling the distribution of asset

returns? In literature, there is a lot of parametric studies which include distributions such as the Student

distribution, hyperbolic distributions, normal inverse Gaussian distributions and exponentially truncated

stable distributions. However, according to Cont, this choice must obey a set of parameters such as

a location parameter, a scale parameter, a parameter describing the slow decay of the tails and an

asymmetry parameter that describes the difference between the left and right tails. In this sense, normal

inverse Gaussian distributions (see Barndorff-Nielsen (1997)), generalized hyperbolic distributions (see

Prause (1999)) and exponentially truncated stable distributions (see Cont et al. (1997)) seem to be good

choices to correctly model the shape of the distribution of returns.

27

Page 44: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Histogram of crude oil spot price log returns (NYMEX)

Log returns

Den

sity

−0.2 −0.1 0.0 0.1 0.2

05

1015

2025

Figure 3.2: Histogram of crude oil spot price logarithmic returns, kernel estimator of the density (red) andnormal distribution (blue) with the mean and standard deviation of logarithmic returns. There is a strongdeparture from normality hypothesis in the empirical distribution of crude oil returns.

The financial explanation for this stylized fact suggests that prices do not follow a simple random walk

and are subject to fluctuations like sudden declines of stock prices or speculative stock market bubbles,

which occur more frequently than predicted by the Gaussian distribution hypothesis. These events cannot

be explained by Gaussian returns and there is a need to quantify its heavy-tailed character.

In order to describe the heavy-tailed character of the distribution of returns, we need to introduce

the complementary cumulative distribution function or tail distribution to know how often the random

variable is in excess

FX(x) = 1− FX(x) = 1− Prob(X ≤ x) = Prob(X > x). (3.8)

One can consider that tail index α of a distribution, among others, can be defined as the order of the

highest finite absolute moment or through Hill estimator technique. By this measure, we conclude about

how heavy is the tail of the distribution of returns. Otherwise, the tail distribution can be approximated

by a Pareto-like or a power law FX(x) ∼ x−α. According to Cont, this exponent is higher than two and

less than five for most data financial sets.

3.2.3 Volatility Clustering

The financial volatility is a measure that evaluates the price variations of a financial series over time. In

this sense, from the investor’s point of view, is a variable that reflects the uncertainty of their investments

for many reasons. One of them is obviously related with the fact that the higher the volatility, the riskier

the asset. The volatility clustering was observed by Maldelbrot in 1963 (see Mandelbrot and Taylor

(1967)).

28

Page 45: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

0 1000 2000 3000 4000 5000 6000 7000

−0.

4−

0.3

−0.

2−

0.1

0.0

0.1

0.2

Crude oil spot price log returns (NYMEX)

Time (days)

Figure 3.3: Logarithmic returns of crude oil spot price from 02/01/1986 to 02/01/2014.

In terms of financial evidence, this stylized fact shows that large price variation are more likely to be

followed by large price variations. As we can see in figure 3.3, the behaviour of returns shows intermittence

and there is a dispersed agglomeration of returns with the same amplitude. In fact, large fluctuations tend

to be followed by large ones and vice versa. This empirical property does not invalidate the absence of

autocorrelations in returns. However, although the unpredictability of the signal of next price variation,

the next price fluctuation is correlated with the previous.

This stylized fact is usually quantified by the autocorrelation function of the squared or absolute

returns (see figure 3.4). Various empirical studies (see for example Granger and Ding (1999)) indicate

that this function shows a slow decay, although still significantly positive.

0 200 400 600 800 1000

−0.

10.

00.

10.

20.

3

Autocorrelation of raw, squared and absolute spot price log returns

Lag (days)

Raw returns

Absolute returns

Squared returns

Figure 3.4: Behaviour of autocorrelation functions of raw, squared and absolute spot price logarithmic returns.We can see that the autocorrelation functions of absolute and square returns decays slowly as a function of thetime lag.

29

Page 46: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

30

Page 47: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

4Agent-based Modelling

In this chapter, we begin by describing the main features of agent-based modelling and its application

in financial markets. Then, will be presented all the literature review. This review will be divided in two

steps. First, the general outlines of ABMs will be described in terms of heterogeneity and rationality.

Secondly, we will discuss three ABMs which well represent the development of this field in a schematic

way according to some categories. Finally, the last section presents some examples of ABMs in crude oil

financial market context.

4.1 Foundations of Agent-based Modelling

The need to explore and better understand the complex behaviour patterns of the real-world business

problems has opened the door to the ABMs. Through this modelling technique, it is possible to represent

a set of autonomous decision-making entities called agents. Each agent is able to assess its position

and take decisions based on heuristic rules. According to (Bonabeau, 2002), these rational agents are

connected and may be capable of learn, adapt and reproduce. In this sense, the main feature of ABMs is

the capacity to reproduce successive actions and interactions of individuals and organizations and take

conclusions resulting from the study of the real-world dynamical system as a whole as well as agent’s

individual behaviour.

In (Jennings, 2000, p. 280) is presented a general characterization of an agent, consensual for a

considerable number of researchers in Artificial Intelligence field:

An agent is an encapsulated computer system that is situated in some environment and that

is capable of flexible, autonomous action in that environment in order to meet its design

objectives.

According to the above definition, each agent can differ from one individual without cognitive function

to a sophisticated goal-directed behaviour with learning abilities. In particular, they perceive their

31

Page 48: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

environment and their heterogeneity is explained by the diversity of their preferences, experiences and

proceedings to adapt continuously to a certain situation. In order to achieve its objectives, the agent

adaptive behaviour may be done from several learning processes like inductive reasoning, reinforcement

learning as well as social herding mechanisms.

But, what is the main tool to model all this ABM features? The use of computing power tools

allows to model the complex interdependencies and all learning/feedback mechanisms. In this sense, the

computational power offers benefits over other modelling techniques in terms of flexibility and realism.

While flexibility is given by the possibility of generate more agents and tune its degree of rationality and

ability to learn and evolve, realism is provided by a system composed by behavioural entities that offers a

natural description of the real-world and captures emergent phenomena resulting from agents interaction.

In sum, the ABMs are closer to reality and their target systems represent a crucial macro level in

which the interaction between agents is non-linear, discontinuous and discrete and the agents exhibit

complex behaviour, including learning and adaptation. Will the financial markets exhibit this type of

properties and a plausible target for an ABM?

4.2 Agent-based Modelling in Financial Markets

As referred before, ABMs allow to analyse the interdependencies between an agent composed micro

level and the macro level, which represents the market structure. This approach seems beneficial to

simulate the evolution of a financial market. First, it can be seen that financial agents fullfill the main

ingredients of an ABM. In fact, from a simple perspective, they are autonomous to take their decisions,

which are based on a successive collection of inputs about their state and financial environment, and

interact on a market structure in order to try different solutions to increase their profit. Thus, what are

the main advantages of this modelling technique applied to the financial world?

Before answering this question, it is important to identify the first steps of Agent-based Computational

Finance. In this aspect, the concepts of market efficiency hypothesis, the capital asset pricing model

assumptions, and the Black/Scholes options pricing formula (Hull, 1997) were crucials to strengthen the

scientific basis of the financial markets. On the other hand, the availability of large machine-readable

data improved the financial analysis rigour and the computational power became the main analysis tool

for process the beliefs of traders. Returning to the previous question, the ABM in financial context is

particularly useful for the following reasons:

• the limitations of econometric models, unable to give a long-term response to major changes in

the system, and the traditional theories of general equilibrium that do not describe the non-linear

dynamics of economic fluctuations, stress the need to understand and simulate complex systems

through ABMs. In particular, according to (Bouchaud, 2008), (Farmer and Foley, 2009) and (Kir-

man, 2010), the traditional models in economics and finance are not sufficient to study crisis situ-

ations;

• the development of computer systems allows a better description of financial markets as interacting

groups of rational agents with dynamic heterogeneity represented by their distribution of wealth,

32

Page 49: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

different investment strategies or risk aversion parameters;

• there is a considerable list of financial stylized facts without full explanation. This list includes

facts about trading volume, returns distribution and correlations with returns and volatility ((Cont,

2001));

• the market efficiency concept surveyed in (Malkiel and Fama, 1970) and (Fama, 1991) does not

collect the general consensus of the financial community and the efficiency line is not well defined;

• the availability and quality of current financial data gives the possibility to accurately detail the

market dynamics as well as validate and calibrate an ABM. This level of detail acquired over the

past few decades include many information about high frequency price evolution, volume trading

and consequently draw important conclusions about the trading dynamics;

• to summarize, there is a growing research about heterogeneity and rationality in financial markets.

As a consequence, a great variety of models have been put forward over the last two decades, which

will be discussed in the next section.

4.3 Literature Review

As previously referred, there is a growing scientific research on heterogeneity and rationality in finan-

cial markets. The idea of total homogeneity and perfect rationality has lost many supporters in recent

decades. In fact, the current Economy depends of the decisions taken on the basis of individual expecta-

tions and beliefs about the future progress. In the present work context, the speculative movements of a

risky asset market are linked to the fact that an investor buys (sells) stocks today when he expects stock

prices to rise (fall) in the future. This type of different expectations of different group of traders affect

individual decisions which, in turn, influence the market dynamics in terms of future prices, asset price

fluctuations and traded quantities.

The first attempts to use ABMs in financial markets to explain some empirical features from financial

data were made in 1990s (see for example Kim and Markowitz (1989), Lux (1995), LeBaron et al. (1999)).

The early market model of Kim and Markowitz is focused on the real causes of the Black Monday.1 In

fact, the authors wanted to investigate whether the presence of hedging and portfolio insurance strategies

can destabilize the market or produce a significant increase of volatility. Finally, (Lux, 1995) and (LeBaron

et al., 1999) seek to support the statistical evidences of financial series through a model of the interaction

of speculators in a financial market. (Lux, 1995) attempts to explain bubbles and crashes in speculative

markets from the idea that investors base their positions through a herding behaviour. In particular,

the second work presents results from the SFI artificial stock market, discussed later. In this study, the

resulting time series are analysed from the standpoint of well-known empirical features in real markets,

including fundamental and technical predictability, volatility persistence, and leptokurtosis.

In the literature of ABMs, extensively discussed in the revision works of (Hommes, 2006), (LeBaron,

2006), (Chiarella et al., 2009), (Lux, 2009) and (Chen et al., 2012), it is possible to identify the two

1Black Monday refers to Monday, October 19, 1987, when stock markets around the world crashed, decreasing the valuein a very short time.

33

Page 50: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

main modelling elements of an ABM: heterogeneity and rationality (learning). These elements allow

highlighting the different perspectives of the various ABMs according to their realism and analytical

tractability which in turn can be classified as either analytically or computationally oriented in general.

This classification is justified by the existence of models with a significant number of groups of agents

and complex learning mechanisms that are difficult to treat analytically. While (LeBaron, 2006) presents

the related work on computational ABMs in finance where analytic solutions are impossible, (Hommes,

2006), (Chiarella et al., 2009) and (Lux, 2009) discuss the state of the art of analytically tractable

ABMs or HAMs. They emphasize simple models that are to some extent solvable by analytical tools.

In particular, Chen et al. presents both categories and builds its review about the taxonomy of agent-

based computational finance models based on the design of agents, highlighting the advantages of an

econometric support to validate and calibrate them.

Through the reviews mentioned above, we will examine separately the two main modelling elements

of an ABM (heterogeneity and rationality) in terms of their simplicity and complexity. Through this

analysis, we intend to cover all types of ABMs. In fact, we want to show the main design parts of the

literature in order to build and develop our ABM.

• Heterogeneity

In terms of heterogeneity, we can distinguish the financial agents by their beliefs, trading strategies,

informations exposure, risk aversion or wealth. In this sense, we have ABMs with few types of agents, as

well as models where the number is infinite.

Within ABMs with simple heterogeneity (see for example Hommes (2006)), typically there are two

trader groups: chartists or technicals and fundamentalists. This distinction, introduced by (Frankel and

Froot, 1986), was motivated by the empirical evidence of the behaviour of financial agents collected from

different kinds of surveys, such as questionnaires and telephone interviews. In their work, fundamentalists

base their expectations on economic theory relying on the perceived evolution of market fundamentals. On

the other hand, chartists base their expectations on observed historical price patterns. They extrapolate

information from previous prices, expecting trends to continue in the same direction. Subsequently,

(Taylor and Allen, 1992) confirm Frankel and Froot’s assumption of the existence of technical traders

in foreign exchange markets, describing the distinction as follows: “chartists study the price action of

a market, whereas fundamentalists look for the reason behind that action.” In a general sense, we can

characterize the expectations Eh,t of each type of agent h as follows:

Eh,t(Pt+1) = Fh,t(Pt, Pt+1, Pt+2, ...), (4.1)

where Fh,t represents the strategy or the forecasting rule at time t.

For this two trader groups (fundamentalists f and chartists c), many ABMs consider that their

forecasting strategies are governed by a very simple setting

Ef,t(Pt+1) = Pt + αf (P ft − Pt), 0 ≤ αf ≤ 1, (4.2)

Ec,t(Pt+1) = Pt + αc(Pt − Pt−1), 0 ≤ αc. (4.3)

34

Page 51: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

These two forecasting strategies are based in the fact that the fundamental agents have a mean-reverting

rule, characterized by a coefficient αf , while the chartists have a trend-following behaviour, represented

by αc. The first coefficient reflects the reaction speed to an overvaluation (αf > 0) or undervaluation

(αf < 0) caused by the deviation of the price from the fundamental value P ft . The latter coefficient

represents the degree to which chartists expect trend movements to continue in the same direction.

However, there are a lot of more sophisticated financial trading strategies with the purpose of forecast-

ing future price trends and tracking market behaviour. In addition, the latest developments in computer

technology allow investors to have at their disposal a wide range of technical tools to better understand

the price movements and their relation with financial indicators2. Among those tools, there are the

well-known moving-average crossovers and mean-reverting moving averages.

Considering this two types of agents, (Beja and Goldman, 1980) had argued that the demand of

fundamentalists has a stabilizing effect on the asset price in contrast to chartists. This seminal work

initiates a series of other ones that show that heterogeneous expectations of market participants give rise

to an unstable behaviour of stock markets such as (Day and Huang, 1990), (Chiarella, 1992) and (Lux,

1995) among others. On the other hand, the original mechanisms of Beja and Goldman work are still

present in many other works and remain helpful to understand what is going on in a model-generated

price history. They use the dynamic systems tools to examine the dynamic characteristics of a simple

model of the market price adjustment in a disequilibrium setting which, in turn, is forced by the excess

demand of investors (chartists and fundamentalists).

In terms of price determination, Day and Huang work offers a market-maker scenario. The market

has a price, and investors submit demands to buy and sell at this price. If there is an excess demand D

(supply S) the price is increased (decreased) and changes with a positive price adjustment parameter α.

Pt+1 = Pt + α(D − S) (4.4)

There are other mechanisms in the literature. According to equation 4.4, market was most of the

time out of equilibrium with either more buyers or sellers. In this sense, a second market mechanism is

presented by (Arthur, 1996) in SFI artificial stock market and (Brock and Hommes, 1998) in order to

clear the market in each negotiation day. Agents come to the market with an order to buy or sell 1 share

of stock. The smaller of these two sets of buyers and sellers is satisfied while the other is partitioned. For

example, if there is 20 buyers and 10 sellers, the sellers sell 1 share and the buyers get only 1/2 share.

However, the market price adjustment is similar to the previous.

The other example of the literature is represented in (Chiarella and Iori, 2002). They simulate a true

order book with heterogeneous agents who post offers to buy and sell stock. Through this mechanism,

orders are stored and executed in the sequence they arrive at the market. A transaction occurs via a

central order matching mechanism, when a trader hits the quote on the opposite side of the market.

Among all types of ABMs, the two-type design is generally accepted in the literature as the simplest

kind of heterogeneity which a model can have. However, the behaviour of financial agents can be more

complex and finely differentiated in more types of agents. For example, in a N-type design we can include

2See (Murphy, 1999) for more information about technical analysis.

35

Page 52: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

the participation of contrarians and noise traders. The contrarian agents resort to technical analysis,

considering that the price movements follow the opposite of the trend, while the noise traders are added

to the system in order to represent the investor without any kind of rationality. Obviously, heterogeneity

is also created by the multiplicity of behavioural rules. The advances in financial agent engineering

based on the behavioural finance theories, allow to model more accurately the psychological component

of investors.

In terms of complex heterogeneity, we highlight the ABMs where artificial financial agents will learn

and discover on their own and the number of types of agents is infinite. In the N-type designs, investors

can only choose strategies that are predefined and there will be no new rules available unless they are

added posteriorly.

In the computer science field of Artificial Intelligence, the genetic algorithms, introduced by John

Holland in 1970s, allow designing artificial financial agents who are able to reproduce on their own.3 In

this sense, an adaptive financial agent could also be creative and spontaneous. For example, the SFI

artificial stock markets model (Arthur, 1996) reproduces a market, where there is an unlimited number

of types of agents. This model served as a starting point for many autonomous-agent designs such as

(Arifovic and Gencay, 2000), (Lawrenz and Westerhoff, 2003) or (Martinez-Jaramillo and Tsang, 2009).

The details of this mechanism will then be addressed in the discussion of rationality in ABMs.

After analysing the heterogeneity issues related to the number of types of agents, remains now to see

how agents’ wealth is distributed among different assets or futures contract positions and their tendency

to choose a risky or less risky option. In fact, an important feature of ABMs concerns the demand

specification. In this sense, economic standard models generally use a canonical model for decisions

under uncertainty, in which individuals have a single utility function over wealth, which gives rise to risk

preferences. At the other hand, there is a large literature in psychology and behavioural economics about

how individuals make decisions across different contexts.

Most ABMs in financial markets follow a strategy in which demand for both trader types is derived

in a standard expected-utility maximization and depends on the risk preference of each agent h. Risk

preference is crucial for the determination of agents’ portfolio. In the standard theory of finance, we

can distinguish three widely accepted classes of risk preferences. The first one is the mean-variance

preference, introduced by Harry Markowitz (Markowitz, 1952), who later received the 1990 Nobel Prize

in Economics for this contribution. This mean-variance preference assumes that financial agents base

their risky investments with the mean and variance of returns. The other ones are the CARA and

CRRA. While CARA admits that agents’ demand is independent of their changes in wealth, CRRA

assumes that demand will increase with wealth through a linear way.4

In the literature, many ABMs (see for example Gaunersdorfer (2000), Brock et al. (2005), Hommes

(2011)) employ the setting where investors determine their portfolio fraction using a standard mean

variance decision rule. In these studies agents can either invest in a risk free or in a risky asset. Next

period’s wealth Wh,t+1 of each agent h is given by

3(Mitchell, 1998) provides a overview of genetic algorithm literature.4The distinction between CARA and CRRA was introduced in (Pratt, 1964) and (Arrow, 1965), which also relates these

concepts with utility maximization.

36

Page 53: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Wh,t+1 = RWt + (Pt+1 + yt+1 −RPt)dh,t, (4.5)

where pt is the price per share and yt is the stochastic dividend process of the risky asset. R = 1 + r

represents the gross rate of risk free return and dh,t denotes the number of shares of the risky asset

purchased at time t. In order to compute the demand of each agent h, they assume that agents are

myopic mean-variance maximizers and

Maxdh,t{Eh,t[Wt+1]− µ

2Vh,t[Wt+1]}, (4.6)

where Eh,t characterize the expectations of each agent h, Vh,t represents the conditional variance and

µ is the coefficient of risk aversion. As in (Grossman and Stiglitz, 1980), that under CARA utility and

Gaussian distributions for predictions, the demand dh,t for risky assets by agent is linear in the expected

excess return

dh,t =Eh,t[Pt+1 + yt+1 −RPt]µhVh,t[Pt+1 + yt+1 −RPt]

=Eh,t[Pt+1 + yt+1 −RPt]

µhσ2h,t

. (4.7)

Risk aversion prevents investors from taking an infinite position based on expect return differentials.

In contrast to this formulation, (Anufriev and Dindo, 2010) assumes that demand increases linearly with

agents’ wealth (CRRA).5

• Rationality

Regarding rationality and learning, there is also a spectrum from simple learning to complex learning

algorithms. Examples of the former are herding mechanism, belief learning and reinforcement learning.6

The complex learning algorithms can be exemplified by artificial neural networks or genetic algorithms.

Within ABMs with simple rationality, an important line of research is introduced by (Brock and

Hommes, 1997) and (Brock and Hommes, 1998). They present a form of evolutionary dynamics called

ABS. The first discusses the concept of adaptively rational equilibrium in which the financial agents

adapt their beliefs according to different predictor or expectation functions, while the second studies the

dynamics of a simple asset pricing model with heterogeneous beliefs. In fact, the population adapt their

beliefs over time according to some measure of performance, such as profits of corresponding strategies.

Following this methodology, the model allows to investigate dynamic evolutionary processes and how

expectations feedback affects aggregate market behaviour. The main tool that describes this dynamics is

the so-called discrete choice model, or more specifically, logit model or the Gibbs-Boltzmann distribution

that is useful to the psychological theory of choice but applied in financial markets context by Brock and

Hommes

Prob(X = h, t) =eλUh,t−1∑Hj=1 e

λUj,t−1

, h = 1, 2, ..., N, (4.8)

5(Levy et al., 1994) is another example of CRRA preferences in an agent-based market.6(Duffy, 2006) and (Brenner, 2006) present overviews of the existing learning models in the economic literature used in

ABMs.

37

Page 54: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

where λ is the intensity of choice parameter that measures the sensitivity of each agent following the

most successful strategy h evaluated by Uh,t−1.

Based on the concepts introduced by Beja and Goldman and Brock and Hommes, a great variety of

HAMs have been developed. A feature of these models is the time variation of the market fraction, fixed

in the Beja-Goldman model, that reflects the adaptive aspects of financial agents. These models seem

to be similar to each other, differing in specification details such as market price determination, agents’

preferences and forecasting strategies.

For example, to quote only a few, asset price and wealth dynamics with heterogeneous expectations

and beliefs are discussed in (Chiarella and He, 2001), (Anufriev and Dindo, 2010) and (Anufriev and

Hommes, 2012) with evolutionary selection, driving by relative performance of expectation rules. (Farmer

and Joshi, 2002) and (Chiarella and He, 2003) are also HAMs with a market maker scenario with risk

aversion and learning features. (Chiarella et al., 2006) presents a dynamic model with moving average

strategies. (Feng et al., 2012) is another example which develops a linking model with stochastic models

of financial markets. Finally, (He and Li, 2012) is a continuous-time asset price model.

These models have successfully explained many market dynamics, including bubbles and crashes, and

replicated various stylized facts such as absence of autocorrelations, volatility clustering, fat tails and

long memory of returns, among others. In this context, we highlight the work of (Hommes, 2002) about

the stylized facts in finance obtained through ABS.

In the literature, we can distinguish two more types of “simple” learning. They are introduced by

the Kirman model (Kirman, 1993) and the Lux model (Lux, 1998). The former is a two-type model of

chartists and fundamentalists. This model provides a learning mechanism inspired by the behaviour of

ants. In particular, (Kirman, 1993, p. 137) summarizes the behaviour of ants as follow:

Ants, faced with two identical food sources, were observed to concentrate more on one of

these, but after a period they would turn their attention to the other.

In this sense, the switching mechanism is not driven by the logit model of Brock and Hommes (equa-

tion 4.8), but by a herding mechanism. Through this mechanism, the most successful strategy is not

determined by the financial success. On the other hand, the dynamic evolution of the process is given

by the fraction of the majority as the main determinant for strategy selection, and by two parameters:

a probability of self-conversion and a probability of being converted. The Lux model is also a two-type

model, but the chartists are divided in two groups of optimists and pessimists. In addition, despite

presenting a continuous-time asset price model with a different mathematical structure, Lux establishes

the connection between the herding mechanism of Kirman and the Logit model of Brock and Hommes.

This connection is made through a transition probabilities function, which is controlled by the difference

in trading profits between chartists and fundamentalists and is affected by the number of traders in each

group.

Another classic example of rationality in financial markets is the well-known minority game, introduced

by (Challet and Zhang, 1997). Through this mechanism, an agent chooses between buy or sell a given

amount of stocks. Consequently, an agent will receive the reward if, after the decisions of the agents, he

38

Page 55: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

pick the less chosen strategy. In the literature, many different versions of this model exist. For example,

(Challet et al., 2001) specifically study the origin of the stylized facts of the minority game.

In terms of addressing the causes that give rise to the emergence of stylized facts, we stand out the

work of (Cristelli, 2013). In fact, it investigates the origin of the stylized facts of financial markets present

in general ABMs and concludes that stylized facts can be interpreted as a finite size effect in terms of the

number of active agents, which results to be fundamental to understand the self-organization of financial

markets.

The complexity of learning behaviour increases with the implementation of genetic algorithms or

artificial neural networks. In fact, much of ABMs literature has used tools taken from the artificial

intelligence. As previously stated, the SFI artificial stock markets model (Arthur, 1996) is one of the

most sophisticated of early agent-based markets based on genetic algorithms.7

In this sense, the algorithm starts typically with a population set created randomly and each member

of population is represented as a genome or string, by an encoding process. The other input is the fitness

function, which is the criterion for evaluating the fitness of each member. The operations performed on the

initial species are selection, crossover and mutation.8 These operations allow that the next generation is

created and the decision about which genome are to be replaced depends on the fitness function. Finally,

the lower the fitness value of a genome, the greater is the chance of it being replaced.

Other variants of ABMs with varying degrees of learning capabilities are represented, for example, in

(Yang, 2002). In this work, the author develops a model where artificial neural networks assume the role

of traders. In fact, the field of neural networks allows to model human cognitive learning processes by

reproducing the brain structures.9

These networks consist of a set of layers: input layer, hidden layer (or layers) and output layer. All

layers consist of neurons except the input layer. The signals x are received at the input layer and are

transmitted to the hidden layer (or layers). Then, the signals are transformed, usually using a smooth

logistic approximation to a step or threshold function. Finally, the transformed signals are transmitted

to an output layer, where are transformed again. Each link of the neural network is characterised by a

weight wi,h,k(positive for exciting, negative for inhibiting) and the network is characterised by the set of

weights. In this mechanism, learning occurs as the weights are changed, which also alters the network.

In conclusion, the movement from the two-type to infinite-type models, and its further evolution to

the computational models can be characterized by a higher degree of heterogeneity and a more complex

learning behaviour. But, what are the main benefits of this evolution? Can we explain more stylized

facts by increasing the complexity of an ABM?

In search for answer to these questions, we will present three ABMs which well represent the main

ideas of agent-based modelling. The choice is essentially based on the importance of these models for

the evolution of agent-based modelling in three strands: computational orientation, dynamics between

chartists and fundamentalists and analyticity of the problem. The further analysis of each model is

performed according to some categories in order to explain in more detail the various stages of building

7See also (Arifovic, 1996) and (Routledge, 2001).8(Goldberg et al., 1989) covers all of the important details of these operations.9(Beltratti et al., 1996) has useful information about neural networks in economic and financial modelling.

39

Page 56: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

an ABM.

4.3.1 SFI Artificial Stock Market

• Objectives

The SFI artificial stock market (Arthur, 1996) is one of the primary ABMs and results from the

collaboration of researchers of various fields such as Physics, Economics and Computer Sciences. The

main objective of this model is to create an heterogeneous scenario in financial markets. In this sense, the

authors developed a theory of asset pricing based on heterogeneous agents who adapt their expectations

of the market that is itself generated by the agglomeration of these same expectations. Consequently,

they want to explore and investigate the regimes created by this heterogeneous market. Fundamentally,

the authors seek to know whether the strategies of the agents tend to a rational homogeneous state or

whether market participants are able to select strategies in order to obtain a realistic price dynamics.

• Analytical tractability/realism

The present model does not allow for analytical approach and therefore has a very limited tractability.

However, this model presents a structure very close to reality, since heterogeneity is introduced into the

market expectations. Besides this factor, the introduction of genetic algorithms allows to generate an

autonomous evolution of agents’ expectations. This fact allows to study the emergence of strategy

patterns during the successive learning of the agents. The number of agents is constant over time.

• Market structure, heterogeneity and learning

First of all, the market structure was designed according to a simplistic perspective which is composed

by two tradeable assets: a risk-free bond with interest rate rf and a risky asset, paying a stochastic

dividend yt which is assumed to follow the following autoregressive progress of first order,

yt = y + P (yt−1 − y + εt), (4.9)

where εt ≈ N(0, σ2ε ).

In terms of demand specification, agents’ wealth is distributed among different assets according to

the theory of utility U(W ) maximization, where W is their wealth. Therefore, this process follows the

structure presented in equation 4.7. In this model, the optimal allocation dh,t of the risky asset is given

by

dh,t =Eh,t[Pt+1 + yt+1]− Pt(1 + rf )

µσ2h,t,P+y

, (4.10)

where h represents the fact that beliefs may differ across agents and σ2h,t,p+y measures the confidence of

the prediction Eh,t. The forecast function is assumed to be linear in the current price and dividend,

Eh,t[Pt+1 + yt+1] = aj + bj(Pt + yt). (4.11)

The j subscript refers to the rule chosen by agent h.

40

Page 57: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

In fact, each agent is equipped with multiple linear models composed by the coefficients aj and bj .

These coefficients change over time and are dependent of specific market conditions, which in turn can

be associated to a state of the economy. This methodology is similar to what is known as classification

and regression trees or decision trees.10

For example, in SFI model, a classifier rule is given by a bit-string and a parameter vector,

(0, 1, ?, 1; aj , bj , σ2j ).

The first part of the classifier rule matches current conditions in the market. In a condition-action

modelling process, each bit is associated to a condition. In this sense, a 1 would match a true condition,

and a 0 a false condition. There is also a signal ? which represents uncertainty and can be true or false.

The rules are then evaluated according to a weighted average of a rule’s past squared forecast errors

e2t,h,j = (1− θ)e2t−1,h,j + θ((Pt + yt)− (ah,j(Pt−1 + yt−1) + bh,j))2, (4.12)

where θ is a fixed open parameter. The conditions used in the SFI market are given in table 4.1.

Table 4.1: Condition bits of SFI artificial stock market.

Bit Condition

1 Price × Interest/Dividend > 1/42 Price × Interest/Dividend > 1/23 Price × Interest/Dividend > 3/44 Price × Interest/Dividend > 7/85 Price × Interest/Dividend > 16 Price × Interest/Dividend > 9/87 Price > 5 Period Moving Average8 Price > 10 Period Moving Average9 Price > 100 Period Moving Average10 Price > 500 Period Moving Average

But, how agents learn over time? Basically, the market participants have to compete in a hetero-

geneous world of strategies and form their forecasts by learning and adaptation. The agent is allowed

to learn and change its strategy by altering the set of rules. This learning process allows to eliminate

poorly performing rules and add new ones through a genetic algorithm, which will then be allowed to

compete with the existing forecasting rules. The genetic algorithm initially removes the worst strategies,

according to a fitness measure given by

fh,t = M − e2t,h,j − Cs, (4.13)

where M is a constant, s represents the number of bits that are set (not ?) and C is the cost levied for

each bit. Finally, new rules are generated through one of two operations: crossover and mutation.11

• Price formation

10(Breiman et al., 1984) provides the methodology used to construct tree structured rules.11The details of these operations are covered in (LeBaron et al., 1999).

41

Page 58: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

The asset price is adjusted to reflect either the excess demand and supply. This market price ad-

justment is presented above in equation 4.4. In this model the α parameter corresponds to the market

depth that reflects the ease with which traders find others to trade at a established price. (LeBaron,

2002) identifies two problems of this pricing mechanism related to the market depth dependence and the

unfilled orders. In fact, if α is too high, the market oscillates between situations of excessive demand or

supply. On the other hand, if α is too low, long periods occur which the market stayed in excess demand

or supply. The second problem is related to the fact that some agents left the market with their orders

unfilled.

• Results and stylized facts

(Arthur, 1996) does not directly deal with the problem of stylized facts presented in section 3.2.

However this model is capable of reproducing two regimes dependent on the parameter that rules the

frequency of activation of the genetic algorithm. In this sense, if this frequency is high enough, the

model reproduces a non rational regime which generates the patterns common to actual financial series.

Otherwise, the agents converge to an homogeneous strategy.

Many of the empirical results of the SFI model are discussed in (LeBaron et al., 1999). The authors

show that, similar to other agent-based markets, this model can reproduce some of the main stylized facts

such as excess kurtosis and little linear autocorrelation in asset returns. In addition, trading volume is

also correlated with price volatility.

4.3.2 Lux and Marchesi Model

• Objectives

The main goal of Lux and Marchesi model (see Lux and Marchesi (1999, 2000)) is to simulate a

time continuous multi-agent model of speculative activity. This model shows through statistical analyses

of simulated data that the stylized facts observed in financial markets emerge from the interactions of

market participants (chartists and fundamentalists).

• Analytical tractability/realism

The structure of Lux and Marchesi model includes various approaches to the realism of the financial

markets. We stand out the effects of the herding mechanism, the price determination as a consequence of

the disequilibrium between demand and supply and changes between periods of stability and instability

caused by the time variation of the market fraction. However, the authors have developed an hard

analytically tractable dynamics that include 13 parameters. In this sense, we can conclude that the

design of the model satisfies the financial realism but rather reduces its analytical operability.

• Market structure, heterogeneity and learning

In this model, the market is divided into two groups of financial agents: fundamentalists and chartists.

The first group of traders expect that the price P follows the constant fundamental value of the asset Pf .

In this sense, their trading strategy consists of buying (selling) when the actual market price is believed

42

Page 59: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

to be below (above) the fundamental value. The behaviour of the second group is oriented by herding

and historical prices. In fact, they do not believe in a tendency of the price to revert to its fundamental

value. Otherwise, these agents focus their attention to price trends and patterns, considering also the

behaviour of other traders. Furthermore, the chartists are also divided into two groups that depend of

the market’s development in the future: optimists, who believe that the price will rise and hence always

buy stocks, and pessimists, who believe that the price will decrease and sell stocks. The total number of

agents N is fixed but the market fraction varies. So, the number of chartists will be denoted nc and the

number of fundamentalists is nf with nc + nf = N . In addition, the number of optimists and pessimists

is denoted by n+ and n−, respectively, with n+ + n− = nc.

The main structure of the model corresponds to the movement of agents from one group to another.

This traders’ switching between strategies will be a key element of the dynamics, which incorporates

the chartists switching between optimistic and pessimistic opinion and the switching between chartist

and fundamentalist strategy. In fact, each agent can change her strategy according to a given transition

probability.

The probability of a optimist switch to the pessimistic group (π+−) and vice versa (π−+) is given by

π+− = ν1

(ncNeU1

)(4.14)

π−+ = ν1

(ncNe−U1

), (4.15)

where ν1 is a parameter for the frequency of revaluation of opinion and

U1 = α1x+ α2P

ν1. (4.16)

Here, x corresponds to an opinion index which is defined as (n+ − n−)/nc. The parameters α1 and α2

measure the fraction of the importance the individuals place on the majority opinion and actual price

trend in expectations about future price changes in continuous time P .

On the other hand, the transition probabilities that reflects the switching between chartist and fun-

damentalist strategy are formalised as follows:

π+f = ν2

(n+NeU2,1

)(4.17)

πf+ = ν2

(nfNe−U2,1

)(4.18)

π−f = ν2

(n−NeU2,2

)(4.19)

πf− = ν2

(nfNe−U2,2

), (4.20)

where ν2 is again a parameter for the frequency of this type of transition and

43

Page 60: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

U2,1 = α3

(r + P

ν2

P−R− s

∣∣∣∣Pf − PP

∣∣∣∣)

(4.21)

U2,2 = α3

(R−

r + Pν2

P− s

∣∣∣∣Pf − PP

∣∣∣∣). (4.22)

In this transition, α3 measures the pressure exerted by profit differentials or the inertia of the reaction

to profit differentials. By analysing the equations 4.21 and 4.22, we can verify that for optimists, who

want to extend the fraction of the asset, the excess profits per unit are given by (r + P )/P − R, where

the parameters r and R correspond to nominal dividends of the asset and to average real returns from

other investments, respectively. Otherwise, the advantage of the pessimistic group consists in avoiding

losses by invest in other investment opportunities and is given by R− (r+ P )/P . The excess profits per

unit of the asset of the fundamentalists can be written as s∣∣∣Pf−P

P

∣∣∣, where s is a discount factor. In fact,

these behavioural changes are modelled through the profits of each strategy.

To sum up, the presence of the herding factor in the transition probabilities introduces an intermittent

dynamics between the populations, which is directly connected to the emergence of the stylized facts.

• Price formation

In terms of price determination, at each time step the auctioneer is assumed to adjust the price to

the next higher (lower) possible value (one cent) according to a probability given by

π↑ = max[0, β(ED + µ)] (4.23)

π↓ = −min[0, β(ED + µ)], (4.24)

where β is a parameter for the reaction speed of the auctioneer and µ is a white noise that represents

the random traders. The price formation process depends of disequilibrium between demand and sup-

ply (excess demand ED) which, in turn, is calculated adding the excess demand of chartists EDc and

fundamentalists EDf . These two variables are formalised as follows:

EDc = (n+ − n−)tc (4.25)

EDf = nfγ(Pf − P ), (4.26)

where tc is the number of asset units bought and sold by chartists and γ is the reaction strength of

fundamentalists.

• Results and stylized facts

In terms of stylized facts, the statistical investigation of the simulated financial temporal series of

this artificial market allows to verify the emergence of fat tails and volatility clustering and the absence

44

Page 61: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

of autocorrelation in returns. In fact, this work attributes volatility clustering and the emergence of

fat-tailed returns mainly to the agents’ switching between fundamentalist and chartist strategies.

The herding mechanism introduced in the model contributes to the changes of agents between groups

which, in turn, allows the system to switch between stable and unstable periods. In particular, during

periods of high volatility is possible to observe a predominance of chartists. At this point, there is a

critical value of the fraction of the chartists, where the system loses its stability. During this period one

finds an alternation between optimists and pessimists. Consequently, many buy and sell orders arrive

in the market and the price increases and decreases accordingly. However, this temporal destabilization

period is followed by a deviation between the asset price and its fundamental value. This deviation is

seen by fundamentalists as a good opportunity to invest and therefore stabilize the system.

Moreover, despite a large number of parameters, the Lux and Marchesi model can replicate this

intermittent behaviour observed in real financial markets and, thus, provide a robust qualitative analysis.

4.3.3 Adaptive Belief Systems Model

• Objectives

Like other models that adopt the ABS framework proposed by (Brock and Hommes, 1997) and (Brock

and Hommes, 1998) to model economic and financial markets, this model of Hommes (Hommes, 2002)

aims to study the stylized facts resulting from this type of evolutionary system.

• Analytical tractability/realism

In contrast to the computationally oriented heterogeneous agent literature, the ABS structure at-

tempts to present the solution to the disadvantage of computer simulations and opens the possibility to

approximate complicated computational models by simple non-linear dynamical systems. This analysis

allows for a better analytical insight about what exactly causes an observed simulation output.

In fact, dynamical systems exhibit some important phenomena (chaos, strange attractors, steady

states, limit cycles and intermittency), which may have an important role in explaining and generating

some of the stylized facts.

• Market structure, heterogeneity and learning

In terms of market structure, demand specification and learning process, this model presents some

mechanisms already presented throughout the work in section 4.3.

In this model, there are two types of traders (fundamentalists and chartists) and their forecasting

strategies are given by the equations 4.2 and 4.3. The explanation of the parameters is described above.

Regarding demand specification dh,t, the market structure was designed according to a perspective

similar to the SFI artificial stock market. In this sense, the demand for risky assets by trader type is

given by equation 4.10.

On the other hand, the evolutionary part of this model describes how beliefs are updated over time or

how the market fractions of trader types nh,t evolve. The probability that an agent chooses each strategy

is given by the discrete choice model described above by the equation 4.8. Looking at the equation,

45

Page 62: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

we can take some conclusions. First, the denominator is a normalization factor in order for the market

fractions of trader types to add up to 1. Other feature of the model is that the higher the performance

Uh,t of each strategy, more agents will select it. Finally, the intensity of choice parameter λ measures the

degree of rationality of each investor and, thus, an increase represents that more investors will choose the

optimal forecast.

In fact, the population adapt their beliefs according to some measure of performance Uh,t, which may

be related to profits or accumulated wealth. For example, in this model Hommes chooses a evolutionary

fitness measure that depends of accumulated realized profits and introduces a memory parameter η

(0 ≤ η ≤ 1). This parameter measures the memory strength of the agents and the weight assigned to

the oldest performance. There is also another model (Anufriev and Hommes, 2012) that incorporates an

additional parameter of inertia, reflecting the fact that not all the participants are willing to update their

rule in every negotiation day.

• Price formation

The price formation process depends of the market fractions of each trader type h, which is directly

related with other variables such as the fitness measure. The asset price will be determined by the market

fraction via the market maker equation, whose decision is determined by the excess demand normalized

by the total number of investors

Pt+1 = Pt + αEDt = Pt + α(EDf + EDc) = Pt + α(nf,tdf,t + nc,tdc,t), (4.27)

where α is the speed of adjustment and EDt is a weighted average of the individual demand of each type

of traders (fundamentalists f and chartists c).

• Results and stylized facts

These evolutionary ABS models can explain the main stylized facts such as absence of autocorrelation

in returns, fat tails and volatility clustering of real financial series. In addition, asset prices are very

unpredictable and highly sensitive to noise.

In fact, this analytical analysis and its empirical and experimental testing may help to understand

whether asset prices are driven only by news about economic fundamentals, or whether the observable

behaviour of agents also has its share of importance.

4.4 ABMs for Crude Oil Financial Markets

In the field of using ABMs in crude oil markets the works of (Reitz and Slopek, 2009), (Ellen and

Zwinkels, 2010) and (Vansteenkiste, 2011), stand out. These models are mainly analytical and just aim

to use the estimation theory in order to estimate the values of parameters based on measured/empirical

financial data.

In the first work, the authors develop and investigate a simple oil market model based on a smooth

transition autoregressive model, composed by technical and fundamental agents. The first agents form

46

Page 63: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

predictions by extrapolating historical price trends and destabilize the market. On the other hand,

fundamental analysis is based on the assumption that prices converge towards their long-run equilibrium

value. The results suggest that heterogeneous agents may be responsible for oil price persistent changes.

In particular, the second work by Ter Ellen and Zwinkels presents a simple model for the oil market,

which combines both real and speculative market participants. Despite being an estimation model, the

model introduces several features of agent-based modelling discussed before: interaction between chartists

and fundamentalists; the evolutionary dynamics introduced by (Brock and Hommes, 1997) and (Brock

and Hommes, 1998) in which performance is evaluated by the squared forecasting error in the previous

months of each strategy; and the price changes are a function of excess demand with a positive price

adjustment parameter and a random noise term. The authors conclude that the fundamentalists react

to market considering the difference between the actual price and the future price of oil, whereas the

“chartists” essentially react to price changing without taking into account the fundamental factors.

Finally, Isabel Vansteenkiste analyse the relative importance of fundamental and speculative demand

on oil future prices and volatility from the development of an heterogeneous agent model of the oil futures

market. By distinguishing between commercial traders and non-commercial traders, Isabel Vansteenkiste

find two possible explanations to market conditions of entry: high fundamental volatility and high un-

certainty about future demand induce market entry of commercial traders; on the other hand, if occurs

a large unexpected shock to the oil spot price then all agents enter the market.

47

Page 64: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

48

Page 65: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

5ABM for the crude oil futuresmarket

In this chapter, we will present the simple and heterogeneous ABM that will be used to evaluate the

effect of heterogeneous expectations on crude oil prices. In this sense, we focus our attention on the

explanation of all the features of our model from the macroeconomic environment to the structure of the

market, through the characterization of the individual behaviour of financial agents and their strategies.

In the second part, we firstly define the ABM parameters and discuss their influence on the stability of

the system. Then, we will present all details about the simulation results, including the price dynamics

and the emergence of stylized facts. Finally, we will make a comparison between our ABM and the other

ones reviewed in chapter 4.

5.1 Description and Specification

The computational model, developed in C++ programming language with object oriented technology,

is designed to be as simple as possible but still able to reproduce the stylized facts of crude oil prices.

This model seeks to follow the main lines of the ABMs presented and discussed above. In this sense,

our ABM is in line with the original idea of the SFI artificial stock market, with the realism of Lux

and Marchesi introduced by the interaction between chartists and fundamentalists, as well as with the

evolutionary dynamics of Brock and Hommes to describe endogenous selection of expectations. However,

this model is directed essentially to the buying and selling of crude oil futures contracts, evaluating the

importance of speculation on crude oil price formation.

Looking at the model from a simple perspective (see figure 5.1), each agent has a set of strategies

resulting from technical or fundamental analysis, each of which converts some economic information

into a “buy/sell/inactive” decision. The strategy chosen at time t by a given agent is the one, which

would have the best performances in a recent past. Finally, each agent decides the number of investment

49

Page 66: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

positions and submits orders to buy or sell futures contracts. After all orders are summed and requests

are satisfied, the crude oil price P (t) increases (decreases) whether there is an excess of demand (supply).

The dynamics of the model, between t and t+ δt (δt = 1), is defined in the next subsections.

Strategies   Economic    Informa1on  

Agents   Market  

#  Investment    Posi-ons  

Signal  (1,  -­‐1  ,  0)  

GDP  

Crude  Oil  Price  

Figure 5.1: Functional diagram of our ABM.

5.1.1 Economic Information

The ABM is initialized by a sequence of initial economic time series, whose length τ is long enough

to allow any forecasting strategy which converts some economic information into a decision si(t). Fur-

thermore, the performance measures Uh(t− 1, .., t−m) of each strategy are only updated for t > τ +m.

Until this period, the association between an agent and a strategy is completely random.

We assume that the simulated crude oil price time series P (t) is initialized by an autoregressive process

of order 2 AR(2) given by

P (t) =

P0, if t = 0

A1P0 + ε(t), if t = 1

A1P (t− 1) +A2P (t− 2) + ε(t), if t > 1,

(5.1)

where P0 is the initial value, A1 and A2 are the autoregressive parameters and ε(t) ≈ N(0, 1) is a noise

term given by the standard normal distribution. The GDP series is generated through a correlation cOIL

with the crude oil price

GDP(t) =

GDP0, if t = 0

GDP0 + ε(t), if t = 1

GDP(t− 1) + cOIL(P (t− 1)− P (t− 2)) + ε(t), if t > 1.

(5.2)

The choice of GDP as dependent variable is based on (Hamilton, 2005). In fact, the author finds that

nine out of ten of the United States recessions since World War II were preceded by a substantial increase

in oil prices. This empirical evidence confirms that oil price movements affects the real economy.

50

Page 67: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Note that these parameters are chosen in order to generate a fictitious evolution of GDP and crude

oil price. The fundamental series of GDP only serve as an external source that supports the decisions

of fundamentalists. Since it is not possible to obtain the daily periodicity of GDP, we seek to generate

certain time-varying processes to ensure the functioning of the fundamental GDP strategy.

5.1.2 Strategies

We assume throughout this model that there are only four types of traders: fundamentalists, chartists,

contrarian chartists and noise traders, who in fact are the most widespread types of traders used in

ABMs. We distinguish between two types of trading rules: rules inserted under the technical analysis or

under the fundamental analysis. The technical analysis only focuses on statistical analysis of price series

while fundamental analysis is essentially based on understanding how economic variables can affect and

change asset prices. Therefore, beyond the chartists and the fundamentalists, directly associated with

each of these philosophies, there is also the participation of contrarian chartists and noise traders. The

contrarian chartists or simply contrarians use technical analysis tools, considering that the price trend

starts to reverse. On the other hand, the noise traders are added to the system in order to represent the

irrational investor, who randomly selects one strategy.

First, the technical analysis is based on three fundamental premises: all factors that eventually affect

prices, are already reflected in them; the future perception requires the study of past; the market trends

tend to persist. More specifically, it studies the action of markets from financial historical data series in

order to identify patterns and trends, and conclude about the future price of a particular asset (Murphy,

1999).

There are several techniques that can be used for technical analysis. In our model there are two

indicators based on moving averages to predict the crude oil prices. The first indicator is a moving

average crossover and provides a buy (sell) signal when the moving average for a shorter period ST is

higher (lower) than the moving average for a longer period LT ,

sMAST,LTt

=

1, if

1ST

∑ST−1i=0 P (t−i)− 1

LT

∑LT−1i=0 P (t−i)

P (t) > φ

0, if∣∣∣ 1

ST

∑ST−1i=0 P (t−i)− 1

LT

∑LT−1i=0 P (t−i)

P (t)

∣∣∣ ≤ φ−1, if

1ST

∑ST−1i=0 P (t−i)− 1

LT

∑LT−1i=0 P (t−i)

P (t) < −φ.

(5.3)

The second indicator is a mean-reverting moving average that checks whether the current oil price

moves away from its long term average. In other words, the buy (sell) signal is activated when the oil

price is below (above) a moving average for a long period LT ,

sMRLTt

=

1, if

1LT

∑LT−1i=0 P (t−i)−P (t)

P (t) > φ

0, if∣∣∣ 1

LT

∑LT−1i=0 P (t−i)−P (t)

P (t)

∣∣∣ ≤ φ−1, if

1LT

∑LT−1i=0 P (t−i)−P (t)

P (t) < −φ.

(5.4)

Additionally, we also include the exponential weighted “versions” of these two techniques, which

basically represent the investors who underweight long term averages, and tend to attach too much

weight to recent experiences.

51

Page 68: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

In contrast, the fundamental analysis is based on the study of other available data series that might

influence the price of financial assets. The construction of these trading rules is based on a two step

procedure:

1. each trading rule provides a forecast of the fundamental variable for a given time window LTf

through an autoregressive process AR(2) based on historical data;

2. each rule returns a signal to buy or sell futures contracts, comparing the prediction obtained Y (t)

in the first step with the current value X(t).

In the model, the output signal is associated with the analysis of the factors that influence the evolution

of oil prices. For example, the trading rules based on GDP, will provide a signal to buy (sell) when the

predicted value for the key variable is below (above) the current value, since a co-movement is observed

between GDP and crude oil prices,

sGDP

LTft

=

1, if Y (t)LTf−X(t)

X(t) > φ

0, if∣∣∣Y (t)LTf−X(t)

X(t)

∣∣∣ ≤ φ−1, if Y (t)LTf−X(t)

X(t) < −φ.

(5.5)

Finally, it should also be noted that it is possible to instantiate additional trading rules changing only

two parameters: the temporal dimension of the window and the maximum deviation φ from which rules

are activated. An example of the trading rules used in the model is presented in figure 5.2.

0 200 400 600 800 1000

150

160

170

180

190

200

Time (days)

Oil

Pric

e $/

bbl

Oil PriceMA(60)MA(120)

0 200 400 600 800 1000

5060

7080

9010

012

0

Time (days)

Oil

Pric

e $/

bbl

Oil PriceMR(20)

0 200 400 600 800 1000

120

130

140

150

160

170

Time (days)

GD

P

GDPGDP FORE(120)

Figure 5.2: Example of the evolution of crude oil prices and application of technical trading rules moving averagecrossover (left), mean reverting moving average (right) and fundamental GDP forecasting rule (bottom).

52

Page 69: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

According to the strategies previously discussed, agents are randomly distributed to the ten groups

(H = 10) of traders described in table 5.1. We highlight the fact that our model provides a different market

structure compared to most models presented in the literature review. While these ABMs essentially

have a division between chartists and fundamentalists, our model divides these two groups of market

participants according to their specific trading rules.

Table 5.1: Agents’ investment strategies.

Type of Agent Strategy

Chartist

Moving Average CrossoverExponentially Weighted Moving Average Crossover

Mean RevertingExponentially Weighted Mean Reverting

Contrarian

Moving Average CrossoverExponentially Weighted Moving Average Crossover

Mean RevertingExponentially Weighted Mean Reverting

Fundamentalist GDP ForecastNoise Trader Random

After evaluating the performance of each strategy, each agent randomly selects one or more time

periods of the strategy previously chosen. Consequently, this choice is converted into a trading signal

si(t), reflecting a buy (1), sell (-1) or refrain (0) decision. In particular, if the selected number of time

periods R exceeds one, the trading signal si(t) will reflect the most frequent result. For example, if an

agent chooses R = 2 periods (sGDP20 = 1, sGDP40 = 1) of a fundamental GDP strategy, one will take

a buy (1) decision.

5.1.3 Agents

In terms of wealth, each agent i, at each time step, starts with an initial portfolio defined by a

distribution that follows a Pareto law with exponent κ,

Wi(t) = W0U [0, 1]−1/κ κ > 0, (5.6)

where W0 is a constant measured in MU and κ is an appropriate positive constant (see Pareto and

Politique (1897), Saucier (2000)). U represents the continuous uniform distribution with a finite interval

[0, 1].

In the model, we consider the market activity and the trading volume as the consequence of the fact

that an agent can reduce his investment due to risk aversion and crude oil price volatility σ(t) calculated

by the exponentially weighted moving average of the standard deviation from the crude oil price, similar

to the approach introduced by JPMorgan’s RiskMetrics(Longerstaey and Spencer, 1996)

σ(t) =

{√θ(t)2, if t = 1√wσ2(t− 1) + (1− w)θ(t)2, if t > 1,

(5.7)

where w is the smoothing constant and θ(t) corresponds to the absolute crude oil price change between

t and t− 1.

53

Page 70: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Volatility is a measure that evaluates the price variations of a financial series over time. In this sense,

from the investor’s point of view, is a variable that reflects the uncertainty of their investments and agents

will be discouraged from investing in periods of low fluctuations. In terms of demand specification, each

agent attempts at each period to optimize his allocation according to a constant relative risk aversion

(CRRA) preference, since increases linearly with agents’ wealth (Anufriev and Dindo, 2010). In this

assumption of investment allocation, agents affect market price proportionally to their relative wealth.

In this sense, we assume that investors make investment decisions based on the level of their personal

wealth,

F+/−i (t) =

{WisiSFλiσ

, if λiσ > 1WisiSF

, if λiσ ≤ 1,(5.8)

where the number of buy (sell) positions in futures contracts F+i (t) (F−i (t)) of agent i depends on

the agent’s risk aversion λi obtained through a continuous uniform distribution with a finite interval

[λmin, λmax]. The size of each standardized contract SF , measured in MU, is fixed. In this context, it

is important to note that the agent’s risk aversion and the price volatility define the proportion of the

agent’s wealth invested in crude oil futures contracts 1/λiσ.

Note that a futures contract is only traded if there is always someone on each side. In fact, the effective

total long interest Fi+

(t) (buy side) in futures contracts must equal the effective total short interest

Fi−

(t)(sell side). This is possible through the mechanism of the SFI artificial stock market, where the

smaller positions of these two sets of buyers and sellers is satisfied while the other is partitioned according

to

Fi+/−

(t) =

{F+i (t) S(t)D(t) , if D(t) > S(t)

F−i (t)D(t)S(t) , if D(t) < S(t),

(5.9)

in which demand D(t) =∑Ni=1 F

+i (t) and supply S(t) =

∑Ni=1 F

−i (t).

In our model, the evolutionary selection between different strategies is built upon the adaptive belief

system of Brock and Hommes Brock and Hommes (1998), but with memory in the performance measure

and asynchronous strategy updating. In this sense, each agent makes a decision taking into account its

behavioural features, as well as previous performances of each trading strategy. The chosen metric to

evaluate the performance of each strategy is the number of successes in each negotiation session. In fact,

studies about the profiles and motivations of habitual speculators in commodity futures markets and

survey responses indicate that the investors “ ... are not trading solely or even primarily for profit, but

may be maximizing excitement or the number of winning trades” (Canoles et al., 1998). As such, the

performance measure of a strategy in a given period is based on the fraction of agents who did not lose

money and is given by

Uh,i(t) = (1− ηi)Successesh(t− 1)

Nh(t− 1)+ ηi

Successesh(t− 2)

Nh(t− 2), (5.10)

where the parameter Nh is the number of agents associated with each strategy. Successesh is the number

of agents who did not lose money in each strategy and 0 ≤ ηi ≤ 1 represents the memory, measuring

54

Page 71: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

the relative weight agents give to past successes of each strategy. In the particular case ηi = 0, the

performance of each strategy is completely determined by the most recent number of successes.

Given the performance measure, the probability of each agent following a particular trading strategy

takes the form

Probh,i(t) = (1− γi)eβUh,i(t)∑Hh=1 e

βUh,i(t)+ γi

eβUh,i(t−1)∑Hh=1 e

βUh,i(t−1), (5.11)

where 0 ≤ γi ≤ 1 represents the inertia, reflecting the fact that not all the agents update the strategy

performance in every negotiation session. Indeed, the higher the parameter intensity of choice β, the faster

individuals will switch to more successful strategies. Note that the behavioural parameters memory ηi

and inertia γi are obtained through a continuous uniform distribution with a finite interval [ηmin, ηmax]

and [γmin, γmax].

5.1.4 Market Structure

Our model environment includes a financial market where agents work on “mark-to-market basis”

and use their trading rules to buy or sell futures oil contracts at an announced price. For simplicity, we

assume that the maturity of contracts has a single term (one day).

The feedback between prices and agents’ interactions is performed by a Walrasian mechanism of price

update, which is popular in several presented ABMs. In fact, at each time step, the crude oil price

changes are a function of excess demand/supply - the difference in the number of buy and sell trades

each negotiation day

P (t+ 1) = P (t) + αD(t)− S(t)

D(t) + S(t), (5.12)

where α is a a positive daily price adjustment parameter. The excess demand/supply moves the price

up or down, where the largest return occurs when all traders act in unison, i.e., they all either buy or

sell their stocks. P (t + 1) is the main output of our ABM. In fact, this value updates the price time

series, as well as the computation of market volatility. Finally, we have all the ingredients to compute

the profit/losses of each agent

∆Wi = [P (t+ 1)− P (t)]SF F+/−i (t). (5.13)

5.2 Simulation Test

The above section presents a basic framework of the model. In this section we will firstly define the

ABM parameters and present all details about the simulations results.

Due to the large number of parameters (listed in table 5.2) and stochastic processes of our model, the

choice of parameter values take into consideration the presence of various empirical observations which

contribute to the validation of the ABM, namely the presence of the stylized facts, addressed in chapter

3.

55

Page 72: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Table 5.2: List of model parameters.

Description Symbols

Initialization period of macroeconomic time series τMemory length of performance measure m

Autoregressive parameters (P0, A1, A2)GDP - oil correlation parameters (GDP0, cOIL)

Number of strategies HInitial number of agents N(0)

Daily price adjustment parameter αConstant factor of initial cash W0

Pareto law exponent κVolatility smothing constant w

Intensity of choice βRisk aversion U [λmin, λmax]

Memory U [ηmin, ηmax]Inertia U [γmin, γmax]

Time horizons of trading rules (ST,LT ); (LT ); (LTf )Contract size SF

Selected number of time periods RTrading rules threshold φ

Unfortunately, we lack empirical estimates for all behavioural parameters that we introduce in the

evolutionary dynamics (e.g. memory, inertia, intensity of choice, risk aversion), as well as other market

parameters (e.g. price adjustment parameter). In fact, in order to choose appropriate sets of parameter

values, the ideal option would be calibrate the model using relevant empirical estimations. The idea

of estimation is to derive the global equation with all these parameters. Then, by applying statistical

techniques to this equation, we can derive the estimates of these parameters. Nevertheless, for computa-

tionally oriented ABMs as our model, it may not be easy to derive the global equation in an analytical

perspective so that the direct application of statistical techniques is not possible. In this sense, according

to the (Chen et al., 2012) approach, ABMs in general are hard to estimate due to the lack of tractable

criterion functions.1

However, most of the statistical results reported in our analysis of the stylized facts, remain unchanged

for a range of parameter values. Thus, we are restricted to a very limited degree of fine-tuning parameters.

In this sense, throughout the analysis we will tune the parameters to obtain the stylized facts for a

preassigned value of initial number of agents N(0).

5.2.1 Simulation Settings

Under initial conditions and parameters listed in table 5.3, the intensity of choice β, the daily price

adjustment parameter α and the initial number of agents N(0) have considerable importance to obtain a

good representation of financial market dynamics. In this sense, the first step is to fix these parameters

1This fact has been shared by many other economic or econometric models, including non-linear dynamic ones, whichhave been estimated by some methods such as the method of simulated moments, simulated maximum likelihood, methodsof simulated scores, efficient method of moments, and indirect inference. The development of these methods may open anew door to the future of ABMs.

56

Page 73: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Table 5.3: Summary of the parameter set.

Symbols Parameter Set

τ 240m 3

(P0, A1, A2) (90 $/bbl , 0.03490, 0.00868)(GDP0, cOIL) (90 T$, -0.04 T$/$/bbl)

H 10N(0) 100α 8.5 $/bblW0 10000 MUκ 2w 0.94β 0.2

U [λmin, λmax] U[1, 10]U [ηmin, ηmax] U[0, 1]U [γmin, γmax] U[0, 1]

(ST,LT ) {(1, 240); (2, 120); (4, 9); (5, 20); (10, 20); (20, 40); (9, 18)}(LT ) {5, 10, 20, 40, 60, 120, 240}(LTf ) {5, 10, 20, 40, 60, 120, 240}SF 1000 MUR 7φ 0

in order to control the stability of the system as well as the emergence of the stylized facts.

First of all, the intermittent behaviour that characterizes the oscillations of agents’ strategies is crucial.

In fact, through the intensity of choice parameter, it is necessary to find the “right level” of intermittency

between the market fractions of each strategy with the purpose of preventing strategy homogeneity, which

therefore creates an uniform tendency to rise or fall in crude oil prices. In addition, the heterogeneity

of strategy output signals (buy/sell) is also controlled by the parameter R. Throughout the simulations,

we consider that the selected number of time periods in each trading rule is fixed to R = 7. This choice

ensures the credibility of the signal of each trading rule, since it is assessed taking into account the

individual signals of all possible periods.

As we can see in the simulations of the figures 5.3 and 5.4, the fraction of each type of strategy is

very important in market dynamics. The choice of β in each simulation is intended to accentuate the

dominance of each strategy. According to the dynamics given by the interaction of two types of investors,

the moving average crossover strategy has a destabilizing effect on the price of oil, since it extracts price

movements from the past and predicts that they continue moving in the same direction. In particular,

the moving averages are a source of market instability and can lead to the tendency for the market price

to take long excursions away (Chiarella et al., 2006). On the other hand, the mean reverting strategy has

a stabilizing effect on the price of oil. In fact, mean reverting chartists predict that the oil price converges

on its long term average. Considering this simplest market configuration, we can fix β in such a way that

even a single heterogeneity can lead to an interesting dynamics.

57

Page 74: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

0 200 400 600 800 1000

5010

015

020

025

0

Time (days)

$/b

bl

0 200 400 600 800 1000

0.3

0.4

0.5

0.6

0.7

0.8

Time (days)

Rat

io

Figure 5.3: Simple simulation of 100 market participants with only two available strategies (H = 2) duringa period of 1000 trading days: moving average crossover chartists (black) vs mean reverting chartists (blue).β = 0.4.

0 200 400 600 800 1000

020

040

060

080

012

00

Time (days)

$/b

bl

0 200 400 600 800 1000

0.2

0.4

0.6

0.8

1.0

Time (days)

Rat

io

Figure 5.4: Simple simulation of 100 market participants with only two available strategies (H = 2) during aperiod of 1000 trading days: moving average crossover chartists (black) vs GDP fundamentalists (blue). β = 6.

On the other hand, the daily price adjustment parameter α amplifies or diminishes the price fluctua-

tions and, more importantly, ensures that the bandwidth for returns over unit time steps should roughly

conform to what one usually observes with data from crude oil financial market.

Finally, there is a decrease in volatility with the increasing initial number of agents N . While a

low value of N produces many fluctuations, an higher value of N will prevent the formation of market

bubbles and crashes. In this sense, it is important to obtain a range of volatility values that represents

the different market behaviours, including calm periods as well as a greater price fluctuation frequency.

In sum, it is necessary to find a combination between these parameters, allowing the emergence of

stylized facts of financial markets.

5.2.2 Simulation Results

Here we present the detailed analysis of the market activity dynamics according to the parameters

listed in table 5.3. We simulate a market with an initial population of 100 agents divided by 10 strategies

for 5000 trading days, which corresponds roughly to 20 years of market activity.

58

Page 75: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

0 1000 2000 3000 4000 5000

5010

015

020

0

Time (days)

$/bb

l

0 1000 2000 3000 4000 5000

−15

−10

−5

05

Time (days)

Log

Ret

urns

(%

)

Figure 5.5: Simulated crude oil price path (left) and logarithmic returns (right).

Figure 5.5 shows the price path and the logarithmic returns from a typical simulation (see equation

3.5). The model simulation presents long calm periods interrupted by sudden bursts of clustered volatility.

Moreover, we can evidence the existence of financial bubbles and crashes in simulated crude oil price series.

0 1000 2000 3000 4000 5000

5060

7080

9010

0

Time (days)

Age

nts

0 1000 2000 3000 4000 5000

1.5

2.0

2.5

Time (days)

Vol

atili

ty

0 1000 2000 3000 4000 5000

7080

9010

011

012

013

0

Time (days)

GD

P

●●

●●

●●●

●●

●●

● ●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●●●

●●

●●

●●

● ●

●●●

●●

●●

●●

●●

● ●

●●

●●

●●●

●●

● ●

●●

● ●

●●

●●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●●●

●●

● ●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●●

●●

●●●●

●●

●●

● ●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●● ●

●●

●●

●●

●●

●● ●

● ●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

● ●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●●

●●

●●

●●

●●

● ●

●●

●●

●●

● ●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●● ●

●●

●●

● ●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

● ●

●●

●●

●●●

●●

● ●

●●

●●●

●●●

●●

● ●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●● ●

●●

●●

●●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●●●

●●

●●

●●

● ● ●

●●●

●●

●●

●●

●●●

●●

●●

● ●

●●

●●

● ●

●●

●●

● ●

●●

●●

●●

●●

●●●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●● ●

●●

●●

●●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●●

●●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

● ●

●●

● ●

●●

● ●●

●●

●●

●●

●●

●●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●●

●●●

●●

● ●●

●●

●●●

●●

● ●

●● ●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●●

●●

●●

●● ●

● ●●

●●

●●

●●

●●

●●

●●●

● ●●

●●

●●

●●

● ●●

●●

●●

●●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●● ●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●● ●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●●

● ●

●●

●●

●●

● ●

●●●

●●

●●

● ●

●●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

● ●●

●●

●●

●●●

●● ●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●●

● ●

●●●

●●

●●

●●

●●●

●●

●●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●●

●●

●●

●●

●●

●● ●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●● ●

●●●

● ●

●●

●●

● ●

● ●

●●

●●

●● ●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●● ●

●●

●●

●●

●●

●●

●●

●●●

●●

●●●

●●

● ●

●●

●●

●●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●●

●●

●●●

● ●

●●

●●●

●●

●●

●●

●●

●●

●●●

●●

●●

● ●

●● ●

●●

● ●

●●●

●●

●●

●●●

●●

●●

●●

●●●

●●●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

● ●●

●●

●●

●●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

1.5 2.0 2.5

5060

7080

9010

0

Volatility

Num

ber

of A

gent

s

Figure 5.6: Simulated market indicators: market activity (top left); daily volatility (top right); GDP time series(bottom left); market activity vs daily volatility (bottom right).

Figure 5.6 presents in more detail the internal dynamics involved in a trading period of 5000 trading

days. Considering the evolution of market indicators throughout the simulation, we first check the

fluctuations of market activity. Note that the fluctuation frequency of market activity increases with an

higher volatility range of values. In this case, the combination between risk aversion and high market

59

Page 76: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

volatility induces neutral investment positions (see equation 5.8). This fact influences the amount of

traded contracts. The greatest value of volatility induces an higher percentage of agents who do not take

any investment position, reflected in refrain fraction. In terms of economic fundamental series, GDP

reflects the relation with crude oil price imposed in our model (see equation 5.2). The fraction of each

type of financial agents is represented in figure 5.7.

0 1000 2000 3000 4000 5000

0.10

0.15

0.20

0.25

0.30

0.35

Moving Average Crossover Chartists Fraction

Time (days)

0 1000 2000 3000 4000 5000

0.05

0.10

0.15

0.20

0.25

0.30

0.35

Mean Reverting Chartists Fraction

Time (days)

0 1000 2000 3000 4000 5000

0.10

0.15

0.20

0.25

0.30

0.35

Moving Average Crossover Contrarians Fraction

Time (days)

0 1000 2000 3000 4000 5000

0.10

0.15

0.20

0.25

0.30

0.35

Mean Reverting Contrarians Fraction

Time (days)

0 1000 2000 3000 4000 5000

0.05

0.10

0.15

0.20

GDP Fundamentalists Fraction

Time (days)

0 1000 2000 3000 4000 5000

0.05

0.10

0.15

0.20

Noise Traders Fraction

Time (days)

Figure 5.7: Market fraction of each type of market participants.

5.3 Stylized Facts

Now we take a closer look at the statistical characteristics of the simulated data set according to

the analysis of section 3.2. In particular, we investigate whether or how far the data from our artificial

crude oil financial market conform to the stylized facts of crude oil real-life market and to the various

financial daily time series. We focus on evaluation of three stylized facts such as heavy-tailed distribution

of returns, absence of autocorrelation in returns and volatility clustering. The empirical data used in this

60

Page 77: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

section consists of daily WTI crude oil spot prices from 10/06/1994 to 02/01/2014 (5000 trading days)

obtained from U.S. Energy Information Administration.

Empirical Log Oil Price Returns

Den

sity

−0.10 −0.05 0.00 0.05 0.10

010

2030

4050

Normal DistributionEmpirical Data

Simulated Log Oil Price Returns

Den

sity

−0.10 −0.05 0.00 0.05 0.10

010

2030

4050

Normal DistributionSimulated Data

Figure 5.8: Probability density function of logarithmic returns for empirical and simulated data. The blue curverepresents a normal distribution with the mean and standard deviation of returns. The red curve represents thekernel density estimator.

●●

●●

●●

●●

●●

●●

● ●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

● ●

●●

●●

●●

●●

●● ●●

●●

●● ●

●●

●●

●●

● ●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●● ●

● ●

●●●●

● ●●

●●

●●●●

●●

● ●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●●

●●

● ●●

●●

●●

● ●

●●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●● ●

●●

●●

●●

●●

●● ●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●● ●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●● ●● ●

●●

●●

●●●

●●●

●●●

●●●

● ●

●●

●● ●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●●

●●

●●

●●

●●●

●●

●●

●●

●●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

● ●

●●

●●

●●

●●

● ●

●●

●●

●●

●●●

● ●

●●

●●

●●

●●

● ●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●● ●●

●●

●●●

●●

●●

●● ●

●●

●●

●●

●●

● ●

●● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●● ●

●●

●●●

● ●

●●●

●●

●●

●●

●●●

●●

●●

●●

● ● ●

●●

●●

● ●

●●

●●

●●

●●●

●●

●●

●●

●● ●

●●●

●●

●●

●●

●●

●●

● ●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

● ●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

● ●●

●●

●●

●●

●●

●●

●●

●●●● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●●

●●

●●

●●

●●●

●●

●●●

● ●

●●●

●●

●●

●●

● ●●

●●

● ●●●

●●

●●

●●

●●

●●

● ●

● ●

●●

●●

●●

●●

●●

●●

● ● ●●

●●

●●

●●

●●●

●● ●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

● ●

●●

●●

●●

●●●

●● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

● ●

● ●

●●

●●

● ●●

●● ●

●●

●●

●●

●●●

●●

●●●

●●

●●

●●

●●

●●

●●

●● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●● ●

●●

● ●

●●

●●

●●

●●

●●

●● ●●

●●

●●

●●

●●

●●

●● ●

●●

●●

●●● ●

●●

● ●●

●●

●●●

●●

●●

●●

●●

●●

●●●

● ●

●●

●●●● ●

●●●

●●

● ●●

●●

● ●●

● ●● ●

● ●●

●●

●●●

●●●

●●

●●

●●●

●●

● ●

●●

●●●

●●

●●

●●

● ● ●●

●●

● ●

● ●

●●

●●

● ● ●

●●

●●

●●

● ●

●●

● ●●●

●●

●●

●●

●●

●●

●●

Normalized Empirical Absolute Returns

Com

plem

enta

ry C

umul

ativ

e D

istr

ibut

ion

Fun

ctio

n

10−

310

−2

10−

110

0

10−3 10−2 10−1 100 101

o Empirical DataNormal(0,1)Power Law Fit

●●

●●●

●●

●●●

● ●

●●●●●

●●●●

●●

●●

●●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●● ●●●●

●●

●●●●

●●

●●

●●

● ●●

●●

● ●● ●

●●

● ●

●● ●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●●

●●

● ●

● ●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●●

● ● ●●

●●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●●

●●●

●●

●●

●●●

●●

●●

●●

●●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

● ●

●●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●●

● ●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●●●

●●

●●

●●

●●

●●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●● ●

●●

● ●

●●

●●

●●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●●●

●●

●●

●●

●●

● ●

●●

●●

●●●

●●●

●●

●●

●●

●●

●●

●●● ●

●●

●●

● ●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

● ●

●●

●●

●●

●●

● ●●

●●

●●

●●

●●

●●●

●●●

● ●●

●●

●●

● ● ●●

●●

●●

●●

●●

● ● ●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●● ●

●●●● ●

●●

●●

●●

●●

●●

●●

● ●●

●●

● ●●

●●

●●●

●●

●●

●●

●●

●●●

●●

●●●

●●

●●

●●

● ●

●●

● ●

●●

●●

●●

●●

●● ●

●●

●●

●●●

●●

●●

●●

●●

● ●

●● ●

●●

●●●

●●●

●● ●

●●

●●

●●

●●

●●

● ●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●●

●●

●●

●●

●●

●●

● ●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●●●

●●

●●

●●●

●●

●●

●●

●●

●●

● ●

●● ●

●●

●●●

●●●

●●●●

●●

● ● ●

●●

●●

●●

●●●

●●

●●●

● ●

●●

● ●

●●

●●●

●●

●●

● ●

●●

●●●

● ● ●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

● ●

●●

● ●

●●

●●

●●

●●●

●●

●●

● ●

●●

●●

●●

● ●●

●●

● ●

●●

●●

●●●

●●

●●

●●

●●●

● ●

●●

●●

● ●

●●

●●

●●

●●

●●●

●●

●●

●●

●● ●

●●

●●

●●

●●

●●

●●

●●●

●●

●●●

●●●

●●

●●

●●

●●

●●

●●

● ●

●●

●●

●●●

●●

●●●

●●

●●

●●●

●●

●●●

●●

●●

●●

● ●

●●

●●

● ●●

●●●

●● ● ●

● ●

●●

●●

●●

●●

●●●

● ●

● ●

●●

●●

● ●●●

●●

●●

●●

●●

●●●

●●●

●●●

●●

●●

● ●

● ●

●●

●●

●●

●●

● ●

●●

●●●

●●

●●

●●

●●●

Normalized Simulated Absolute Returns

Com

plem

enta

ry C

umul

ativ

e D

istr

ibut

ion

Fun

ctio

n

10−

310

−2

10−

110

0

10−3 10−2 10−1 100 101

o Simulation DataNormal(0,1)Power Law Fit

Figure 5.9: Complementary cumulative distribution function (ccdf) of normalized absolute logarithmic returns|R(t)| for empirical (left) and simulated (right) data. Normalized returns are computed as R(t) = (r(t)−M)/SD,where M and SD are the mean and the standard deviation of r(t), respectively. The dots represent an estimate ofthe ccdf of |R(t)| related to the empirical and simulated data. The solid line represents the ccdf from the standardnormal distribution. The dashed line is the power law fit P = A|R|−B with B = 3.25± 0.04 (B = 3.53± 0.03) ofthe tail of the empirical (simulated) ccdf for |R(t)| > 2.

The probability density function of the logarithmic returns for empirical and simulated data is shown

in figure 5.8, which shows excessive kurtosis when compared with a normal distribution. Figure 5.9

shows the complementary cumulative distribution function of normalized absolute logarithmic returns

|R(t)| for empirical and simulated data. For comparison, the solid line represents the complementary

cumulative distribution of the standard normal distribution N(0, 1). For the two results, it is possible

to evidence a clear deviation from Gaussian behaviour with approximate by power law scaling in the

tail of the empirical and simulated situations. A log-log regression that satisfy the condition |R(t)| > 2

gives the slope B = 3.25 ± 0.04 (B = 3.53 ± 0.03) for empirical (simulated) data. Despite the different

values between the empirical and simulated data, the simulated process is able to generate a distribution

of returns with a shape, which is markedly different from the Gaussian case, where the probability for

61

Page 78: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

large positive or negative fluctuations is larger than for a normal distribution. Moreover, the exponent

of the power law fit for the simulated data is in agreement with values found in various financial daily

time series, since these fat tails have been fitted in various ways and can be approximated by a power

law with an exponent ranging from 2 to 5.

In figure 5.10, we present the autocorrelation function of the absolute returns and raw returns at

different time lags. While the autocorrelation function of absolute returns decays as a function of the

time lag, the autocorrelation of raw returns decays immediately to 0. In this sense, the autocorrelation

of price changes is insignificant.

In figure 5.11, the autocorrelation of the absolute value of returns shows the presence of long-range

correlations. However, despite both indicate the presence of volatility clustering, the correlation period

of empirical data is higher than simulated data. In fact, the present model can not fully replicate more

frequently the situations where large changes tend to be followed by large changes and small changes

tend to be followed by small changes. Finally, a power law usually fits the autocorrelation of the absolute

value of returns with exponent ranging from about zero to 1. The value found in the power law fit is

B = 0.54± 0.04 (B = 0.62± 0.02) for the empirical (simulated) data.

0 100 200 300 400 500

−0.

10.

00.

10.

20.

30.

4

Lag (days)

Aut

ocor

rela

tion

Fun

ctio

n

Empirical Raw ReturnsEmpirical Absolute Returns

0 100 200 300 400 500

−0.

10.

00.

10.

20.

30.

4

Lag (days)

Aut

ocor

rela

tion

Fun

ctio

n

Simulated Raw ReturnsSimulated Absolute Returns

Figure 5.10: Behaviour of autocorrelation functions of empirical (left) and simulated (right) raw and absolutelogarithmic returns.

In sum, the simulated price process exhibits the main features of real markets such as fat tails for the

returns distribution, zero autocorrelation for the returns and slow decay of the autocorrelation function

of the absolute values of returns. As such, the oscillations of agents’ strategies, the fluctuations of market

activity as well as the intermittent behaviour between high and low volatility periods are crucial to

generate the main empirical evidences of crude oil financial markets. In fact, we can begin by noting

that while a low number of agents produces too many fluctuations (high volatility), a high number of

agents will prevent the formation of financial bubbles and crashes (low volatility). In this sense, we

refer the importance of market activity fluctuations to the emergence of volatility clustering. Also, the

intermittent behaviour between high and low volatility periods amplifies the fat-tail phenomenon. On

the other hand, the results do not show any significant correlation between returns. This fact can be

explained by the amount of variables that directly or indirectly influences the crude oil price, namely the

oil price volatility σ(t), the initial number of agents N(0), the number of positions in futures contracts

62

Page 79: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

F+/−i (t) and so on. Indeed, these variables are in general not correlated with the price and lead to a

decorrelation of the price increments.

● ●●

●● ●

● ●

● ●

● ●

●●●●

●●

●●

●●●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

Lag (days)

Aut

ocor

rela

tion

Fun

ctio

n

10−

210

−1.

810

−1.

610

−1.

410

−1.

210

−1

10−

0.8

100 100.5 101 101.5 102

o Empirical DataPower Law Fit

●●

●●

●●

● ●●

●●

●● ● ●

●●●

●●

●●

●●●●

●●●●

●●●●

●●●

●●●

●●●

●●●

●●

●●

●●●●

●●

●●●●

●●●●

●●●

●●●

●●●●●

●●●●

●●●

●●

●●

●●●

●●●

●●●

●●●●

●●●●●●●●●

●●●

●●

●●●

●●

●●●

●●●●●●

●●●

●●●

●●●

●●

●●

●●

●●

●●●●●

●●

●●

●●

●●

●●

●●●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●●●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●●

●●●

●●

●●

●●●

●●

●●

●●

●●

●●●

●●

●●

Lag (days)

Aut

ocor

rela

tion

Fun

ctio

n

10−

1.810

−1.

610

−1.

410

−1.

210

−1

10−

0.810

−0.

6

100 100.5 101 101.5 102 102.5

o Simulated DataPower Law Fit

Figure 5.11: Estimate of the autocorrelation function of empirical (left) and simulated (right) absolute logarith-mic returns. The dots represent the autocorrelation of absolute returns |r(t)|. Absolute returns are fitted with apower law decay P = A|R|−B with B = 0.54± 0.04 (B = 0.62± 0.02) for the empirical (simulated) data.

5.4 Summary

After the literature review of ABMs discussed in the previous chapter, we can clearly identify that

there is a trade-off between the realism (heterogeneity) of the model and its analytical tractability. The

figure 5.12 illustrates our qualitative perspective of the previously detailed models. In this figure we can

also fit our model along the two axis of heterogeneity and tractability.

After presenting the model and its results, it is important to clarify the answer to the following

question: Which model is better? The answer to this question is not clear since all the models analysed,

despite having a different structure, can replicate the most important stylized facts of financial markets.

From this simple metric, the most effective model is one that can replicate as many stylized facts as

possible and has the most realistic approach to the functioning of financial markets.

In terms of realism, we recognize that computational models are becoming important and allow to

model and simulate many aspects at the micro level and details of the interaction among agents, including

their heterogeneity. However, the disadvantage of these models is that there are too many degrees of

freedom and too many parameters. This problem is solved by the simplicity of the analytical models

or HAMs, which have a structure farther from reality but allow the explanation of the most important

stylized facts.

In conclusion, given the fragility of each modelling structure, there is the possibility of integrating

both. In this sense, the estimated behavioural parameters of experimental and empirical time series data

of the simplest models can thus help to “discipline” the realistic computational models.

63

Page 80: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Heterogene

ity  

Analy.cal  Tractability  

Ideal  Model  

Adap.ve  Belief  Systems  Model  

SFI  Ar.ficial  Stock  Market  

Our  Model  

Lux  and  Marchesi  Model  

Figure 5.12: Qualitative positioning of our ABM and comparison with other models according to realism andtractability.

64

Page 81: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

6Conclusions and Future Work

Was it possible to model the crude oil futures financial market, according to the observable behaviour

of its agents? In fact, through the application of agent-based modelling, it was possible to design a

model, which simulates the speculative behaviour of heterogeneous agents (fundamentalists, chartists,

contrarians and noise traders), who adapt their beliefs and change their investment strategy (technical

or fundamental) over time.

In this thesis, each chapter had an important contribution to the model development. First, the

comprehensive review about what drives crude oil prices from chapter 2 allowed to position our artificial

crude oil futures market model in the surrounding macroeconomic environment as well as to understand

the main factors that govern the crude oil price evolution. In particular, this chapter helped to identify

GDP as the variable allocated to fundamental strategies. Second, chapter 3 had two different impacts.

On the one hand, the first section allowed to understand the futures market mechanism with the aim

of simulate the interaction of agents with the market according to its rules. On the other hand, the

second section showed the main empirical evidences of real financial markets, which confirm the validity

of our model. Third, chapter 4 presented the literature review of agent-based modelling not only in

terms of heterogeneity and rationality, but also in terms of realism and analytical tractability. This fact

were essential to understand and identify some missing features in original model which creates a market

scenario closer to reality and that allows a better reproduction of the main stylized facts. In this sense,

the connection between chapters 2, 3, 4 and the model itself was made in chapter 5, where the ABM

developed in this thesis is presented and its results evaluated. Lastly, the results of implementing such

a model, which used C++ as a programming language, were presented and discussed, providing a first

look to the potential of the ABM. Thus, the main results of our model are:

• emergence of the three main stylized facts: absence of autocorrelation in returns, heavy-tailed

distribution of returns and volatility clustering;

65

Page 82: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

• existence of financial bubbles and crashes, which can be originated by the fluctuations of the frac-

tions of each type of strategy;

• understanding of the origin of stylized facts with respect to the microscopic dynamics of the agents

in the market;

• importance of the non stationarity of market activity.

With the present work, the main objective of reproducing the main empirical evidences of financial

markets was achieved. However, the limitations of the model may be summarized to a set of vulnerabili-

ties. First, the main vulnerability is related to the fact that results depend heavily on initial conditions of

the system. Indeed, due to the computational character of the ABM in contrast to its analytical tractabil-

ity, it is difficult to identify the system stability limits. In this sense, a fine adjustment of parameters

was made in order to avoid the explosion of crude oil price. Moreover, we lack empirical estimates for

all behavioural parameters that we introduce in the evolutionary dynamics. On the other hand, since it

is not possible to obtain the daily periodicity of GDP, this macroeconomic series does not display a real

progress, conditioning the credibility of fundamental strategies.

Considering now the limitations of the model design, we can clearly identify four vulnerabilities.

First, due to the multitude of factors that influence the crude oil price, the Walrasian mechanism of

market price determination is limited. Indeed, this mechanism does not take into account the supply

and demand of real producers and consumers as well as is very dependent on the price adjustment

parameter. Second, it is necessary to develop an algorithm that simulates more realistically the Financial

Mathematics associated to the futures market, namely by introducing more maturity periods and initial

and maintenance margin requirements. Third, agents are limited to the amount of available trading

rules and there is no generation of new rules according to market trends. Lastly, there is no prospect of

continuity, since a new generation of agents is created in each trading day. The lack of individual wealth

update, does not give rise to bankruptcy situations.

Further developments may point to different directions but converge on the goal of having a more

powerful model. In this sense, we can choose a line of research that fixes the limitations of the model.

For example, we can develop new rules through genetic algorithms in which a set of trading rules would

change in time. Moreover, the model may be completed by adding new technical trading strategies like

geometric brownian motion and more fundamental ones based on other macroeconomic factors such as

interest rates, exchange rates and prices of other commodities. Finally, we can choose a line of research

that allows understanding the potential and limits to the undertaken approach, namely the quantitative

treatment of other stylized facts as well as the study of the market activity from a self-organization or

from statistical mechanics standpoint. In addition, these developments are only possible if there is a

parallel code C++ optimization to allow a greater number of simulated series in less time.

In conclusion, the ABM developed as well as the C++ implementation of it allowed to reproduce

and capture the main empirical evidences of crude oil financial market. In fact, the application of this

computational-oriented modelling in the crude oil futures market is noteworthy and innovative creating

a new middle term approach that give a clearer understanding of the importance of speculation on crude

66

Page 83: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

oil price formation. Moreover, the connection with the other models of the project “Energy Wars” can

provide a realistic picture of the linkage between Economy and crude oil price.

67

Page 84: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

68

Page 85: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Bibliography

Anufriev, M. and Dindo, P. (2010). Wealth-driven Selection in a Financial Market with Heterogeneous

Agents. Journal of Economic Behavior & Organization, 73(3):327–358.

Anufriev, M. and Hommes, C. (2012). Evolutionary Selection of Individual Expectations and Aggregate

Outcomes in Asset Pricing Experiments. American Economic Journal: Microeconomics, 4(4):35–64.

Arifovic, J. (1996). The Behavior of the Exchange Rate in the Genetic Algorithm and Experimental

Economies. Journal of Political Economy, pages 510–541.

Arifovic, J. and Gencay, R. (2000). Statistical Properties of Genetic Learning in a Model of Exchange

Rate. Journal of Economic Dynamics and Control, 24(5):981–1005.

Arrow, K. J. (1965). Aspects of the Theory of Risk-bearing. Yrjo Jahnssonin Saatio.

Arthur, W. B. (1996). Asset Pricing under Endogenous Expectations in an Artificial Stock Market. PhD

thesis, Brunel University, London.

Barndorff-Nielsen, O. E. (1997). Normal Inverse Gaussian Distributions and Stochastic Volatility Mod-

elling. Scandinavian Journal of Statistics, 24(1):1–13.

Beja, A. and Goldman, M. B. (1980). On the Dynamic Behavior of Prices in Disequilibrium. The Journal

of Finance, 35(2):235–248.

Beltratti, A., Margarita, S., and Terna, P. (1996). Neural Networks for Economic and Financial Modelling.

International Thomson Computer Press London, UK.

Bollerslev, T., Chou, R. Y., and Kroner, K. F. (1992). ARCH Modeling in Finance: A Review of the

Theory and Empirical Evidence. Journal of Econometrics, 52(1):5–59.

Bonabeau, E. (2002). Agent-based Modeling: Methods and Techniques for Simulating Human Systems.

Proceedings of the National Academy of Sciences of the United States of America, 99(Suppl 3):7280–

7287.

Bouchaud, J.-P. (2008). Economics needs a Scientific Revolution. Nature, 455(7217):1181–1181.

Breiman, L., Friedman, J., Stone, C. J., and Olshen, R. A. (1984). Classification and Regression Trees.

CRC press.

69

Page 86: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Brennan, M. J. and Schwartz, E. S. (1985). Evaluating Natural Resource Investments. Journal of

Business, pages 135–157.

Brenner, T. (2006). Agent Learning Representation: Advice on Modelling Economic Learning. Handbook

of Computational Economics, 2:895–947.

Brock, W. A. and De Lima, P. J. (1995). Nonlinear Time Series, Complexity Theory, and Finance. Social

Systems Research Institute, University of Wisconsin.

Brock, W. A. and Hommes, C. H. (1997). A Rational Route to Randomness. Econometrica: Journal of

the Econometric Society, pages 1059–1095.

Brock, W. A. and Hommes, C. H. (1998). Heterogeneous Beliefs and Routes to Chaos in a Simple Asset

Pricing Model. Journal of Economic Dynamics and Control, 22(8-9):1235–1274.

Brock, W. A., Hommes, C. H., and Wagener, F. O. (2005). Evolutionary Dynamics in Markets with

Many Trader Types. Journal of Mathematical Economics, 41(1):7–42.

Calvo, G. (2008). Exploding Commodity Prices, Lax Monetary Policy, and Sovereign Wealth Funds.

VoxEU. 20 June.

Campbell, J. Y., Lo, A. W., MacKinlay, A. C., and Whitelaw, R. F. (1998). The Econometrics of

Financial Markets. Macroeconomic Dynamics, 2(04):559–562.

Canoles, W. B., Thompson, S., Irwin, S., and France, V. G. (1998). An Analysis of the Profiles and

Motivations of Habitual Commodity Speculators. Journal of Futures Markets, 18(7):765–801.

Challet, D., Marsili, M., and Zhang, Y.-C. (2001). Stylized Facts of Financial Markets and Market

Crashes in Minority Games. Physica A: Statistical Mechanics and its Applications, 294(3):514–524.

Challet, D. and Zhang, Y.-C. (1997). Emergence of Cooperation and Organization in an Evolutionary

Game. Physica A: Statistical Mechanics and its Applications, 246(3):407–418.

Chen, S.-H., Chang, C.-L., and Du, Y.-R. (2012). Agent-based Economic Models and Econometrics.

Knowledge Engineering Review, 27(2):187–219.

Chen, W.-P., Choudhry, T., and Wu, C.-C. (2013). The Extreme Value in Crude Oil and US Dollar

Markets. Journal of International Money and Finance.

Chiarella, C. (1992). The Dynamics of Speculative Behaviour. Annals of Operations Research, 37(1):101–

123.

Chiarella, C., Dieci, R., and He, X.-Z. (2009). Heterogeneity, Market Mechanisms, and Asset Price

Dynamics. Handbook of Financial Markets: Dynamics and Evolution, pages 277–344.

Chiarella, C. and He, X.-Z. (2001). Asset Price and Wealth Dynamics under Heterogeneous Expectations.

Quantitative Finance, 1(5):509–526.

70

Page 87: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Chiarella, C. and He, X.-Z. (2003). Heterogeneous Beliefs, Risk, and Learning in a Simple Asset-Pricing

Model with a Market Maker. Macroeconomic Dynamics, 7(4):503–536.

Chiarella, C., He, X.-Z., and Hommes, C. (2006). A Dynamic Analysis of Moving Average Rules. Journal

of Economic Dynamics and Control, 30(9):1729–1753.

Chiarella, C. and Iori, G. (2002). A Simulation Analysis of the Microstructure of Double Auction Mar-

kets*. Quantitative Finance, 2(5):346–353.

Cont, R. (2001). Empirical Properties of Asset Returns: Stylized Facts and Statistical Issues. Quantitative

Finance, 1:223–236.

Cont, R., Potters, M., and Bouchaud, J.-P. (1997). Scaling in Stock Market Data: Stable Laws and

Beyond. ArXiv preprint cond-mat/9705087.

Coppola, A. (2008). Forecasting Oil Price Movements: Exploiting the Information in the Futures Market.

Journal of Futures Markets, 28(1):34–56.

Cristelli, M. (2013). Complexity in Financial Markets: Modeling Psychological Behavior in Agent-based

Models and Order Book Models. Springer.

Day, R. H. and Huang, W. (1990). Bulls, Bears and Market Sheep. Journal of Economic Behavior &

Organization, 14(3):299–329.

Duffy, J. (2006). Agent-based Models and Human Subject Experiments. Handbook of Computational

Economics, 2:949–1011.

EIA (2013). International Energy Outlook 2013.

Ellen, S. t. and Zwinkels, R. C. (2010). Oil Price Dynamics: A Behavioral Finance Approach with

Heterogeneous Agents. Energy Economics, 32(6):1427–1434.

Fama, E. F. (1991). Efficient Capital Markets: Ii. The Journal of Finance, 46(5):1575–1617.

Farmer, J. D. and Foley, D. (2009). The Economy Needs Agent-based Modelling. Nature, 460(7256):685–

686.

Farmer, J. D. and Joshi, S. (2002). The Price Dynamics of Common Trading Strategies. Journal of

Economic Behavior & Organization, 49(2):149–171.

Fattouh, B. (2011). An Anatomy of the Crude Oil Pricing System. Oxford Institute for Energy Studies.

Fattouh, B., Kilian, L., and Mahadeva, L. (2013). The Role of Speculation in Oil Markets: What Have

We Learned So Far? Energy Journal, 34(3).

Feng, L., Li, B., Podobnik, B., Preis, T., and Stanley, H. E. (2012). Linking Agent-based Mod-

els and Stochastic Models of Financial Markets. Proceedings of the National Academy of Sciences,

109(22):8388–8393.

71

Page 88: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Frankel, J. A. and Froot, K. A. (1986). Understanding the US Dollar in the Eighties: The Expectations

of Chartists and Fundamentalists. The Economic Record, pages 24–38.

Gaunersdorfer, A. (2000). Endogenous Fluctuations in a Simple Asset Pricing Model with Heterogeneous

Agents. Journal of Economic Dynamics and Control, 24(5):799–831.

Goldberg, D. E. et al. (1989). Genetic Algorithms in Search, Optimization, and Machine Learning,

volume 412. Addison-Wesley Reading Menlo Park.

Granger, C. and Ding, Z. (1999). Stylized Facts on the Temporal and Distributional Properties of Daily

Data from Speculative Markets. UCSD Department of Economics Discussion Paper, pages 94–19.

Grossman, S. J. and Stiglitz, J. E. (1980). On the Impossibility of Informationally Efficient Markets. The

American Economic Review, 70(3):393–408.

Hamilton, J. D. (2005). Oil and the Macroeconomy. The New Palgrave Dictionary of Economics Palgrave

Macmillan, London. Available online at http://www. dictionaryofeconomics. com/dictionary. Jimenez-

Rodrιguez, Rebeca and Marcelo Sanchez, pages 201–228.

Hamilton, J. D. (2008). Understanding Crude Oil Prices. Technical report, National Bureau of Economic

Research.

Hamilton, J. D. (2009). Causes and Consequences of the Oil Shock of 2007-08. Technical report, National

Bureau of Economic Research.

He, X.-Z. and Li, K. (2012). Heterogeneous Beliefs and Adaptive Behaviour in a Continuous-time Asset

Price Model. Journal of Economic Dynamics and Control, 36(7):973–987.

Helbling, T., Mercer-Blackman, V., and Cheng, K. (2008). Riding a Wave. Finance and Development,

45(1):10–15.

Hommes, C. (2011). The Heterogeneous Expectations Hypothesis: Some Evidence from the Lab. Journal

of Economic Dynamics and Control, 35(1):1–24.

Hommes, C. H. (2002). Modeling the Stylized Facts in Finance through Simple Nonlinear Adaptive

Systems. Proceedings of the National Academy of Sciences of the United States of America, 99(Suppl

3):7221–7228.

Hommes, C. H. (2006). Heterogeneous Agent Models in Economics and Finance. Handbook of Computa-

tional Economics, 2:1109–1186.

Hull, J. C. (1997). Options, Futures, and Other Derivative Securities. Prentice-Hall, Englewood-Cliff,

N.J., third edition.

Jennings, N. R. (2000). On Agent-based Software Engineering. Artificial Intelligence, 117(2):277–296.

Kaldor, N. (1939). Welfare Propositions of Economics and Interpersonal Comparisons of Utility. Economic

Journal, 49(195):549–552.

72

Page 89: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Kaufmann, R. K. (1995). A Model of the World Oil Market for Project LINK Integrating Economics,

Geology and Politics. Economic Modelling, 12(2):165–178.

Kaufmann, R. K. (2011). The Role of Market Fundamentals and Speculation in RecentPrice Changes

for Crude Oil. Energy Policy, 39(1):105–115.

Kilian, L. (2009). Not all Oil Price Shocks are alike: Disentangling Demand and Supply Shocks in the

Crude Oil Market. The American Economic Review, 99(3):1053–1069.

Kilian, L. and Murphy, D. P. (2013). The Role of Inventories and Speculative Trading in the Global

Market for Crude Oil. Journal of Applied Econometrics.

Kim, G.-r. and Markowitz, H. M. (1989). Investment Rules, Margin, and Market Volatility. The Journal

of Portfolio Management, 16(1):45–52.

Kirman, A. (1993). Ants, Rationality, and Recruitment. The Quarterly Journal of Economics, 108(1):137–

156.

Kirman, A. (2010). The Eonomic Crisis is a Crisis for Economic Theory. CESifo Economic Studies,

56(4):498–535.

Lawrenz, C. and Westerhoff, F. (2003). Modeling Exchange Rate Behavior with a Genetic Algorithm.

Computational Economics, 21(3):209–229.

LeBaron, B. (2002). Building the Santa Fe Artificial Stock Market. Physica A.

LeBaron, B. (2006). Agent-based Computational Finance. Handbook of Computational economics, 2:1187–

1233.

LeBaron, B., Arthur, W. B., and Palmer, R. (1999). Time Series Properties of an Artificial Stock Market.

Journal of Economic Dynamics and control, 23(9):1487–1516.

Levy, M., Levy, H., and Solomon, S. (1994). A Microscopic Model of the Stock Market : Cycles, Booms,

and Crashes. Economics Letters, 45(1):103–111.

Longerstaey, J. and Spencer, M. (1996). RiskMetricsTM—Technical Document. Morgan Guaranty Trust

Company of New York: New York.

Lux, T. (1995). Herd Behaviour, Bubbles and Crashes. The Economic Journal, pages 881–896.

Lux, T. (1998). The Socio-economic Dynamics of Speculative Markets: Interacting Agents, Chaos, and

the Fat Tails of Return Distributions. Journal of Economic Behavior & Organization, 33(2):143–165.

Lux, T. (2009). Stochastic Behavioral Asset Pricing Models and the Stylized Facts. Handbook of Financial

Markets: Dynamics and Evolution. North-Holland: Amsterdam, pages 161–216.

Lux, T. and Marchesi, M. (1999). Scaling and Criticality in a Stochastic Multi-agent Model of a Financial

Market. Nature, 397(6719):498–500.

73

Page 90: Agent-based computational model for crude oil futures market · The purpose of this thesis was to develop and test an agent-based computational model for the crude oil futures market,

Lux, T. and Marchesi, M. (2000). Volatility Clustering in Financial Markets: A Microsimulation of

Interacting Agents. International Journal of Theoretical and Applied Finance, 3(04):675–702.

Malkiel, B. G. and Fama, E. F. (1970). Efficient Capital Markets: A Review of Theory and Empirical

Work*. The Journal of Finance, 25(2):383–417.

Mandelbrot, B. and Taylor, H. M. (1967). On the Distribution of Stock Price Differences. Operations

Research, pages 1057–1062.

Markowitz, H. (1952). Portfolio Selection*. The Journal of Finance, 7(1):77–91.

Martinez-Jaramillo, S. and Tsang, E. P. (2009). An Heterogeneous, Endogenous and Coevolutionary

GP-based Financial Market. IEEE Transactions on Evolutionary Computation, 13(1):33.

Mitchell, M. (1998). An Introduction to Genetic Algorithms. MIT press.

Murphy, J. J. (1999). Technical Analysis of the Futures Markets: A Comprehensive Guide to Trading

Methods and Applications, New York Institute of Finance. Prentice-Hall.

Pagan, A. (1996). The Econometrics of Financial Markets. Journal of Empirical Finance, 3(1):15–102.

Pareto, V. and Politique, C. d. (1897). Vol. 2. Rouge, Lausanne.

Pearson, K. (1905). The Problem of the Random Walk. Nature, 72(1865):294.

Pindyck, R. S. (1994). Inventories and the Short-run Dynamics of Commodity Prices. Technical report,

National Bureau of Economic Research.

Pratt, J. W. (1964). Risk Aversion in the Small and in the Large. Econometrica: Journal of the

Econometric Society, pages 122–136.

Prause, K. (1999). The Generalized Hyperbolic Model: Estimation, Financial Derivatives, and Risk

Measures. PhD thesis, PhD thesis, University of Freiburg.

Regnier, E. (2007). Oil and Energy Price Volatility. Energy Economics, 29(3):405–427.

Reitz, S. and Slopek, U. (2009). Non-linear Oil Price Dynamics: A Tale of Heterogeneous Speculators?

German Economic Review, 10(3):270–283.

Routledge, B. R. (2001). Genetic Algorithm Learning to Choose and Use Information. Macroeconomic

Dynamics, 5(2):303–325.

Saucier, R. (2000). Computer Generation of Statistical Distributions. Technical report, DTIC Document.

Taylor, M. P. and Allen, H. (1992). The use of Technical Analysis in the Foreign Exchange Market.

Journal of International Money and Finance, 11(3):304–314.

Vansteenkiste, I. (2011). What is Driving Oil Futures Prices?: Fundamentals versus Speculation. Tech-

nical report, European Central Bank.

Yang, J. (2002). The Efficiency of an Artificial Double Auction Stock Market with Neural Learning

Agents. Studies in Fuzziness and Soft Computing, 100:85–106.

74