michael noonan metaphors in finance 07513992

Upload: michaelnoonan88

Post on 07-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    1/29

    Final Year Project Report

    Metaphors In Finance

    Michael Noonan

    A thesis submitted in part fulfilment of the degree of

    BA/BSc (hons) in Computer Science

    Supervisor: Prof. Mark Keane

    Moderator: Dr. Liam Murphy

    UCD School of Computer Science and Informatics

    College of Engineering Mathematical and Physical Sciences

    University College Dublin

    May 5, 2011

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    2/29

    Table of Contents

    Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    1.1 Project Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    1.2 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    2 Project Description and Report Structure . . . . . . . . . . . . . . . . 4

    2.1 Project Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    2.2 Report Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    3 Background Research . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    3.1 Power Laws, The Pareto Principle and Graphs . . . . . . . . . . . . . . . . 6

    3.2 Gerow and Keane Research . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    3.3 Stock Market Bubbles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    3.4 Herding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    4 The Network Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    4.1 Random Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    4.2 Scale-Free Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    5 Design and Implementation . . . . . . . . . . . . . . . . . . . . . . . . . 15

    6 Evaluation and Comparison of Models . . . . . . . . . . . . . . . . . . . 18

    6.1 Mean Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

    6.2 Power-Law Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    6.3 Robustness Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    7 Conclusions and Future Work . . . . . . . . . . . . . . . . . . . . . . . . 25

    7.1 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

    7.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    Page 1 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    3/29

    Abstract

    The Aim of this project is to give an insight into the language patterns observed in a corpusof over 17,000 financial articles, to further research why these patterns arise, to examine theirsignificance and to develop specific software that models the data in a network like fashion. Byevaluating and comparing the different models it is found that the the real world financial-data model is Barabasi-like in structure. In other words, Barabasi-like properties such aspreferential attachment and scale invariance occur in this and other real world networks.The random model on the other hand is different and follows a different structure.

    This project involves background research into power laws, random and scale-free networksand the area of cognomics - the study of how people act in large group situations typically

    through the use of language corpora. The software developed will include implementation offour different network models:

    A Network model of the actual structure of the data gleaned from the financial corpus.

    A Random (Erdos-Renyi) Network.

    Two versions of a Barabasi Network.

    Upon completion of the software development and comparative analysis, conclusions are madebased on the new knowledge acquired throughout the project.

    Page 2 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    4/29

    Chapter 1: Introduction

    1.1 Project Specification

    General Information:

    Gerow & Keane (2010) have shown that power-law analyses of the language used by financialreporters across a corpus of over 17,000 articles (from the Financial Times, New York Times,and BBC) can predict the 2007 stock market bubble and crash; in simple terms, systematicchanges in the language used in articles reflect the emergence of an homogenous and positive(unrealistic) view of the market at the time even amongst seasoned commentators (see alsoGerow, 2010). This work built up a large corpus of articles that can be analyzed further.This project will examine whether the observed network for this empirical data correspondsto theoretical predictions from either random-network models or scale-free networks.

    Mandatory:

    Review existing work on corpus-based approaches to metaphor.

    Review existing work on network models.

    Develop random network model, a Barabasi, scale-free model and a network model of

    the observed data.

    Develop empirical comparisons of these three models (statistical, qualitative).

    Draw conclusions on what model best corresponds to the known data.

    Discretionary:

    Develop novel methods for comparing different network models.

    Exceptional:

    Develop graphical interface for comparing models.

    1.2 Acknowledgments

    I would like to thank my project supervisor and mentor Professor Mark Keane for all his helpduring the past academic year. I would also like to thank Prof. Keanes former MSc studentAaron Gerow.

    Page 3 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    5/29

    Chapter 2: Project Description and Report

    Structure

    2.1 Project Description

    The aim of my final year project is to build upon the research done by project supervi-sor Prof. Mark Keane and his former MSc student Aaron Gerow. In their paper entitledThe voice of the herd: Power-law regularities in newspaper articles predict market bubbles,Gerow & Keane (2010) showed that a power-law analysis of the language used by financial

    commentaries could predict stock market bubbles. These regularities in the form of languageagreement were looked at in two different ways. One was Verb-convergence where the sameVerbs were used and the second was Noun-convergence where the same Nouns were used.Verbs and Nouns are the building blocks of sentences and thus help identify common phrasesused. As explained in the paper:

    Our basic hypothesis is that the language used by financial commentatorsduring an economic bubble will manifest emergent structure as it converges week-to-week on the same positive view of the stock market

    This convergence of Verbs and Nouns can be partly attributed to what is known as Herdmentality. This is where people such as financial commentators become influenced by thegroup or majority viewpoint and become less inclined to contribute their own independentviews. As a result, a common style is seen and a common language structure can be ob-served. Herd mentality is studied in many different areas such as Psychology, Sociology andEconomics and will be discussed in detail later on in this report.

    My research gives a further insight into why these language patterns exist and how they canbe used to some degree in informing us about peoples thought processes, as viewed throughthe lens of their language usage. The software development aspect implements the networkmodels described above while the comparison of the models shows how Barabasi propertiesexist within the real world financial model. This is why the comparison was carried out;

    to determine whether the data from the financial corpus was closely related to a Barabasinetwork or a random network.

    This new type of language analysis is growing, a lot of the worlds biggest companies havestarted researching these language patterns in the hope of gaining a greater understandingof customer trends. Google for example often performs various types of language analysis onits search queries. Some are so powerful that as a result they can predict annual car sales toa fairly accurate degree based on monthly searches (Choi & Varian 2009).

    Page 4 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    6/29

    2.2 Report Structure

    The first Chapter is merely an introduction to the project laying out the official projectspecification and acknowledging anyone who has helped with the project along the way. Thesecond chapter gives a more detailed description of the project and what is to be achieved

    and why. The next section is all about background research, this chapter has numeroussubsections devoted to the different areas in which research was carried out. The fourthchapter focuses on the different network models that were built outlining the approach takenand any problems encountered.

    The Design and Implementation chapter goes into more detail on the technical side of thesoftware development, illustrating code examples and design issues. The penultimate sec-tion focuses on evaluation and comparison of the network models. Graphs will be used tocompare the different results obtained from running the software. The final chapter is aboutconclusions that can be drawn from the projects outcome along with any future work.

    Page 5 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    7/29

    Chapter 3: Background Research

    Background research was a vital part of this project. Power-laws and the Pareto principle arekey properties of scale-free networks. Learning about the work already carried out by otherswas also very important. Finally, the inner workings of the stock-market were researchedalong with the influences that make people invest. From this projects point of view, Herdingwas of great interest and is discussed along with the others in this section.

    3.1 Power Laws, The Pareto Principle and Graphs

    Power-laws have been used for decades to analyze the relationship between different quanti-ties. At first they were thought of as rare but nowadays a power-law explosion has revealedthat the phenomenon can be observed in many walks of life. They exist in social networks,in nature, in sport, almost everywhere.

    Zipfs law was one of the earliest reported power-law distributions. The law is named afterlinguist George Kingsley Zipf after he carried out a power-law analysis of the popular bookMoby Dick (Zipf, 1932). What Zipf noticed was that a very small number of words were usedfrequently whilst a huge number of words were only appearing a fraction of the time. Thefrequency distribution followed a power-law of the this form (The power-laws derived from

    my own curves follow this form too):

    y = Cxa (3.1)

    Poer-laws can be explained in more detail by looking at what is known as the Pareto principle(Koch, 1999). Named after Italian economist Vilfredo Pareto, this principle also known asthe 80/20 rule is often used as short hand for expressing power laws. For example, the 80/20rule can be used to express the distribution of wealth around the world. 80 percent of theoverall wealth is held by 20 percent of the population. i.e. there are very few people whoare super rich while the vast majority of the people are moderately wealthy. This is just likeZipfs Moby Dick analysis whereby a huge percentage of the words used came from a small

    set of common words such as the, and, at etc.I came up with one particular example that helped me understand power-laws and the Paretoprinciple. The premier league is the top football league in England, it consists of 20 teamsfrom all over the country. Power-laws and Paretos principle can be seen in many differentways when looking at the premier league. Since its inception 20% of the teams have accountedfor 100 percent of the trophies, in other words only 4 teams have won the premier leaguewhile the other 16 teams, or 80% have not. One reason is due to the wealth of these topteams. When a team wins the league they earn more money and are therefore more likely towin the league again. The rich get richer while the poor get poorer. This demonstrates a keyaspect of power-laws i.e. the frequency of an event (e.g. winning the premier league trophy)varies as a power of some related attribute (e.g. the wealth of the league).

    So as the overall wealth of the league increases, the % distributed to the top 4 teams isfar greater than the % distributed to the other 16. This demonstrates a key property of aBarabasi network namely preferential attachment meaning that the teams included in the

    Page 6 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    8/29

    top 20% have a bias in their favor towards winning the league again. Just like Google is morelikely to link to a newly created webpage, teams in the top 4 of the premier league are morelikely to win more trophies. This example shows that power-laws exist all around us and arequite easy to observe.

    Power-laws are being used today in new ways. With the evolution of the World Wide Web

    and the growth of social networks such as facebook, power-law distributions are being used togive an insight into the structural attributes of these networks by looking at the distributionbetween nodes and links. This is where graph theory comes in. Graphs can be created fromalmost anything provided there are nodes and links (Keane, 2010). Power-law analysis canbe carried out on these graphs by looking at the degree distributions of the various nodes.For example, when a node such as a web page is linked to another page its degree increases by1. As will be shown later on in this chapter, Random and Scale-free networks have differentstructures and different degree distributions.

    3.2 Gerow and Keane Research

    The first bit of background research to be carried out revolved around the paper The voiceof the Herd: Power-law regularities in newspaper articles predict market bubbles (Gerow &Keane, 2010).

    In this paper it was shown that a power-law analysis of a corpus of 17,000+ financial articlescould predict the 2007 stock market bubble. The corpus contained articles from some of themost influential financial news sources in the world such as The Financial Times and the NewYork Times collected over a period of four years. The data was collected via computerized

    web-searches and the Verbs and Nouns extracted via a parser.

    Each article was shallow-parsed to extract verb- and noun-phrases, using aparser that handles recursive phrase structure

    The power-law analysis showed that there was an uneven distribution of verbs and nounsthroughout the articles. This bias became more pronounced as time grew closer to the 2007bubble period. This uneven distribution reflected an agreement in language used by thefinancial commentators. As was mentioned before, this agreement was looked at primarily interms of verb convergence (similar verbs being used) and noun convergence (similar nouns

    being used).As the 2007 stock market bubble grew closer, the exponents of the power laws which representword frequency distributions trended upwards indicating a higher agreement in language. Asthe bubble started to burst the opposite was witnessed and a downward trend was seen.Graphs which visibly show such trends are displayed in section 3.3 below.

    Equation 3.2 shows a simple 8-week windowed, geometric mean of a where a refers to thatweeks particular power-law value. The model for a given week looks like so:

    weeki =

    8ai3...ai...ai+4 +

    8ai4...ai...ai+3

    2(3.2)

    It should be noted that 19 common verbs (or skywords) were excluded due to the fact theywould skew the accuracy of any results obtained. Examples of such words were are be and

    Page 7 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    9/29

    was. Sketch engine was used to rank common lemmas with their most common arguments.The result of this process was 36 .csv files each named after the verb it represents. Withineach file there are two columns, one for arguments (Arg) and another for frequency (Freq.).See Figure 3.1 below which gives an example of what one of the .csv files looks like. Thispaper forms the backbone of my research and I am using the same .csv files to build thenetwork models.

    Figure 3.1: Example .csv file

    3.3 Stock Market Bubbles

    Asset price bubble refers to the discrepancy between the real value and ac-tual listing of a share, while bubble in the literary economists interpretation is abroader economic phenomenon where the continuous rise of share prices is fueledby the investors expectations of further increase (Komromi, 2006)

    Be it company shares or commodities like gold, everything traded on the stock market has a

    value. This value is continuously monitored throughout the day and changes all the time. Ascan be seen from the quotation above, bubbles can be looked at in two ways. A mathematicalway, in which a stocks current value is monitored relative to its real value and a speculativeway, where bubbles are formed by the investors future expectations.

    A bubble can form when the value of a stock goes far and above the regular trading priceand steadily increases as more and more investors plough money into the stock. The lawof supply and demand forms the foundations of the stock markets inner workings. Whenstocks are in demand investors are willing to pay a higher price, often this is because theysee demand increasing in the future and thus further price increases. The ultimate aim ofa seasoned investor is to buy prime stocks when the price is low and sell these stocks backwhen the peak price has been reached. Knowing how much and when stock prices are going

    to change can be a combination of both skill and luck. A stock market bubble will eventuallyburst, as a result, investors begin to sell their shares off (they are led to believe that priceswill continue to fall dramatically) and again the law of supply and demand tells us that if

    Page 8 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    10/29

    all these investors rush to sell their shares as quickly as possible supply will outstrip demandand they will have to accept a lower price.

    There have been major economic bubbles in the past many of which have been responsiblefor significant damage to both the local and global economy. In Ireland, the effects of theproperty bubble collapse can be seen all over the country. Another well known bubble that

    was further reaching was the dot com bubble. This occurred during the mid 90s and lastedfor around five years. Share prices in many self-proclaimed e-commerce companies rosedramatically during these years. As this was a speculative bubble, many investors were takenaback by how quickly stocks in these companies were rising and bought large amounts ofshares anticipating further increases. While many made millions from these stocks by sellingbefore the bubble burst, a huge number of people lost millions of dollars.

    What some economists consider to be a bubble others do not. A key reason for this is due tothe different models that are used to measure and evaluate stock performance and companyprofits. When looking back throughout history many stock valuations have been skewed dueto changes in how they are measured. For example, when the popular computer manufacturer

    DELL began utilizing Just-In-Time production where inventory and associated costs weresignificantly cut, the valuation of DELL stock had to be measured in a new light. The fact thatdifferent models give different valuations makes it difficult to agree on bubble classificationand prediction.

    There are many different views regarding financial bubbles and when/how they can be de-tected. Former federal reserve chairman Alan Greenspan once famously spoke of how a bubblecould only be detected after it had burst and the damage had been done. Others believe theycan be predicted and to a fairly accurate degree. One such individual is Didier Sornette,the director of the financial crisis observatory at the Swiss federal institute of technology inZurich.

    Prof. Sornette has long shown an interest in trying to predict how and when bubbles will formand how and when they would burst. Sornette and Woodard, (2009) explain how bubblesform and burst:

    A crash occurs because the market has entered an unstable phase and anysmall disturbance or process may reveal the existence of instability

    He mentioned how long term events can cause a bubble to burst and a crash to occur. Ratherthan looking at events immediately preceding the crash he believes we should look furtherback at smaller changes that gradually grow to where they contribute towards a bubble

    collapse. Language patterns are an example of a subtle change that can develop over manyyears. Traditionally, many economists wouldnt place much importance on what they deemedirrelevant factors towards a bubble bursting. What this project shows is that a lot can belearned from patterns derived from our language usage. Specifically how the language usedby financial commentators can influence stock market behaviour.

    How the stock market and in particular the bubble phenomenon relate to my project isinteresting. The investors as described above are constantly looking at various different stockson the market. They buy and sell and repeat this process over and over again. Decisions onwhat stocks will make a good return often comes from the news and in particular financialarticles in popular newspapers. Nowadays with smartphone apps many investors can beupdated with the latest stock news at the touch of a button. Due to the reliance many

    investors have on these articles their content plays an important role in shaping how investorsthink and act.

    The language used can motivate certain actions while discouraging others. When there

    Page 9 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    11/29

    is a high rate of language agreement the influence these articles can have on prospectiveinvestors cannot be understated. What causes this agreement in language among even themost seasoned experts is what this project focuses on. Herding is one way in which thesepatterns can emerge and will be described in detail in the next section.

    While analyzing the corpus of articles, language patterns emerge over time. These patterns

    can then be compared to the actual performance of the stock market by looking at the keyindices such as the Dow Jones (United States), and the Nikkei 225 (Japan). Figure 3.2. belowshows the relationship between the Dow Jones index and the power-law distribution of verbfrequencies (Keane & Gerow, 2010). As can be seen there is a direct relationship between thetwo. As the Dow Jones reaches its peak so too does the verb convergence in the language.Likewise, as the Index plummets down the power-law distribution also trends downwards.There is also an interesting relationship between more positive language being used around

    Figure 3.2: Relationship between Dow Jones Index & Power-law verb distribution

    the time of the 2007 stock market bubble and subsequently less positive language being usedduring the bursting of the bubble and the crash. Figure 3.3, shows the relationship betweenthe Dow Jones index and the type of language (positive or negative) over the four year period(Keane & Gerow, 2010). It goes along with the trend seen in Figure 3.2.

    Before the Dow Jones index reached its peak level there was a clear increase in the amountof positive language being used. This positive language was represented phrases such as:Stocks rose again today and so on. As the index began to fall and reach a low pointnegative language was used far more frequently. The type of language being used beforethe bubble bursts was positive, promoting a healthy environment for which to invest. Thislanguage can reflect an unrealistic and exaggerated view of the stocks health. The amount ofnegative language increased as the bubble began to burst, financial commentators would havebeen using phrases like Share prices plummet drastically. This promoted an environmentwhich was unfriendly to investors resulting in many share valuations declining.

    Page 10 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    12/29

    Figure 3.3: Relationship between Dow Jones index & language valiance

    3.4 Herding

    One of the key parts of my research was to delve further into the effects of social herding.As mentioned at the beginning of this report herding is a form of group behavior wherebyindividual opinions are sacrificed for the wider accepted opinion or voice of the majority. Forexample, if a certain sector in the stock market was performing well and there was a positiveview that there would be further price increases many commentators would continue to goalong with this positive view, using similar verb and noun phrases, rather than expressingan opposing opinion. It was important to have a more detailed look into this phenomenonand evaluate its consequences. Sornette(2004) explains that herding can play a vital role inbubbles forming and bursting:

    To understand stock markets, one needs to consider the impact of positive

    feedbacks via possible technical as well as behavioral mechanisms such as imitationand herding

    When analyzing the effects of herding, it is helpful to take an approach which encompassesa psychological or sociological viewpoint as well as an economic one. Humans are ultimatelysocial beings and are influenced by their environment and those that live in it. Our decisionsare often based on how others act and react, more so than we might believe. Herding can beobserved in the shareholders circle and also the experts circle. In terms of investment, manyprospective shareholders may not have a detailed knowledge of the stock market, they couldbe regular people trying to make a bit of extra money. As a result of this they look towardsthose in the know to try and get some advice. Sornette & Woodard, (2009) outlines:

    a larger and larger group of people seek to become rich without a real under-standing of the process involved

    Page 11 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    13/29

    In terms of influencing stock market investment there is essentially herding in two differentgroups. Herding in terms of language agreement among financial commentaries and herdingamong actual investors. Many of these people go along with the group and will not try andform their own opinion. Why is this so? Often in social situations a person will conform withthe group view as it seems logical at the time. Group pressure is also a factor with manyindividuals less inclined to express innovative ideas when a majority view exists.

    What is interesting in terms of this project is why experts like financial commentators aresubject to herding, surely these people with their vast knowledge of the stock market canform multiple differing views of an investment situation?. There is a psychological elementto why this herd behavior may exist. Rook, (2006) presents a psychological viewpoint.

    economists unanimously explain herd behavior out of the sheer number ofothers that partake in an action. In contrast, Psychologists maintain that it oftenis not the actual number of a majority that causes such conformity under pressure,but a need for consensus

    Basically for many of these financial commentators, the stock market demands a consensus ofsome sort, saying a certain stock will go down by 10 points or go up by 10 points are completelyopposing views and rarely will both opinions be right on the day. When looking at bubblecollapses the traditional view was to ignore some of the underlying behavior mechanisms andlook towards more concrete facts such as exchange rates or company collapses. Ultimatelythe stock market is run by people, people who are influenced by many factors including theopinions of others. As a result herding plays a crucial role in how financial commentators actand thus how prospective investors react.

    It is also interesting to note that the majority view as regards a stocks value is often out inthe open and not hidden from view. Many stock brokers and related websites give consensusratings to let prospective investors know other investor trends. It is quite common for stockbroker sites to have a what the experts are saying section immediately giving such contentand influence over the reader, be it another commentator or a potential investor.

    Page 12 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    14/29

    Chapter 4: The Network Models

    The software development aspect of this project involved implementing 4 different networkmodels. The first was a representation of the financial data from the corpus of articles.The second was a random network, while the third and fourth were variations of Barabasi-style networks. The third model demonstrated preferential attachment at a point after thestandard model had been built which would single-out preferential attachment and show howcertain nodes gain more links than others. The other version involved growth (the gaining oflinks) from scratch along with preferential attachment.

    In the end the random network should have a normal link distribution (each node shouldreceive a roughly a mean share of links) the Barabasi model should exhibit scale-free prop-

    erties such as a power-law distribution and scale invariance. Before implementation of thesemodels could be done, research had to be carried out to learn more about their structure.By implementing these models a comparison could be carried out which would reveal therelationship between the real world financial model and Barabasi & random networks. It wasfound out that the real world network is far more Barabasi-like in structure.

    4.1 Random Networks

    My early research into random networks led me to the ErdosRenyi model, a popular modelfor generating random graphs. The model was named after Paul Erdos and Alfrd Rnyi and isbased on the assumption that nodes are selected to be linked based on some random process.The G(n, P) model states that a graph is constructed by linking nodes in a random fashionbased on probability (Goldburt & Zhang, 2006). Each edge is included in the graph basedon a probability element represented by the letter P. The parameter P is like a weightingfunction within the range 0 to 1. As P gets closer to 1 the model is more likely to includegraphs with more edges and as it gets closer to 0 the opposite.

    Random Networks possess some unique properties. Due to the fact that nodes are linked viaa random process there is no bias involved when building the graphs. As a result the degree

    distribution (number of inlinks to each node) is quite even across the network. In otherwords, nodes with a huge share of the overall inlinks or Hubs do not exist or are far lesslikely to exist than in a scale-free network. Balke and Siberski, (2007) gave a lecture at theUniversity of Hannover where they spoke about the degree distribution of random graphs:

    Random graph models suggest that the degree of the vertices will not deviatefrom the average degree in the graph

    or at least not by a significant figure. These properties will be illustrated later on in thereport when a comparative analysis of the network models is carried out.

    Page 13 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    15/29

    4.2 Scale-Free Networks

    The other type of network that was to be modeled was a scale-free network with preferentialattachment. A scale-free network is also referred to as a power-law network, this is becauseany network where the degree distribution follows a power-law is deemed to be scale-free.This

    means is that even if the scale is multiplied by a factor, the ratio of highly connected nodesto regular-connected nodes stays roughly the same. Scale-free networks are typically verylarge networks containing millions or even billions of nodes. They grow constantly as canoccur in many different areas such as nature, society and technology. The World Wide Webfor example is a very well known scale-free network.

    The specific type of scale-free network that was of interest to this project was a Barabasi-stylemodel with preferential attachment properties. Balke and Siberski, (2007) mention how in1999 Albert-Lazlo Barabasi (after whom the model is named) crawled a small portion of theWorld Wide Web in order to discover its structural properties. At the outset, Barabasi andhis team expected that the web was so large that it would be a random-style network. Their

    findings were surprising.

    Barabasi & Reka (2009) mentioned how the World Wide Web is scale-free. Much like thePareto Principle mentioned above they found that most web pages only contained a handfulof links, more interestingly it was found that a small minority of web pages contained a hugeamount of links and accounted for a huge percentage of total links crawled. They commented:

    a few highly connected pages are essentially holding the World Wide Webtogether

    They go on to say that the scale-free power law like qualities are due in part to what is

    known as preferential attachment. Preferential attachment is the process by which nodes ina network such as the web are more likely to be connected to already well established nodeswith a high number of inlinks than a less well established node. For instance, if a new webpage is created and added to the billions of web pages already on the internet, it is far morelikely that the page will be linked to a site like Google with a huge hub-quality than anindividual blog. In scale-free networks with preferential attachment it is often common thatthe rich get richer and the poor get poorer. That is, as the network gains more links overall,the well established nodes also grow more than the less established nodes gaining more links.Hubs (nodes with a huge % of links) are a key part of scale-free networks and this is in starkcontrast to random networks where there are no hubs.

    While it is easy to differentiate between Random networks such as those based on the ErdosRenyi model and scale-free networks based on the Barabasi-style model, it can be quitedifficult to pick a better model between the two as both have advantages and disadvantages.When building any network it is important that they are robust and resistant to attack.In random networks if certain nodes are removed the whole network can crumble. In largescale-free networks such as the World Wide Web removing several nodes will likely haveno impact at all unless a major Hub is damaged. This makes scale-free networks strongerin the face of random failure, however it makes them more vulnerable to malicious attack.If key hubs are strategically targeted then the consequences can be dramatic. When mynetwork models were implemented I chose nodes at random and asked what would happen ifhypothetically speaking these nodes were removed. The results are laid out in the Robustnesssection towards the end of the report.

    Page 14 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    16/29

    Chapter 5: Design and Implementation

    Before the actual implementation of the network models could be done it was importantthat the right approach was taken. It was decided that implementing the different networkmodels and evaluating and comparing them could lead to some interesting insights. The nextissue was what programming language to use. Ruby was to be the language of choice as itwas the most efficient language to use given the project set-up. During the early weeks ofcoding some time was taken to adjust to the Ruby programming language. After this initialslow-down implementation began.

    I found that the theory behind both the Random and Barabasi Models was laid out in asuch a way that would make the code difficult to implement and inefficient. It was decided

    that the financial model was to be carried out in a straight forward manner, this was not aproblem. For this model nodes had to be created based on the data contained in the .csvfiles. Verb nodes were created and linked with all the Noun nodes they were associated with.Likewise each Noun node was created and linked to the desired Verb. For each Verb thenumber of inlinks are counted and displayed on screen. Nouns that link to multiple verbs arealso displayed via a check node noun similarity function.

    For the random model noun nodes would be created and linked to verb nodes using a randomprocess. Essentially nouns and verbs were taken from the .csv files and placed into differentarrays, one for verbs and one for nouns. Using a simple random number generator a randomnode was built. Below is some code examples which demonstrate how the above was achieved.

    @random_noun = noun.get_nouns(rand(nounlist.length))

    @random_verb = verb.get_verbs(rand(verbs.length))

    randomnode = Random_Node.new(@random_noun, "NOUN", @random_verb)

    In the above case, the variables random noun and random verb contain nouns and verbsrespectfully which have been taken from the different arrays. These variables are then usedto create a new Random Node object. There was a slight problem with the random modelin that Prof. Keane and I was not sure if the random generator was random enough to beused. After some research into the topic It was found that it was the best possible solution.

    For the Barabasi Model implementation was slightly more time consuming as there was afew different ways in which it could be done. My first attempt at implementation onlydemonstrated one characteristic of the network and that was preferential attachment. Icreated a special array where instances of every noun was created, within this array I had alist of each instance of a verb. This array was basically an adaptation of the array used inthe random network, except in this case each instance of a verb was taken into account forpreferential attachment purposes. Just like the building of the random model a random nounnode was selected and linked to a verb from this special array. This demonstrated preferentialattachment as the verb nodes with the most instances (inlinks) were more likely to be chosenand linked to. See code below.

    @random_noun = noun.get_nouns(rand(nounlist.length))@pref_verb = noun.get_eachinstance_verbs(rand(eachinstance_verbs.length))

    prefnode = Random_Node.new(@random_noun, "NOUN", @pref_verb)

    Page 15 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    17/29

    The problem with the above version of the Barabasi model is that while it satisfies the pref-erential attachment property of the network, it does not satisfy the other property, Growth.One of the key aspects of a scale-free network is that it grows. Nodes are added continuouslyand preferential attachment determines where these nodes go upon creation. This version ofthe network took longer to implement. I began by giving each vertex (verb node) an initialdegree of 1, that is to say that each vertex was in the network. If the degree was 0 thatwould mean the node was completely disconnected and preferential attachment could nottake place. The vertices were stored in an array. A random noun node was created andlinked to a verb node from this array. Each time a given vertex was chosen by the processits inlink degree increased by 1 and another instance of the node was placed into the arrayand the cycle continued. This meant that as a verb was linked to more and more it had agreater chance of being selected. Below is a code sample illustrating the process for the verbAdvance

    @random_noun = noun.get_nouns(rand(nounlist.length))

    @verb = @initial_verbs[rand(@initial_verbs.length)]

    if @verb == verb.get_verbs(0)

    @advance_degree+=1

    @start = Barabasi_Node.new(@random_noun, "NOUN", @verb, @advance_degree)

    @prefnodebucket

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    18/29

    def initialize(name, type, linkedto, degree)

    @name = name #Its name i.e. string (advance for verb or sector for noun)

    @type = type #whether the node is a verb or a noun

    @linkedto = linkedto #describes what the node is linked to

    @degree = degree #inlinks

    end

    Page 17 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    19/29

    Chapter 6: Evaluation and Comparison of

    Models

    A key part of the project was establishing which similarities and differences existed betweenthe different models that were implemented. It was also important to analyze whether thesemodels performed as they were supposed to according to the research carried out. In the endconclusions could be drawn which would give further information about the structure of thefinancial data model and how it works. There were different ways in which the models couldbe compared, the key attribute in most of the cases was going to be the degree of the vertices(Verb Nodes). The three main comparative studies done were:

    Mean Analysis of the top 10 Verbs

    Power-Law analysis

    Robustness test

    Before each of these studies could be carried out it was important to establish the environmentunder which such tests would be run. I implemented my code using the TextMate generalpurpose editor on a MacBook Pro and this same environment was originally to be used toobtain model results. In the beginning, just to get testing underway I generated small modelsof 1000 noun nodes being added to the network. This was sufficient to ensure the models

    were performing in a suitable fashion but it was soon realized that this small scale was notrepresentative of the average degree of the financial data model and thus had to be adjusted.

    To find out how big the financial data model was all the inlinks were added up. In the endit was shown that 112,758 inlinks were present in the network and so to generate a model ofcomparable size 112,758 noun nodes would be used in my own models. The next issue washow many runs would be needed to get a accurate representation of any data obtained. MyLaptop performed best using 250 as the run count.

    In order to cut down on program running time nodes were created but not displayed to thescreen and results were obtained as usual by adding up inlinks and dividing by 250 to get anaverage run. The TextMate editor was used instead of the interactive ruby shell.

    Page 18 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    20/29

    6.1 Mean Analysis

    For the mean analysis, after the 250 runs were finished the top 10 verbs from each model werechosen. The idea was to find out how many of the 112,758 nodes were distributed betweenthese top 10 verbs thus giving an insight into any bias that might exist in the models. The

    results were as follows. In the random model no bias was found, 28 percent of the nodes wererepresented by the top 10 as shown in Figure 6.1 below. The top 10 verbs were : Retreat,Elevate, Rise, Slip, Strong, Ease, Worsen, Rally, Advance, Slide

    Figure 6.1: Random Model

    For the scale-free Barabsi models, there was indeed a bias in both cases. In version 1 the biaswas slightly more pronounced with the top 10 verbs accounting for a huge 77 percent of allinlinks. This is very close to the 80-20 rule. See Figure 6.2 below. The top 10 verbs were :Fall, Rise, Strong, Gain, Weak, Lose, Drop, Rally, Climb, Increase

    Figure 6.2: Barabasi Ver. 1 Model

    Page 19 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    21/29

    For the second version (Fig. 6.3), which satisfies both key properties of a Barabasi scale-freenetwork, the results showed a big difference in noun allocation with 66 percent of all nounsbeing linked to the top 10 verbs. The top 10 verbs were : Stable, Rally, Plunge, Weak,Unstable, Surge, Hard, Retreat, Float, Lose

    Figure 6.3: Barabasi Ver. 2 Model

    To show how inlinks are distributed as nodes are added, more runs were done to single outthe biased distribution in the Barabasi models. These runs were separate from the ones aboveso the top 5 verbs arent the same.

    Figure 6.4 below shows the top 5 verbs and their inlink allocation over the first 10 runs under

    random and Barabasi ver. 2 conditions. As can be seen, in the random model the top 5 verbswere allocated roughly the same amount of nouns on each run. There were small fluctuationswhereby the order of the top 5 changed. In the Barabasi ver. 2 model the opposite was seen.On the first run there was a clear hierarchy formed. This order was maintained throughoutthe 10 runs. The verb which acts as the biggest hub was linked to more nouns than thesecond biggest, with the second biggest getting more links than the third and so on. Thisshows clearly both growth and preferential attachment at work. Once a hub emerges it is farmore likely to gain more and more links as the network grows.

    Figure 6.4: Distribution of links with growth

    Page 20 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    22/29

    The Barabasi networks follow a power-law distribution and this is shown in greater detaillater on. A key property of a Barabasi network is that it is scale-free. Scale-invariance isalso a property of power-laws and means that as scale changes the ratio of hub nodes tonon-hub nodes remains constant. Figure 6.5 below demonstrates this. For one set of runs112,758 nodes were added and the top verb was linked to 13.8% of all links. When the scalewas increased by a factor of 10 and 1,127,580 nodes were added, the top verb got 13.9%.This shows that while the number of inlinks varied as a result of an increase in size the % ofinlinks did not. To consider it in terms of the World Wide Web, If the number of web pagesdoubled overnight, Google would receive many more links but its overall share of links wouldstay constant.

    Figure 6.5: Scale-Invariance

    Figure. 6.6 below gives a good representation of all three models side by side. It shows thenumber of mean number of inlinks for the top 10 verbs across all the models. The randommodel has a normal distribution while both Barabasi models demonstrate a power-law andbiased distribution.

    Figure 6.6: Top 10 Verbs inlink Histogram

    6.2 Power-Law Analysis

    Another key aspect of the comparative analysis was to find out whether the network modelsfollowed a power-law distribution. Of course from the background research that was carriedthe desired outcome was known. For the random model a power-law analysis should provenegative. In the case of the scale-free Barabasi models the distributions should follow a

    power-law.

    In order to carry out the power-law analysis the average inlink for each of the 36 verbs wasnoted down, ordered, and put into a spreadsheet. A curve was then generated along with a

    Page 21 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    23/29

    subsequent equation which represents the curve. Along with an equation for the curves I alsohave an R-squared value. The closer this value is to 1 the better the data fits the curve. Atypical power-law curve exhibits Pareto Principle behavior in that it conforms to the 80-20rule. A small portion of events will have a high distribution while the majority will have amuch lower distribution. In the case of the random model no pronounced curve existed, thiswas known due to the figures all staying extremely close to the average. In the figure belowBarabasi Version 2 is compared with the random model.

    As can be seen, each of the 36 verbs in the random model have a very even distribution withthe most frequent and least frequent verbs only having a difference of 16 inlinks. This is instark contrast to Barabasi Version 2 whereby the curve follows a power-law. The most linkedto verb contains over 15 percent of the entire allocation. The most linked to verb has a hugenumber of inlinks compared to that of the least linked to verb, a difference of 17,411 links.This is over a thousand times the difference seen in the random model which illustrates ahuge bias.

    Figure 6.7: Barabasi Ver. 2 versus Random Model

    The first version of the Barabasi model possesses a curve which is almost identical to that ofthe financial data model. The figures below show the similar curves. My thoughts on whythis is so along with any further conclusions will be laid out in the final chapter of the report.Please note, there is a small error in the legend in Figure 6.8., the blue line represents theBarabasi Ver. 1 Model and not the financial Model.

    In summary, a power-law analysis of the three applicable models (all but the random model)yielded the following power-law equations:

    Financial Data Modely = e67183x1.509 (6.1)

    Barabasi Version 1 Modely = e67391x1.511 (6.2)

    Barabasi Version 2 Modely = e64667x1.417 (6.3)

    Page 22 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    24/29

    Figure 6.8: Barabasi Ver. 1 power-law distribution

    Figure 6.9: Financial Data Model power-law distribution

    Page 23 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    25/29

    6.3 Robustness Test

    In the background research section a little was discussed about the differences between randomstyle networks and scale-free type networks. Many researchers have wondered which model isstronger and least susceptible to damage. Scale-free networks such as the World Wide Web

    are thought of as being reasonably well secure in terms of major damage due to the fact thatthere are far less hubs than standard nodes. On the other hand random networks can suffermajor damage when nodes are removed from the network due to the fact they are all of fairlyequal importance.

    This was tested out on my models once the mean analysis and power-law analysis werecomplete. To test the strength of the networks I assumed that the models vertices werein-fact web pages and noun nodes were other web pages that could be linked to it. I used theRandom model and the second version of the Barabasi model. Once the models had beengenerated with the desired amount of nodes added (112,758) I randomly selected roughly 10percent of the vertices to be removed from the network, this amounted to four vertices.

    In the case of the random network model, due to the fact each vertex or web-page had the asimilar amount of inlinks all four could prove crucial in holding the network together and thusmajor damage could be caused. In terms of the scale-free network, out of the four verticesremoved not one was considered a hub and together all four only made up 5 percent of thetotal links. If this sort of situation was to happen in the real world to the World Wide Webbarely anyone would be affected.

    It is important to note however that in some cases (very rare) a hub was selected at random.This would be the equivalent to googles servers being shut down. A huge amount of web-traffic would be affected as a result of such a huge hub being removed from the network.While this particular test does not exactly tie in with the language pattern element of the

    project I felt it was useful to carry out to provide some data based on some backgroundresearch that was done into random and scale-free network structure.

    Page 24 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    26/29

    Chapter 7: Conclusions and Future Work

    Once sufficient research had been carried out along with the implementation of the networkmodels, conclusions could be drawn from the results that were obtained. One of the maingoals of this project as mentioned in the abstract was to find out whether the underlyingstructure of the financial data model was more closely linked to that of the random ErdosRenyi model or the scale-free Barabasi type. The financial data model demonstrated a similarpower-law distribution to the Barabasi models and differed greatly from the random modelstructure as seen below.

    7.1 Conclusions

    In the financial model there are significant verbs that gain a huge allocation of the nouns.It is interesting to observe that in the financial data the verbs Fall (27,285 inlinks) and Rise(23,647 inlinks) are the top two verbs. Together they account for almost 50 percent of total

    links, this is significant as they both provide good, clear representations of the two differentstages of a bubble. Stocks rise before and during a bubble and Stocks fall as the bubblebursts and a crash may occur.

    The fact that phrases containing these two verbs occur a lot may mean that financial com-mentators value them more, perhaps they see these verbs as a way of getting across theirmessage to everyone while using phrases containing less known verbs such as exacerbate (285inlinks) far less often. In terms of the random model it is completely random and thus nobias towards particular verbs exist. The Barabasi Version 1 model singles out preferentialattachment and provides extremely similar results to the financial model. As nodes are cre-ated, hubs such as Fall and Rise grab a huge amount of these nouns. In the Barabasi Ver.1 model the Verb order is exactly the same as in the real-world financial model. This further

    backs up the facts that in Barabasi models the order is hard to disrupt due to the effects ofpreferential attachment.

    When this is put in terms of financial commentators and investment in the stock market.

    Page 25 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    27/29

    It can be thought of as similar to new articles being written by someone who already hasread hundreds if not thousands of financial articles by other commentators. Knowingly orunknowingly the most common verbs from the corpus of articles read are re-used over andover again.

    The bias within preferential attachment is essentially the herd mentality within financial

    writing. This herd mentality is then converted into actions on the stock exchange. If investorsare being subjected to these common verb phrases over and over again, then they are far morelikely to act positively or negatively depending on how positive or negative these phrases are.For example, if I am a person wanting to invest in some stocks yet know little about thestock market or what is likely to give a good return, it is quite logical to assume I will turnto the so-called experts that I believe will give me good advice. If this advice is biasedintentionally or unintentionally it will likely cause me to act in a certain way.

    In the second version of the Barabasi model where the network is grown from almost scratch,the bias isnt as significant. When putting the second version of the Barabasi model intoterms associated with language patterns in the stock market I like to think of the growth

    from scratch as the origination of new ideas, and the formation of hubs as a representationof those ideas that catch on.

    If certain financial commentators through their research originate new opinions about certainstocks and express these positive or negative opinions with appropriate verb and noun phrases,then these opinions may be picked up by other financial commentators who have read thearticle and re-used via quotations or similar phrases. These phrases and the use of Verbs andNouns contained within them can snowball into hubs whereas other ideas proposed will notgarner much publicity and thus be used less and less.

    Often the ideas that catch on may be inaccurate but eye-catching, many commentators maycontain such phrases as a means to attract attention or a in gamble to predict a value of

    a stock in the hope they are proved correct. Due to the fact a bubble can be viewed asan inaccurate representation of a stocks true value many commonly used phrases and verbscoming up to a bubbles peak are extremely positive. Before the property bubble collapsedverbs like Rise, Strong Jump etc were commonly used. This meant a lot of investorsviewed the stock as healthy and purchased some driving the price up and up.

    The fact that the Barabasi models are scale-free and contain a very similar power-law distri-bution as the financial model would allow the assumption to be made that the data containedwithin the financial model is scale-free also and that as the models grow and grow a similar80-20 rule will continue to apply irrespective of size. So in other words, if the corpus ofarticles was tripled in size to nearly 60,000+ a similar type of result would be observed.

    7.2 Future Work

    In terms of future work I believe there is a lot more to be discovered in this area. Power-lawsexist all around us in everyday life. Many different types of power-laws could be discoveredand tested. I found that the relationship between power-law distributions of events and howpeople act to be of utmost interest and importance and I feel such an area could be exploredfurther. It is obviously making some waves as many of the top companies in the world

    are carrying out power-law pattern analysis to learn more about their consumers and theircompetitors.

    Page 26 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    28/29

    As regards further research into peoples actions on the financial side, Prof. Keane and Mr.Gerow carried out some research into language valency i.e whether the verb-noun phraseswere positive, negative, or neutral. I feel that this is an area that I should have lookedinto more but didnt manage time sufficiently for it to be carried out correctly. It would beinteresting to see how much of an impact language valiance can have on potential investorsin the stock market.

    All of the articles contained within the corpus came from reputable financial news sourceslike the Financial Times and so forth. It would be interesting to observe language patternspresent in less formal sources such as blog posts or even comments on the articles themselves.The fact that many of these comments and blogs would be written by regular people mightgive a further insight into herd mentality in the minds of regular investors. Nowadays, withthe availability of financial articles on news apps on smartphones many more people arereading these articles and in many different languages. It would also be of interest to findout how people who dont speak english are likely to invest after reading articles translatedinto their first language. i.e. is some of the effect lost in translation?. All this research couldcontradict or confirm findings from this paper.

    There is much work to be carried out on whether certain graphs are random in nature orscale-free. The fact that Barabasi thought the World Wide Web was going to exhibit randomproperties yet ultimately found out it was one of the best examples of a scale-free networkshows that while we may assume certain structures are one or the other, that may not be thecase when subjected to detailed research.

    Finally, I was not able to complete the exceptional requirement of developing a GUI forcomparing the models. This could also be attempted at a later stage.

    Page 27 of 28

  • 8/4/2019 Michael Noonan Metaphors in Finance 07513992

    29/29

    Bibliography

    [1] Adamic, L.A. and Huberman, B. (2002) Zipfs law and the Internet, Glottometrics 3,2002,143-150

    [2] Balke, W-T and Siberski, W. (2007) Random Graphs, Small-Worlds, and Scale-FreeNetworks, [Lecture notes], L3S Research Center, University of Hannover

    [3] Barabasi A-L. and Reka, A. (1999) Emergence of Scaling in Random Networks, Depart-ment of Physics, University of Notre-Dame, Notre-Dame, IN 46556

    [4] Barabasi A-L. and Bonabeau, E. (2003) Scale-Free Networks, Sci. Amer. 288, Issue 5,60

    [5] Choi, H. and Varian, H. (2009) Predicting the Present with Goggle Trends

    [6] Gerow, A.M. and Keane, M.T. (2010) The Voice of the Herd: Power-law Regularities inNewspaper Articles Predict Market Bubbles. Unpublished Manuscript

    [7] Gerow, A.M. (2010) Metaphor in Financial Reporting

    [8] Goldburt, D. and Zhang, J. (2006) Large Graphs, [Lecture notes], CS485 Lecture 01

    [9] Keane, M.T. (2010) From Graphs to Google, [Lecture notes] Computer Science in Prac-tice Module, University College Dublin

    [10] Koch, R. (1999) The 80/20 Principle: The Secret to Achieving More with Less, Crown

    Business

    [11] Komromi, G. (2006) Anatomy of Stock Market Bubbles, First Edition, The ICFAI Uni-versity Press

    [12] Odintsova, N. and Rish, I. (2004) Fault Diagnosis in Scale-Free versus Random Networks,IBM Technical Report

    [13] Ottaviani, M. and Srensen, P. (1999) Herd Behavior and Investment: Comment, Forth-coming, American Economic Review

    [14] Rook, L. (2006) An Economic Psychological Approach to Herd Behavior, Journal of

    Economic Issues Vol. 40 No.1, March 2006[15] Sornette, D. and Woodard, R. (2009) Financial Bubbles, Real Estate bubbles, Derivative

    Bubbles, and the Financial and Economic Crisis

    [16] Sornette, D. (2004) Why Stock Markets Crash: Critical Events in Complex FinancialSystems, Princeton University Press

    [17] Zipf, G.K. (1932) Selected Studies of the Principle of Relative Frequency in Language.Cambridge, MA. Harvard University Press