Quantcast aiQUANT » Artificial Intelligence

Archive for the 'Artificial Intelligence' Category

Thoughts on GAs and the like

Artificial Intelligence 8 Comments »

Every once in a while I receive an email from someone somewhere asking me how to develop killer Genetic Algorithm trading model. I find there is a some confusion surrounding the GA, NNs and the like so in this post I wish to clear misconceptions that may lead one to believe that Evolutionary Algorithms will give answers straight away.

  • Lets be clear about it, Genetic Algorithms may sound sexy but under certain cases they are no silver bullet. I say this based experience from applying them to solve different kinds of problems. Under such cases it is not the optimization algorithm which fails you - its a simple case that there is no good solution to the problem at all.
  • You cannot use the GA or its derivatives directly to predict the market, but rather you use it to optimize a pre-defined, or nearly defined model in order to improve its performance. In other words one aims to find the best parameters to the model, and it’s the emerging model which goes about doing the predicting or trading and not the GA itself.
  • On training Neural nets you want to be careful not to use a local search algorithm e.g. the Back propagation algorithm, but rather a global search mechanism such as swarm, simulated annealing, the GA or its derivatives. The reasoning behind this is that local search algorithms will converge to any minimum (which may be local or global). A global search algorithms on the other hand will have a near accurate view of the optimization surface and as a result are more likely to converge to global solutions.
  • Neural Nets have received some bad press about over fitting problems. There are a number of ways of dealing with this, the most notable one being filtering. If the data you are fitting to is clean then your solution will not over fit. If your data is noisy then filtering the noise will ensure that over fitting does not occur.

If there are good solutions to find, then Evolutionary Algorithms are good at discovering these solutions, but if there are no good solutions (which may be an inherent characteristic of the problem), then it is impossible for Evolutionary Algorithm to discover any. The message to take away from here is that one should focus on problems where there is a strong likelihood of something to be discovered, rather than believe that a solution will be discovered out of the blue for any arbitrary problem.

Forecasting via Genetic Algorithm: Part 5

Evolutionary Computation, Genetic Algorithm, Matlab No Comments »

Part 5: Programming Issues

I wrote code for the Genetic Algorithm in MATLAB and it is terribly slow.  A run for 50 Generations averages to about 1 second per generation.  Here are some performance measures obtained using Matlab Profiler:

prof1.png

The FitnessFunction function is the biggest culprit and takes almost 100% of the total simulation time.  Evaluation of the fitness function is the most time consuming part in the Genetic Algorithm.  This is generally the case even with simpler fitness functions because on a relative scale, operators such as crossover and mutation require very little algebraic manipulation.  Looking at the function itself we get more detail:

prof2.png

We find that evaluations for alpha and beta take the most time.  I shall attempt to speed up the algorithm by writing a MEX function.  In doing so we expect the simulation time to drop by many orders of magnitude as compiled MEX code would not need to run under Matlab’s interpreted mode.

Support vector machine + Evolutionary Algorithm = ?

Evolutionary Computation, Support Vector Machines No Comments »

Cao, L., Francis, E. (2003) Support Vector Machines with Adaptive Parameters in Financial Timeseries forecasting, IEEE Transactions on Neural Networks, 14(6):1506:1518

svmPaper.PNG

Now here is a point of thought:  Support vector machines + Evolutionary Algorithms = ? 

On the surface, it appears that support vector machines beat neural networks in terms of maintaining generality on both in-sample and out of sample data when applied to forecasting.  But the problem is deciding what kernel function to use for a particular forecasting task using support vectors?  This problem in some ways is analogous to the choice of connectionist structure to use for a neural network.  Perhaps some kind of evolutionary algorithm can be applied to determine the best kernel function, given a population of kernel functions.  This might be an idea for an upcoming paper.

Close
E-mail It