Machine Learning, Stock Market and Chaos

Download Machine Learning, Stock Market and Chaos

Post on 21-Apr-2017



Data & Analytics

2 download

Embed Size (px)


<p>PowerPoint Presentation</p> <p>Machine Learning of Chaotic SystemsSolving Complex and Insoluble Problems via Artificial Intelligence</p> <p>By Lipa Roitman PhDNovember 1st, 2015</p> <p>1</p> <p>ContentsChaos VS RandomnessChaotic ProcessesModeling Chaos- Statistics ApproachModeling Chaos- Artificial Intelligence and Machine Learning ApproachSteps in Machine LearningFinancial Markets as Chaotic Processes</p> <p>2</p> <p>Chaos and RandomnessRandom noise No known cause, no regularity, no rationality, no repeatability, no pattern Impossible to predict</p> <p>Message:Randomness is unpredictableChaos can be predictable</p> <p>3</p> <p>Chaos VS RandomnessRandomness ExamplesPrevious coin flips do not predict the next one.Brownian motion - random walkGaussian and non-Gaussian Random (white) noise with frequency-independent power spectrumOther modes of random processes. </p> <p>How to tell Chaos from Randomness in Time Series dataExamples of random processesNone of these can be predictedFuture does no depend on the past</p> <p>4</p> <p>Stationary process: statistical properties: mean value, variance,moments, and probability distribution do not change over time.</p> <p>Stationary ergodic process: the process has constant statistical properties with time, AND its global statistical properties can be reliably derived from a long enough sample of the process.</p> <p>Chaos VS Randomness</p> <p>While the probability distribution is known, still, what comes next can not be predicted. Its completely random. Future does no depend on the past</p> <p>5</p> <p>Real life chaotic processes are neither stationary nor ergodic! </p> <p>Their statistics have to be constantly monitored since they drift with time. </p> <p>A nonparametric analysis is needed when the probability distribution of the system is not normal.</p> <p>Chaos VS Randomness</p> <p>Chaotic time series dont have fixed statistical properties. They change wit h time, sometimes abruptly..</p> <p>6</p> <p>Astronomy: Three-Body ProblemSunspotsGeology: EarthquakesOceanology: El Nio (Pacific ocean temperature) , TidesMeteorology: WeatherChaos in Natural Processes</p> <p>Fluid flow: luminary vs turbulent Candle flameQuantum chaosBiology: Population growthPhysiology: Arrhythmia, Epilepsy, DiabetisDNA codeEpidemiology: diseasesChaos in Natural Processes</p> <p>Social: fashion trendsWarsMusic and speechStock markets, etc.</p> <p>Chaos in Natural Processes</p> <p>Chaotic ProcessesChaotic Processes Three competing paradigms: Stability InstabilitySudden and Dramatic Change</p> <p>Chaotic Systems Properties11Slide </p> <p>What is the pattern?</p> <p>Stability: Persistent trends. Memory: What happens next depends on prior history. Predictable: One can predict while the pattern continues. </p> <p>Chaotic Systems PropertiesInstability - tired trend - accumulation of small random imbalances, or of slow systematic imbalances that precede large change. </p> <p>Sand pile avalanche model</p> <p>Predictability is lower</p> <p>Change: paradigm changes suddenly, seemingly without warning. often with reversal of trend </p> <p>Fat-Tail: The change could be much stronger from what is expected in the normal Gaussian distribution.</p> <p>Black Swan Events</p> <p>Chaotic Systems Properties</p> <p>Chaotic Systems PropertiesCycles of varying lengths. Periods of quiet followed by big jumpsChaotic patterns are predictable, but only in terms of probabilities. </p> <p>Measuring Chaos - Statistically</p> <p>Modeling Chaos</p> <p>Mathematical modeling of chaotic systems is difficult: Tiny changes in parameters can sometimes lead to extreme changes in the outcome.There is no certainty, only probability.Modeling Chaos</p> <p>The ubiquity of gradual trends and the rarity of the extreme events resemble the spectral density of a stochastic process, having the form</p> <p>In this 1/f noise model the magnitude of the signal (event) is inversely proportional to its frequency.</p> <p>Modeling Chaos S(f)=1/f^</p> <p>Although 1/f noise is widely present in natural and social time series, the source of such noise is not well and understood.</p> <p> 1/fnoise is an intermediate between the white noise with no correlation in time and random walk (Brownian motion) noise with no correlation between increments.</p> <p>In most real chaotic processes the random (white) frequency-independent noise overlaps the 1/f noise.</p> <p>Modeling Chaos</p> <p>In a random autoregressive process the autocorrelation functions decay exponentially</p> <p>In chaotic process, they leave a small persistent residue: long memory.Modeling Chaos</p> <p>If one looks at a chaotic process at different degrees of magnification, one finds they are similar. This self similarity brings us to a subject of fractalsSelf similarity = Power laws scale invariance fractals (Mandelbrot)Hurst exponent</p> <p>Scale Invariance</p> <p>Chaos Fractals Connection</p> <p>Modeling Chaos</p> <p>Rescaling RangeGiven a relation</p> <p>Scaling the argument x by a constant factor c causes only a proportionate scaling of the function itselfModeling Chaos</p> <p>In other words:</p> <p> Scaling by a constant c simply multiplies the original power-law relation by the constant c^{-k}. Thus Self-Similarity</p> <p>Modeling Chaos</p> <p>Power Law Signature: Logarithms of both f(x) and x, have linear relationship: straight-line on the log-log plot.Rescaled range - Theslopeof this line gives theHurst exponent, H. </p> <p>Modeling Chaos</p> <p>Hurst exponent can distinguish fractal from random time series, or find the long memory cycles</p> <p>Hurst Exponent H</p> <p>H =1/2 Random walk - Brownian motion -Normal Distribution</p> <p>H &lt; 1/2 mean revertingnegative feedback:high noisehigh fractal dimension</p> <p>Hurst exponent H</p> <p>1&gt;H&gt;1/2 Chaotic trending process: </p> <p> Positive feedback Less noise Smaller fractional dimension Fractional Brownian motion, or 1/f noise</p> <p>Hurst exponent H</p> <p>Maximal Lyapunov Exponent Maximal Lyapunov exponent (MLE) is a measure of sensitivity to initial conditions, i.e. unpredictability. Positive MLE: chaos The inverse of Lyapunov exponent: predictability: 1/MLE Large MLE: shorter half-life of signal, faster loss of predictive power. </p> <p>Maximal Lyapunov exponent (MLE) is a measure of sensitivity to initial conditions, a property of chaos Hurst exponent H is a measure of persistencyMaximal Lyapunov Exponent</p> <p>Fractal time series are good approximations of chaotic processes. They are complex systems that have similar properties.Modeling Chaos with Fractals</p> <p>Modeling Chaos with Fractals Fat-tailed probability distribution Memory Effect: Slowly decaying autocorrelation function Power spectrum of 1/f type Modeled with fractal dimension and the Hurst parameter Global or local self-similarity.</p> <p>Fractal dimension D and Hurst exponent H each characterize the local irregularity (D) and global persistence (H).</p> <p>Thus D and H are the fractal analogues of variance and mean, which are not constant in the chaotic time series. </p> <p>Fractal Dimension and Hurst Exponent</p> <p>Fractal Dimension and Hurst ExponentFor self-affine processes, the local properties are reflected in the global onesFor a self-affine surface in n-dimensional spaceD+H=n+1 D: fractal dimensionH: Hurst exponent</p> <p>Chaos and Fractals Connection Fractals have self-similar patterns at different scales. </p> <p> Fractal dimension</p> <p> Multi fractal system - continuous spectrum of exponents - singularity spectrum.</p> <p> Random shocks to the process, such as news events. The shocks can have both temporary and lasting effect</p> <p> Combination of interdependent autoregressive processes, each with its own statistical properties.Two Reasons For 1/F Noise </p> <p>Modeling Chaos: Artificial Intelligence and Machine Learning Approach</p> <p>Modeling Chaos - AI Approach</p> <p>Artificial IntelligenceMachine Learning Purpose: GeneralizationFind the laws within the dataPredicting changeNumber crunching allows finding hidden laws, not obvious to human eye</p> <p>Artificial Intelligence Types</p> <p> Rules Based AI</p> <p> Man creates the rules: Expert Systems</p> <p> The rule-based approach is time consuming and not very accurate</p> <p> Supervised learning from examples</p> <p> The examples must be representative of the entire data set.Artificial Intelligence Types</p> <p> Un-supervised learning</p> <p> Classification: clustering</p> <p>Artificial Intelligence Types</p> <p>Deep learning</p> <p>Deep learningmodels high-level abstractions in data by using multiple processing layers with complex structures.Artificial Intelligence Types</p> <p> Deep learning can automatically select the features For a simple machine learning, a human has to tell the algorithm which combination of features to consider</p> <p> Deep learning finds the relationships on its own</p> <p> No human involvement</p> <p>Artificial Intelligence Types</p> <p> Ultra Deep Learning</p> <p>Machine has learned so much, it can not only derive the rules, but detect when the rules change: detect the change in paradigms.</p> <p> Combines the supervised, un-supervised types and rule based machine learning into a more intelligent system.</p> <p>Artificial Intelligence Types</p> <p>Steps in Machine LearningProvide FrameworkMathematical and Programming Tools</p> <p> Data preparation </p> <p> Parameters estimation</p> <p> Give examples to learn from: the input (and in some methods the output)</p> <p>Steps in Machine LearningCreating a Model (or Models).Fitness Function: What to optimize?Example: Make more good predictions than bad ones. </p> <p>Data Preparation </p> <p>Data preparationConvert the generally non-stationary data into more-or-less stationaryRemove the cycles, trends to reduce the uniqueness of each data point</p> <p>Parameters EstimationParametric OR Nonparametric?Parametric model:fixed number of parametersNonparametric: no assumptions about theprobability distributionsof the variables. In non-parametric modelthe number of parameters increases with the amount of training data.</p> <p>Creating a ModelAll Models are Wrong, Some Models are Useful George E. P. Box</p> <p>Multivariate time series Multivariate time series modeling is required when the outcome of one process depends on other processes. </p> <p> Examples are systems of interdependent global and local processes, asset prices, exchange rates, interest rates, and other variables. </p> <p>Multivariate time seriesTo create a model one could use the available knowledge about interrelationship of the processes, and combine it with unknowns in one or more of the linear or non-linear models. The fitness or error function is then created, which compares the model with the data. </p> <p>Machine LearningThe fitness function is improved through machine learning by varying the parameters in the model. The goal is to maximize the fitness of the model to the data presented for learning (minimize the error). Different models are screenedPart of the data is saved from the learning cycle to be used for testing.The successful model should be able to perform adequately on the test data. </p> <p>Dimensionality Reduction</p> <p>Dimensionality reduction </p> <p>Speeds up algorithm executionImproves performanceThe less variables the better is generality</p> <p> Principal Component Analysis is one of the methods of dimensionality reduction.</p> <p> Orthogonally transforms the original data set into a new set of principal componentsDimensionality Reduction Methods</p> <p>Methods:Low Variance Filter. High Correlation Filter. Pruning the network.Adding and replacing inputs.Other methods.</p> <p>Dimensionality Reduction Methods</p> <p>Clustering The many examples in the data can be compressed into clusters according to the similarity through fitting to one or more criteria.Each data member that belongs to a cluster is associated with a number from 0 to 1 that shows the degree of belonging. Each data member can also belong to multiple clusters with each specific degree of belonging.Clustering can be a goal in itself, or a part of a general model, that includes the behavior of clusters as a whole. </p> <p>Time ConstraintA programmer knows the value of everything, but the cost of nothing. -- Alan J. Perlis</p> <p>Time ConstraintSome problems are insoluble or too complex to be completely solved in reasonable time.Compromises are necessary, e.g. speed vs precision vs generalityTime complexity (big O notation) of an algorithm quantifies the amount of time taken by an algorithm to run as a function of the length of the string representing the input.</p> <p>Time Complexity (Big O Notation)</p> <p>Choice of AlgorithmWhich Algorithm?</p> <p> Depends on the task</p> <p> Depends on time available</p> <p> Depends on the precision required</p> <p>Local and Global</p> <p>Uphill SearchingDownhill Gradient Searching</p> <p>Local Search AlgorithmsLocal search methods: steepest descent or best-first criterion, stochastic search. simulated annealing, genetic selectionothers</p> <p> A randommovealtering the state Assess thefitnessof the new state Compare the fitness to the previous state Decide whether to accept the new solution or reject it. Repeat until you have converged on an acceptable answer</p> <p>Simulated Annealing</p> <p>Global Search AlgorithmsStochastic optimizationUphill searchingBasin hopping</p> <p> and Global Minimum</p> <p>Basin Hopping The algorithm is iterative with each cycle composed of the following features</p> <p> Random perturbation of the coordinates</p> <p> Local minimization</p> <p>Accept or reject the new coordinates based on the minimized function value</p> <p>Genetic AlgorithmsMany solutions are in the pool, some good, some not so.Each solution is analogous to a chromosome in genetics</p> <p>Genetic AlgorithmsWays to improve gene pool: Combination:Combine two or more solutions in hope of producing a better solution.Mutation: -Modify a solution in random places in hope of producing a better solution.Crossover: Import a solution from a similar problemSelection: Survival of the fittest</p> <p>68Bain-Template</p> <p>Gene Pool</p> <p>Reproduce</p> <p>Mutate</p> <p>Select</p> <p>Reject</p> <p>CrossoverGenetic Algorithm</p> <p>68</p> <p>I Know First Predictive AlgorithmMost financial time series exhibit classical chaotic behavior. The chaos theory, the classification and predictive capabilities of the machine learning has been applied to forecasting of such time series. </p> <p>This artificial intelligence approach is in the root of I Know First predictive algorithm. </p> <p>I Know First Predictive Algorithm</p> <p> The following slides are the method and the results of applying the algorithm to learn the database of historical time series data. </p> <p>The I Know First AlgorithmThe results are constantly improving as the algorithm learns from its successes and failures</p> <p>Tracks and predicts the flow of money from one market or investment channel to another The system is a predictive model based on Artificial Intelligence, Machine Learning, and incorporates elements of Artificial Neural Networks and Genetic AlgorithmsTracks the flow of money Artificial Intelligence (AI) Machine Learning (ML) Artificial Neural NetworksGenetic AlgorithmsI Know Firstpredicts 2000 Markets Eeveryday</p> <p>Synopsis of the Algori...</p>