<<

Computational and , Tutorial 16/09/2007

What Computational Finance?

♦ What is Artificial ♦ Forecasting and Trading Intelligence? – Opportunities, Computational Finance & – Not easy to define ♦ Automated Trading ♦ Defined by the activities in Economics the community ♦ Optimization – Portfolio optimization

Edward Tsang ♦ Challenging fundamentals in ♦ Understanding markets Economics and Finance – Automated Bargaining Centre for Computational Finance and Economic – Rationality – Artificial Markets for Agents (CCFEA), University of Essex – Efficient market • Evolving strategies • Wind-tunnel testing IEEE Technical Committee on Computational Finance and Economics Why Computational Finance? What are the challenges ahead?

16 September 2007 All Rights Reserved, Edward Tsang

Why Computational Finance? What can be done now: Enabling technology:

Large scale simulation Must faster machines Forecasting Data warehouse Much cheaper memory

Building complex models Agent-technology Is the market predictable? Efficient exploration of Evolutionary computation What exactly is the forecasting problem? models (Multi-Obj) Optimisation Decision support experimental game theory, constraint satisfaction

16 September 2007 All Rights Reserved, Edward Tsang

• Will the price go up or down? By how much? EDDIE adds value to user input

♦ User inputs indicators Forecasting – e.g. moving average, volatility, predications ♦ EDDIE makes selectors

• What prices do we have? – e.g. “50 days moving average > 89.76” Daily? Intraday (high ♦ EDDIE combines selectors into trees frequency)? Volume? Indices? Economic – by discovering interactions between selectors Models?  Finding thresholds (e.g. 89.76) and interactions by human experts is laborious • Are Option and Future prices aligned? (i.e. are there arbitrary opportunities?) 16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

Edward Tsang, All Rights Reserved 1 Computational Finance and Economics, Tutorial 16/09/2007

An Example Decision Tree Syntax of GDTs in EDDIE-2

Is X’s P/E ratio lower than the ::= “If-then-else” | Decision industry average by ≥20%? ::= "And" | Yes No "Or" | "Not" | Has X’s price risen by ≥ Is X’s price ≥ 14-days Variable Threshold 5% since a week ago? moving average? ::= ">" | "<" | "=" Yes No Yes No

Buy Has X’s price fallen by Sell No Action Variable is an indicator / feature ≥ 6% since yesterday? Decision is an integer, “Positive” or “Negative” implemented Yes No Threshold is a real number Sell No Action ♦ Richer language ⇒ larger search space

16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

A taste of user input Our EDDIE/FGP Experience

Expert More Define ♦ Patterns exist Given adds: input: target: – Would they repeat themselves in the future? Daily 50 days Volat- ↑4% in (EMH debated for decades) closing m.a. ility 21 days? ….. ♦ EDDIE has found patterns 90 80 50 1 – Not in every series 99 82 52 0 (we don’t need to invest in every index / share) 87 83 53 1 ♦ EDDIE extending user’s capability 82 82 51 1 – and give its user an edge over investors of the ….. ….. ….. ….. same caliber

16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

Arbitrage Opportunities

♦ Futures are obligations to buy or sell at certain prices ♦ Options are rights to buy at a certain price ♦ If they are not aligned, one can make risk-free profits Portfolio Optimization – Such opportunities should not exist – But they do in London

Future selling price: £11

Option price: £0.5 { Option right to buy: £10

16 September 2007 All Rights Reserved, Edward Tsang

Edward Tsang, All Rights Reserved 2 Computational Finance and Economics, Tutorial 16/09/2007

Portfolio Optimization

♦ Typically: – High risk  high return – Diversification reduces risk Risk ♦ Task: find a portfolio Automated Trading – Maximize return, minimize risk ♦ Difficulty: constraints, e.g. Fix risk – No more than n stocks Max return? – Not too much on one stock – Not too much on one sector ♦ Optimization problem Return – Note: how to measure risk?

16 September 2007 All Rights Reserved, Edward Tsang

What is Automated Trading? Computer vs Human Traders

♦ Programs work day and night, humans can’t ♦ Programs can react in miliseconds, humans can’t ♦ Programs can be fully audited, humans can’t ♦ When programs make mistakes, one can learn and change the culprit codes – Human traders will simply change jobs ♦ Expertise in computer programs accumulates – Human traders leave with his/her experience ♦ Program makes decisions autonomously – Could be expert system, machine learning, technical trading 16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

FAQ in Automated Trading ♦ How can you predict exceptional events? – No, we can’t – Neither can human traders Automated Bargaining ♦ How can you be sure that your program works? – No, we can’t – Neither did Nick Leeson at Barrings – If you can improve your odds from 50-50 to 60-40 in your favour, you should be happy – Codes can be verified

16 September 2007 All Rights Reserved, Edward Tsang

Edward Tsang, All Rights Reserved 3 Computational Finance and Economics, Tutorial 16/09/2007

Automatic Bargaining Overview Bargaining in Game Theory n shared variables Cost ?? Utility ♦ Rubinstein Model: π = Cake to share between A and B (= 1) 0 ? π Supplier Customer In reality: A and B make alternate offers xA xB Offer at time t = f (r , r , t) • Maximize profit x = A’s share (x = πA–xB) IsA it necessary? B A AB Supplier • Satisfy constraints Customer rA = A’s discount rate - purchase Ist = it# rational?of rounds, at(What time ∆ isperrational?) round Decay of Payoff over time Supply price Me  0.6 Who do I know? 0.5  -sell  ♦ A’s payoff xA drops as time goes by defines my cost 0.4 - schedule A’s Payoff = xA exp(– rA t∆)   0.3 P a y

o 0.2 f

♦ Important Assumptions: f Supplier Customer – Both players rational 0.1 0.0 – Both players know everything Time t 0 12345678910 How to bargain? ♦ Equilibrium solution for A: Motivation in Aim: to agree on price, delivery time, etc. µ = (1 – δ ) / (1 – δ δ ) Optimal offer: Notice: e-commerce: Constraint: deadlines, capacity, etc. A B A B talk to many where δi = exp(– ri ∆) xA = µA No time t here Who to serve? Who to talk to next? at t=0 16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

Evolutionary Rubinstein Bargaining, Overview Issues Addressed in EC for Bargaining

♦ Game theorists solved Rubinstein bargaining problem ♦ Representation – Subgame Perfect Equilibrium (SPE) / ♦ Slight alterations to problem lead to different solutions – Should t be in the language? – Asymmetric / incomplete information ♦ One or two population? – Outside option ♦ How to evaluate fitness − − ♦ Evolutionary computation – Fixed or relative fitness? – Succeeded in solving a wide range of problems – EC has found SPE in Rubinstein’s problem ♦ How to contain search space? 1 δ 1 × – Can EC find solutions close to unknown SPE? ♦ Discourage irrational strategies: B ♦ Co-evolution is an alternative approximation method to find –Ask for x>1? game theoretical solutions A – Ask for more over time? – Less time for approximate SPEs δA δB – Less modifications for new problems – Ask for more when δA is low?

16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

Representation of Strategies Two populations – co-evolution

Player 1 Player 2 ♦ A tree represents a mathematical function g ♦ We want to deal with

♦ Terminal set: {1, δA, δB} asymmetric games ♦ Functional set: {+, −,×, ÷} – E.g. two players may have … … ♦ Given g, player with discount rate r plays at time t different information g ×(1 –r)t ♦ One population for training ♦ Language can be enriched: each player’s strategies – Could have included e or time t to terminal set ♦ Co-evolution, using relative … … – Could have included power ^ to function set fitness ♦ Richer language  larger search space  harder – Alternative: use absolute fitness search problem Evolve over time

16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

Edward Tsang, All Rights Reserved 4 Computational Finance and Economics, Tutorial 16/09/2007

Incentive Method: Constrained Fitness Function Models with known equilibriums ♦ No magic in evolutionary computation Complete Information – Larger search space  less chance to succeed ♦ Rubinstein 82 model: ♦ Constraints are heuristics to focus a search – Alternative offering, both A and B know δA & δB – Focus on space where promising solutions may lie ♦ Evolved solutions approximates theoretical ♦ Incentives for the following properties in the function ♦ Working on a model with outside option returned: Incomplete Information – The function returns a value in (0, 1) ♦ Rubinstein 85 model: – Everything else being equal, lower δ  smaller share – B knows δA & δB A weak strong – A knows δA and δB & δB with probability Ωweak – Everything else being equal, lower δB  larger share Note: this is the key to our search effectiveness ♦ Evolved solutions approximates theoretical

16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

Models with unknown equilibriums Evolutionary Bargaining, Conclusions

♦ Modified Rubinstein 85 models ♦ Demonstrated GP’s flexibility – Models with known and unknown solutions ♦ Incomplete knowledge – Outside option – B knows δB but not δA; A knows δA but not δB – Incomplete, asymmetric and limited information ♦ Asymmetric knowledge ♦ Co-evolution is an alternative approximation method – B knows δA & δB; A knows δA but not δB ♦ Asymmetric, limited knowledge to find game theoretical solutions – Relatively quick for approximate solutions – B knows δA & δB – A knows δA and a normal distribution of δB – Relatively easy to modify for new models ♦ Working on limited knowledge, outside option ♦ Genetic Programming with incentive / constraints ♦ Future work: new bargaining procedures – Constraints used to focus the search in promising spaces

16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

Artificial Market Evolving Agents

Markets are efficient in the long run Should agents adapt to the environment? How does the market become efficient? Do all agents converge in their opinions? Co-evolution Wind-tunnel testing for new markets

Edward Tsang, All Rights Reserved 5 Computational Finance and Economics, Tutorial 16/09/2007

The Red Queen Thesis Evolving Agents In this place it takes all the running you can do, to ♦ Sunders, Cliff: keep in the same place. ♦ Schulenburg & Ross – Zero intelligence agents – Heterogenous agents ♦ Chen & Yeh: ♦ Markose, Martinez & – Market efficiency can be (agents may have obtained by zero- different knowledge) – Endogenous prices Tsang: intelligence agents as – Agents are GPs – CCFEA work in progress long as the market rules – Agents modelled by classifier systems – “Peer pressure” (relative – Wealth exhibits Power are properly set. wealth) lead to agents Law – This result challenges the – Exogenous prices retraining themselves – Wealth drives retraining neoclassical models – Beat buy-and-hold, trend – Retraining is done by – Retraining is done by regarding the utility follower and random “visiting the business EDDIE maximization behaviour walk agents school” of economic agents

16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

Conclusions Computational Finance & Economics

♦ Computing has changed the landscape of finance and economics research Questions & Comments? – We can do what we couldn’t in the past ♦ Evolutionary computation plays major roles in – Forecasting investment opportunities Edward Tsang http://www.bracil.net/finance – Approximating subgame equilibrium in bargaining http://edward.bracil.net/ – Understanding markets (or just search for Edward Tsang) – Wind-tunnel testing new market mechanism

16 September 2007 All Rights Reserved, Edward Tsang

Joseph Stiglitz

♦ Nobel Economic Prize 2001 ♦ Senior VP and Chief Economist, World Supplementary Information Bank, 1997-2000 ♦ Critical view on globalization ♦ Founder, The Initiative for Policy Dialogue, to: – Explore policy alternatives – Enable wider civic participation in economic policymaking

16 September 2007 All Rights Reserved, Edward Tsang

Edward Tsang, All Rights Reserved 6 Computational Finance and Economics, Tutorial 16/09/2007

Game Theory Hall of Frame

1994 Future of Nobel Prize Computational Finance John John Nash Reinhard Selten Harsanyi

2005 Nobel Prize Robert Thomas Aumann Schelling

Opportunities and Challenges in CF&E The Computational Finance Community

♦ Wide varieties of financial applications ♦ Conferences: – IEEE International Conference on Computational Ineelligence for ♦ Different types of learning mechanism – Annual Workshop on Economics with Heterogenous Interacting Agents ♦ Different markets to simulate (WEHIA 2005 at Essex, Markose, Sunders, Dempster) – International Conference on Computing in Economics and Finance ♦ Wind-tunnel tests will become the norm – International Joint Conference on Autonomous Agents and Multi-Agent Systems – Yet to be developed ♦ Useful web sites: ♦ Challenges: – Tesfatsion’s Agent-based – Chen’s AI-ECON Research Centre – Large number of parameters to tune ♦ IEEE Network on Computational Finance and Economic – What can the simulations tell us? ♦ IEEE Technical Committee on Computational Finance and Economics

16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

What is Rationality?

♦ Are we all logical? Rationality ♦ What if Computation is involved? ♦ Does Consequential Closure hold? Rationality is the assumption behind – If we know P is true and P  Q, then we know Q is many economic theories true What does being rational mean? – We know all the rules in Chess, but not the optimal moves Are we rational? ♦ “Rationality” depends on computation power! The CIDER Theory – Think faster  “more rational”

16 September 2007“Bounded Rationality” All Rights Reserved, Edward Tsang

Edward Tsang, All Rights Reserved 7 Computational Finance and Economics, Tutorial 16/09/2007

CIDER: Computational Intelligence CIDER: Computational Intelligence Determines Effective Rationality (1) Determines Effective Rationality (2)

♦ You are offered two choices: ♦ You have a product to sell. – to pay £100 now, or ♦ One customer offers £10 – to pay £10 per month for 12 months ♦ Another offers £20 ♦ Given cost of capital, and basic ♦ Who should you sell to? mathematical training ♦ Not a difficult choice ♦ Obvious choice for a rational seller …

16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

CIDER: Computational Intelligence Determines Effective Rationality (3) The CIDER Theory ♦ Task: ♦ Rationality involves Computation – You need to visit 50 ♦ Computation has limits customers. ♦ Herbert Simon: Bounded Rationality – You want to minimize ♦ Rubinstein: model bounded rationality by explicitly travelling cost. specifying decision making procedures – Customers have different ♦ Decision procedures involves + heuristics time availability. ♦ Computational intelligence determines effective ♦ In what order should you ♦ This is a very hard problem rationality visit them? ♦ Some could make wiser ♦ Where do decision procedures come from? decisions than others – Designed? Evolved?

16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

1978 Nobel Economic Prize Winner “Bounded Rationality”

♦ Artificial intelligence ♦ Herbert Simon: ♦ “For his pioneering research into the decision- – Most people are only partly rational, and are in fact making process within economic organizations" emotional/irrational in part of their actions ♦ “The social sciences, I thought, needed the same kind of rigor and the same mathematical ♦ “Boundedly” rational agents behave in a underpinnings that had made the "hard" sciences Herbert manner that is nearly as optimal with respect to so brilliantly successful. ” Simon its goals as its resources will allow ♦ Bounded Rationality (CMU) – Resources include processing power, and – A Behavioral model of Rational Choice 1957 Artificial time available intelligence ♦ Quantifiable definition needed?

Sources: http://nobelprize.org/economics/laureates/1978/ http://nobelprize.org/economics/laureates/1978/simon-autobio.html

16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

Edward Tsang, All Rights Reserved 8 Computational Finance and Economics, Tutorial 16/09/2007

Modelling Bounded Rationality (1998) Efficient Market Hypothesis

♦ Rational decisions are optimal ♦ Financial assets (e.g. shares) pricing: decisions – All available information is fully reflected in – But decisions makers often try to current prices satisfy constraints ♦ If EMH holds, forecasting is impossible – Rather than finding optimality – Random walk hypothesis ♦ Rationality comes from decision ♦ Assumptions: making procedures – Efficient markets (one can buy/sell quickly) – Procedures should be specified Ariel Rubinstein explicitly – Perfect information flow New York University – This put the study of procedures on – Rational traders the research agenda

16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

Does the EMH Hold? Test: Syntax – GDTs in EDDIE-2

♦ It holds for the long term ::= “If-then-else” | Decision ::= "And" | ♦ “Fat Tail” observation: "Or" | – big changes today often followed by big changes "Not" | (either + or –) tomorrow Variable Threshold ::= ">" | "<" | "=" ♦ How fast can one adjust asset prices given a new piece of information? Variable is an indicator / feature – Faster machines certainly help Decision is an integer, “Positive” or “Negative” implemented – So should faster algorithms (CIDER) Threshold is a real number ♦ Richer language ⇒ larger search space

16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

Evolutionary Computation: Model-based Generate & Test A Model could be a Model population of solutions, (To Evolve) or a probability model ( T o Generate: select, create/mutate vectors / trees u

Evolutionary Computation F p e d e

a A Candidate Solution d

t Candidate b e

a could be a vector of m

c Solution

k variables, or a tree o

A very brief introduction d e

l Test Genetic Programming ) The Fitness of a solution Observed is application-dependent, Performance e.g. drug testing

16 September 2007 All Rights Reserved, Edward Tsang

Edward Tsang, All Rights Reserved 9 Computational Finance and Economics, Tutorial 16/09/2007

GP Operators r e

1 a v 1 a o s s

 o Wind-tunnel Testing r

2 3 b c C 2 d b c  4 5 6 7 d e f g 4 5 3 e f g Understanding the market Searching for market mechanism 8 9 h i 8 9 6 7 h i Learning strategies Mutation: change a branch

16 September 2007 All Rights Reserved, Edward Tsang

Agent-based Artificial Market Wind-tunnel tests n o i

t Strategy Design Wind Tunnel Market Testing

a for new markets

c • How to do well in market • Designing new markets i l p p

A Agent 1 ♦ New markets are being Agent 2 invented Artificial endogenous – e-Bay, electricity, roads Market exogenous ♦ Model new markets to l

a check if they work t Agent n n

e – Answer what-if questions Better understand the market m

a ♦What makes a market efficient? – Evolve agents to d What happens when

n ♦Ask “what happen if…” approximate equilibriums u agents evolve? F

16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

CHASM Research Summary

1200

1000

800

600

400 Ref: AI-ECON, 200 Giardina et al 2003, 0 Artificial Markets 1 252 503 754 1005 1256 1507 1758 2009 2260 2511 2762 3013 other markets CHASM Platform Questions: c How does the i EDDIEEDDIE h EDDIE p Understanding the Stock Market price change? r o

m Artificial

What is the y l Fundamental o EDDIEEDDIE endogenous Market effect of P learning by Noise traders? EDDIEEDDIE

16 September 2007 All Rights Reserved, Edward Tsang

Edward Tsang, All Rights Reserved 10 Computational Finance and Economics, Tutorial 16/09/2007

CHASM Overview Red Queen EDDIE Agents Agents evolve Heterogeneous beliefs Example agent

* Now, here, you see, it takes all the running you can do, to keep in the same place. If you want to get somewhere else, you must run at least twice as fast as that! * Agents: technical, fundamental, noise or hybrid (mode switching) Experimenter controls the number of agents in each group 16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

Artificial Finance Market Conclusions

♦ Platform supports wide range of experiments ♦ Conditions for stylized facts identified in endogenous, realistic market Credit Card Payment Market ♦ Agents must be competent and realistic – Some must observe fundamental values ♦ Learning agents (EDDIE-based): An Agent-based approach – Statistical properties of returns and wealth distribution changed – No need for fundamental trader!

16 September 2007 All Rights Reserved, Edward Tsang

Why Modelling? Why Agent Modelling

♦ Scientific Approach ♦ Agent modelling allows – Modelling allows scientific studies. – Human expert opinions are valuable, – Heterogeneity – But best supported by scientific evidences – Geographical distribution ♦ Multiple Expertise – models can be built by multiple experts at the same time – Micro-behaviour to be modelled – The resulting model will have the expertise that no single expertise can have. ♦ Representative models don’t allow these ♦ Models are investments ♦ Micro-behaviour makes the market – Models will never leave the institute as experts do. – Investments can be accumulated.

16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

Edward Tsang, All Rights Reserved 11 Computational Finance and Economics, Tutorial 16/09/2007

Agent-based Payment Card Market Model Conclusion, Credit Card Payment Analysis Government: public interest drives regulations Possible Objectives: Payment • Maximize profit ♦ Market behavior is complex and hard to analyze Consistent patterns Card • Maximize market share observed with static agents ♦ APCM is useful for studying the card market provider Learning optimal strategies – It is a good model of consumers and merchants behavior

Costumer’s fees Merchant’s fees – Could be used to predict demands Decisions, decisions and benefits and benefits ♦ GPBIL could be used for searching strategies under certain requirements Interactions at the Point Of Sale ♦ Observation: rich results… e.g. Costumer Merchant – Market info determines outcomes Connected (topology) – More information  less dominance

16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

The Collaborator Problem Regions

Manager y t i l i / b n a l i o i e a t v a m r i A u T r D e e b n o i J g

Market-based Scheduling n E

Staff Empowerment for BT’s workforce scheduling

Research Agenda: Engineers To define for management a Jobs mechanism to achieve all-win Controllers solutions 16 September 2007 All Rights Reserved, Edward Tsang

Agent-based Payment Card Market Model Research Profile, Edward Tsang Business Applications of Artificial Intelligence Government: public interest drives regulations Possible Objectives: Application Technology Payment • Maximize profit Consistent patterns • Maximize market share Card Finite Choices Decision Constraint Satisfaction, Optimisation, observed with static agents provider Learning optimal strategies Support, e.g. Assignment, Heuristic Search (Guided Local Scheduling, Routing Search) Costumer’s fees Merchant’s fees and benefits Decisions, decisions and benefits Financial Forecasting Genetic Programming Automated Bargaining Genetic Programming Interactions at the Point Of Sale Wind Tunnel Testing for Mathematical Modelling, Machine Costumer Merchant designing markets and Learning, Experimental Design Connected finding winning strategies (topology) Portfolio Optimisation Multi-objectives Optimisation

16 September 2007 All Rights Reserved, Edward Tsang 16 September 2007 All Rights Reserved, Edward Tsang

Edward Tsang, All Rights Reserved 12