Thursday, May 31, 2012

Why I Care


I like money, or at least having it. I think that this is a sentiment that we can all agree with, even if you don’t like the idea of money you can at least relate to liking having enough of it that you don’t have to worry about it.  I also like passing classes, and not having to do busy work to pass classes. With both of these assertions in mind when I was assigned the task of writing a rather long argumentative essay my first reaction was to find a way that I could associate it with computer science. That weekend I had been reading my news sites and stumbled across some research about black box traders on the forex market and I though “I might be able to do this better”, so I went on a tangent doing some research. The next day class came around and we needed  some topics and it occurred to me that I could not only work on making some money, I could also do research on something I actually cared about and avoid busy work. So I decided to make my topic an essay on how to improve algorithmic traders. 
This topic is import not only because it is addressing an interesting problem (and therefor needs no further justification) but it is also of importance to anyone who is interested in effectively investing effectively in any of the money markets. Having a computer that is able to make wise trades 1000s of time per second would be a huge advantage over the competition that a human trader presents especially if the algorithmic trader was able to adapt to new patterns as quickly as human are able to. Human trader who are not interested in using an algorithmic trader should also be interested so that they can effectively counter the threats posed by such an application.

Initial research


After initial research I have discovered that the use of genetic programming and artificial neural networks is extremely common. I did not realize how rudimentary my knowledge of both of these subjects were until I tried actually reading some of these research papers.  Currently I feel that my goal of developing a direction for research in the field of automated trader development is a feasible one, there is a wealth of information about how it is currently done and about what is currently not working. I am having a difficult time with some of the mathematics though, some of the papers talk about modeling the market as something call a dynamical system. I don’t have the vaguest clue as to what that actually means, all of the math in these papers is recursive and references a dozen other more complicated theorems that I understand even less. I think I will have to avoid methods that are stochastic, they are well over my head and besides that they don’t really focus on the part of computer science that I am interested in working on (AI). I think that I may need to narrow my research down from how to create a completely new method to how improve a particular method. I found a paper that may be a good candidate for this on something called social learning. Currently I am not able to develop a thesis though; my ideas are still far too rough and completely unsupported.
The annotated bibliography has been working great, having a “cheat sheet” of all of the research that I have done along with annotations about the quality of the articles is extremely handy. This is definitely a strategy that I plan on using in the future.

God? and Fallacy


The argument that god does or does not exist is one of the most infuriating arguments have ever had the displeasure of having with a multitude of people.  This is because a majority of the arguments that are used are fallacies. Starting with the one I feel is the most irritating, “I don’t have to prove that god does (does not) exist because you cannot prove the opposite” which is an argument from ignorance (argumentum ad ignorantiam). Following on the scale of irritating is the argument for the existence of god of “because the bible says so” where the user of the argument assumes that because there is some historically accurate facts in the bible the whole thing must be historically accurate. This is called an argument from scripture (which Wikipedia amusingly calls a spider-man fallacy). Another fun argument that is used to “prove” the existence of god is called the “First Cause Argument” which states that something had to start everything so there for it must have been god. This is called “Fallacy of the single cause” or causal oversimplification. An argument that I find particularly amusing against the existence of god is called the argument from poor design, this argument states essentially that things suck and god should have done a better job if he exists and is omnipotent. This is an fallacy because it makes an assumption that god did not make the universe in an optimal fashion, since there is no way to prove this there is no way to establish the validity of the argument.
I have encountered this set of fallacies both being on the telling side and the receiving side. I can remember when I was in high school and bit of an extremist not being  able to understand why my friends would not listen to me when I tried to convert them. Then when I got a bit older and was an extremist on the other side of the argument I could not understand why people would ever believe in god. Now I am somewhere in the middle and have the distinct pleasure of being amused by people using these particularly absurd arguments as if they were the only truths left on earth.


Outline

Go here to get my outline...
https://docs.google.com/open?id=0B1TnOdkv_G2hUXNlb2dmZUdFQms

Or if you insist on reading it in this terribly small screen on the blog it is also below.

Outline

Abstract

The major approaches to forecasting the market and the concepts needed to grasp a basic understanding are reviewed. After each approach support and counterarguments as to their use are given. Concluding the section on prior knowledge the difference between modeling the market as a dynamical system and as non-stationary system and the significance this decision has on the development of future agents is discussed. Culminating with a more in-depth explanation and expansion of social learning and supporting arguments as well as counter arguments towards its use versus the other possible methods. The Paper concludes with a short summary of why each method alone is not optimally effective and why social learning with selective combination is possibly a more effective method of prediction.

 

Thesis and support summary

Thesis

A combination of GP and ANNs as described in [1] and expanded with selective combination as described in [2], [3] may be a more effective method for market prediction.

Overview of current methods

Concepts and Current Methods

Statistical approaches

What is it?

Formally, Statistical approaches to prediction use deterministic mathematic models to predict the market.

English Example

It is common knowledge that when a card is drawn from a deck there is a 1/52 chance that the card drawn will be any given card, and as the deck gets smaller or the cards that are left become known this probability improves. When a blackjack player is counting cards he is constructing a statistical model of the deck in his head so that he knows when there is a low enough risk for him to bet.

Prior research

Generally in the market when a statistical method is used it is taking advantage of a statistical phenomenon that is moldable. [4] and [5] are examples of this. In [4] and [5] the models developed take advantage of the fact that humans will take more aggressive risks then may be wise.

Why Not

While in [5] the statistical model was successful for some time, when the humans involved in the trading were notified of the strategy being used the humans modified how they were trading to compensate and the statistical model quickly became nearly useless.
·         Generally bad at adapting to new situations. [5]
·         Will never learn from failures.
·         Generally only applicable to deterministic systems [6]

WHY

·         Deterministic. (You know what it will do when presented with any given situation)
·         Expressible as a mathematical model.
·         Fairly simple to implement. (This is because the structure of the model is just a set of formulas no complicated structuring of data is generally needed.)

Genetic Algorithms

What Is it?

Formally, Genetic Algorithms (abbreviated as GA or GP) are used to solve problem where there are to many variables to find the exact answer in a reasonable amount of time. GP accomplishes this by making a set of guesses as to the answer, evaluating how close each guess is, and then finally merging the best guesses in a variety of methods.

English example

GP was based off of how animals adapt to new situations over generations. Evolution is a perfect example of a genetic algorithm, the “best” animals of each generation mate and produce a set of offspring that is a mixing of the qualities of both parents then the process is repeated thereby continually optimizing the quality of the population.

Why Not

·         Can be slow
·         As with any AI GP can get stuck in what it thinks is the best solution but in reality is not.
·         GP that is not able to adapt to new situations is not only slow it is inaccurate [7].

WHY

·         It is possible for GP to adapt to new situations [1], [7].
·         Instances of GP agents can share information and help each other evolve more quickly (social learning) [1].
·         GP can be constructed in a way that makes it possible to see what the agent has learned [7].

Prior research

·         [7] explores how to classify GP algorithms and which classes are most effective, examples of how to implement GP are also given along with what indicators are used inside of the algorithms. The paper concludes that a class of GP called SFI (which simply means that they can adapt to new  situations are much more effective a predicting the market).
·         [1] presents a method of using hybrid GP and ANN agents in a manner where they are able to share information. This method proves to be significantly more effective than the traditional manner.

Neural Networks

What Is it?

Neural Networks (abbreviated as ANN) are systems for learning a pattern from a set of data and then recognizing the pattern again. This is accomplished with a structure of layers of “neurons”. Each neuron in each layer is connected to every neuron in the next layer through “synapses” that are weighted. When a signal enters the network it is converted to a value by the entry layer and then scaled by each layer and synapses it encounters on its way out of the network. When the value exits the network if it is a above a certain threshold it is interpreted as a recognition of the pattern.[8]

English example

ANNs roughly approximate how neurons work in nature. The simplest way to understand neural networks is to look at diagram of one and interact with one (insert diagram here and brain.js example from github.com).

Why Not

·         Difficult to explain
·         Difficult to implement
·         Nearly impossible to reclaim learned information
·         Difficult for ANNs to share learned information
·         Can get extremely large

WHY

·         Parallel (each neuron can have it’s own processer since it does not need to know anything about the state of the other neurons [8].)
·         The information gathered is Inductive [8] (later evidence is presented that the market is driven by inductive decisions [9]).
·         Can be quickly trained [1].

Prior research

In the research reviewed for this paper ANNs were almost always used in conjunction with GP [1], [7], [10], [11]. The research that used ANNs alone were studying the nature of different type of neural networks [12] or using ANNs to identify more useful indicators for use in other agents [13].

Dynamic Model vs. Non-Stationary Probabilistic

Dynamic model

This model of the market assumes that the market can theoretically be deterministically modeled in a manner that accounts for all of the behaviors expressed [14], [6]. A dynamic model means that the system is extremely diverse in it’s outputs relative to the variation of its inputs. Another example of a dynamic model is the weather, a very small change in climate be it temperature or pressure can have massive effects on the rest of the system (Think about the proposed effect of global warming, just a few degrees difference massive change). This model is generally used for Statistical agents.

Non-Stationary probabilistic model

This model views the market as a subjective entity,  it’s nature changes with the beliefs of the individuals [9]. This model appear here because economy is driven by humans which make subjective decisions and so it cannot be accurately predicted how they will react in the long term[9].

WHy use non-Stationary model

Humans drive the market. Subjective decisions are made constantly. When the standard (Dynamic or Simple) model is forced to take into account investors viewing the market differently they break down [9], [15].

Basis

Social Learning

The methods presented in [1] compensated for many of the downfalls of GP.
·         Having multiple agents all learning with different indicators and then sharing information the efficiency of evolution was greatly increased. [1]
·         ANNs are effective in short term situations [13]  where genetic algorithms alone are less so [7]. Combining the approaches helps compensate.
·         Each agent managing multiple indicators enables them to throw out old strategies and avoid local maxima [1], it also classifies the agents as SFI GPs which are always more effective at market prediction[7].

Argument

Problems with social learning

·         Processing time (and possibly knowledge) is wasted when ANNs are thrown away.
·         The ANNs only can have a limited view of the market because it is either dynamical or non-stationary [1], [6], [9]. This may skew the efficacy of a network
·         Only one ANN gets published at a time, the reason an agent was successful could have been do the composite effect of multiple networks.

Improvement

Composite the results of the ANNs using selective combination (only acknowledging the results of a few of the networks to help minimize the effect of failures on the group) as presented in [3], and [2] the methods presented in , and publish the group of ANNs that are used most instead of just the single most accurate ANN.
·         Enables the Agents to recognize more complex patterns
·         ANNs are not wasted are readily.
·         Combining results of ANNs has been shown to improve overall accuracy and help to avoid local minima [3].

Conclusion

Using Statistical modeling alone is not effective because while it is effective at exploiting a short term patter, it does not take the subjective nature of the market into account well and does not evolve with the changes in behavior that other agents will exhibit [9], [5].
Using ANNs alone works especially in short term predictions [13].
Using GP works [7] when the GP is able to evolve with the changes in the market. But is inherently slower than ANNs and is not parallelizable as easily (if at all) as ANNs [8].     
The use of social learning and selective combination of ANNs may result in more effective predictions. This is supported by evidence that social learning works [1], and that combining neural networks is effective [16], [2], [3]






[1]      G. Kendall, Y. Su, and G. Kendali, “Learning with imperfections - a multi-agent neural-genetic trading system with differing levels of social learning,” in Cybernetics and Intelligent Systems, 2004 IEEE Conference on, 2004, vol. 1, pp. 47-52 vol.1.
[2]      A. J. Sharkey, Combining Artificial Neural Nets: Ensemble and Modular Multi-Net Systems, 1st ed. Secaucus, NJ, USA: Springer-Verlag New York, Inc., 1999.
[3]      Z. Ahmad, C. Technology, and N. U. Tyne, “A Comparison of Different Methods for Combining Multiple Neural Networks Models,” pp. 828-833.
[4]      G. C. Calafiore, B. Monastero, and P. Torino, “Experiments on stock trading via feedback control,” in Information and Financial Engineering (ICIFE), 2010 2nd IEEE International Conference on, 2010, pp. 494-498.
[5]      J. Grossklags and C. Schmidt, “Software agents and market (in) efficiency: a human trader experiment,” Systems, Man, and Cybernetics, Part C: Applications and Reviews, IEEE Transactions on, vol. 36, no. 1, pp. 56-67, 2006.
[6]      T. Iokibe, S. Murata, and M. Koyama, “Prediction of foreign exchange rate by local fuzzy reconstruction method,” in Systems, Man and Cybernetics, 1995. Intelligent Systems for the 21st Century., IEEE International Conference on, 1995, vol. 5, pp. 4051-4054 vol.5.
[7]      M. Kampouridis, S.-H. Chen, and E. Tsang, “Investigating the effect of different GP algorithms on the non-stationary behavior of financial markets,” in Computational Intelligence for Financial Engineering and Economics (CIFEr), 2011 IEEE Symposium on, 2011, pp. 1-8.
[8]      “Introduction to artificial neural networks,” in Electronic Technology Directions to the Year 2000, 1995. Proceedings., 1995, pp. 36-62.
[9]      W. B. Arthur, “Complexity in Economic and Financial Markets,” Complexity, pp. 20-25, 1995.
[10]    G. Hai-ru, H.-ru Guo, and Z.-min Li, “A method of improving generalization ability for neural network based on genetic algorithm,” and Intelligent Systems (ICIS), 2010 IEEE, pp. 4-7, Oct. 2010.
[11]    S. Hayward, “Setting up performance surface of an artificial neural network with genetic algorithm optimization: in search of an accurate and profitable prediction of stock trading,” in Evolutionary Computation, 2004. CEC2004. Congress on, 2004, vol. 1, pp. 948-954 Vol.1.
[12]    E. W. Saad, D. V. Prokhorov, D. C. W. II, and D. C. Wunsch, “Comparative study of stock trend prediction using time delay, recurrent and probabilistic neural networks,” Neural Networks, IEEE Transactions on, vol. 9, no. 6, pp. 1456-1470, 1998.
[13]    X. Wang, P. K. H. Phua, and W. Lin, “Stock market prediction using neural networks: Does trading volume help in short-term prediction?,” in Neural Networks, 2003. Proceedings of the International Joint Conference on, 2003, vol. 4, pp. 2438-2442 vol.4.
[14]    K. S. Narendra and A. U. Levin, “Regulation of Nonlinear Dynamical Systems Using Multiple Neural Networks.”
[15]    W. B. Arthur, “Complexity and the Economy,” Science, vol. 284, no. 5411, pp. 107-109, 1999.
[16]    C.-Y. Lee and J.-J. Lee, “Adaptive Control for Uncertain Nonlinear Systems Based on Multiple Neural Networks,” IEEE Transactions on Systems, Man and Cybernetics, Part B (Cybernetics), vol. 34, no. 1, pp. 325-333, Feb. 2004.