 Good morning everyone. I would like to welcome you from my side as well. My name is Markus Vogel, founder of Markus Vogel Business and Data Science, and today I'm going to talk with you about financial time series analysis using wavelets. It is worth to mention that this presentation is given in cooperation with the University of Applied Sciences in Aschaffenberg, especially the behavioral accounting and finance lab, which I, as a VHD candidate, am also a part of. To begin, I will present the content of this presentation. First, we will talk about financial time series. What are financial time series? What do they look like? On what properties do they have? Second, we will delve into abroad and very complex topic, namely signal analysis, especially the topics for analysis and wavelets. Once we conclude it, I will grant you an outlook into our current research topics, namely wavelet neural networks. To get you into the topic, it is worth mentioning that I have chosen a graphical approach which is used throughout the presentation. To start, I will present you the two datasets which will be used during the presentation. On the right hand side, you will see a financial time series, namely the Apple stock price series, denoted on a daily basis in US dollars during the time period of 2000 till today. In straight contrast, on the left hand side, you will see a stochastic process realization, which is based upon the descriptive characteristics of the Apple stock price series, namely a random walk realization. Random walks are used in financial and risk modeling, banking supervision models, and in most attempts to model some kind of randomness into your data. If we briefly compare these two graphs, they look quite similar. Together deeper insights, we, as financial analysts, are interested in the rates of change, meaning how our stock develops over time. To take a look at the rates of change, we have calculated the daily logarithmic returns of our two time series. On the right hand side, you will see the Apple return series, which clearly shows clusters in the data. If you look at the year 2001, you will see the dot com bubble, and at the year 2008 and 2009, you will see the great financial crisis, both indicated by huge negative returns. Again, in straight contrast, if you will look at the left hand side, you will see the returns of our random walk realization. Compared against each other, one clearly sees that the negative and positive returns of the random walk do not show clusters in time and are almost equally distributed. This is simply due to the nature of a random walk. Since we now know how our time series looks like, it is time to display some properties of financial time series. To introduce you to the world of financial time series properties, I have divided them into two categories. At first, we will take a look at the classical assumptions, which are inherent in many models used in practical applications. Classical assumptions are stationarity, linearity, marketing goal, as well as mark of properties and independency. This means in short that whatever happened yesterday has absolutely no impact on the development of today. Yesterday apocalypse, today sunshine, it does not matter. To go on, it is assumed that returns do not appear trends and are normally distributed. Again, yesterday does not matter for today, returns do not follow trends and follow a normal distribution instead. On top of that, it is believed that markets are efficient. Market efficiency in a natural means that all available information today is already reflected by market prices and one cannot beat the market. To continue, we will now take a look at current research results. It was found out that in straight contrast to the classics, there is no stationarity, linearity, and independency in financial time series. This means yesterday does matter for today and it matters different every day and in a non-linear fashion. The next results have been shown by us on another cooperation partner, namely the Mandelbrot Asset Management GMBH in Erlangen. We have shown via experiment using wavelet transformations and first exponents that financial markets data follows fractal patterns, beer trends, and display momentum effects. These trends can be measured using a special wavelet decomposition scheme developed by our cooperation partner. Additionally, we have shown the trends follow a lognormal distribution. This leads to only one conclusion, namely that efficient markets do not exist. We have gathered a brief insight into the nature of financial time series and it is now time to delve into a broad and complex topic taken out of physics, namely into signal analysis. We will talk about two selected concepts, the Fourier analysis and wavelets. At first, we will start talking about Fourier analysis. What is Fourier analysis? Fourier analysis is a transformation of a raw signal denoted in time domain like our Apple and random walk time series into a process signal which is denoted in frequency domain in order to obtain frequency information. Why are we interested in frequency information? In general, high frequencies equal rapid changes and vice versa. We have a lot of rapid changes in our time series, so we seek to find out whether or not financial time series contain frequency information. We do so by using the Fourier transformation to decompose a given signal into its frequency components. Fourier analysis or Fourier transformations answers the question what frequency components exist in a given signal? Only drawback we need to deal with is the stationarity requirement of the Fourier transformation. We will get back to this problem later. To take our first step into frequency analysis, we will start with a standard periodic signal and take a look at its frequency decomposition obtained using the Fourier transformation. Fourier transformation is the decomposition of our signal into frequency components using a linear combination of sine and cosine waves which are both continuous. If we take a look at the left hand side, we will see a graphical representation of a periodic signal and time domain which is repeated at infinitum. We now want to know which frequency components this signal consists of. On the right hand side, one can see the frequency representation of the signal denoted in the frequency domain. Like stated at the beginning, we now have obtained the answer to the question what frequency components exist in our signal. For example, we see a 35 hertz frequency, hertz means cycle per period, with an amplitude of 3 in our signal. So, we obtain frequency information. This is great, so we can stop now. We have all we want, right? No, not quite. We learned earlier that financial time series are not stationary, which means Fourier transformation is not applicable. To clarify the issue of non-periodicity or non-stationarity, we will take a look at a classical example of a non-periodic signal, namely the chirp signal. Take a look at the left hand side, where the time domain representation of the chirp signal is depicted. One can clearly see that it is changing rapidly over time. Let us take a look at the right hand side at the frequency representation of the chirp signal. What we discover is not quite pleasant. If applying a Fourier transformation on a non-periodic signal, it literally goes nuts. The frequency components change all the time and are not stable in the signal. Therefore, we cannot work with this kind of decomposition and its information. If you reconsider and assume the classical assumptions of our financial time series to be valid, the time series would likely be periodic and we would obtain frequency information about them using Fourier transformation. But let us take a closer look first. At first, we will take a look at a real world stock price signal, namely the Apple stock price series depicted on the left hand side and decompose it using a Fourier transformation shown at the right hand side. What we will discover are two major aspects. First inside, price series are not periodic. Second inside, price series do not contain frequency information. So, we know two things. Price series and frequency analysis do not match. Anti-classical assumptions do not hold for prices. Since we do not get what we want, why continue anyway? Stop! Before taking the loss and expose ourselves to the critic of efficiency believers, we will consider our stock return series first. In straight contrast to our price series, one can discover that return series show frequency information. That is great, right? We are done now. We get the frequency information. Wrong. If we take a closer look at the frequency spectrum of a return series of a financial instrument, we see that like with the chirp signal, the frequencies are changing anytime. This means twofold. First, return series contain frequency information. Second, return series are not stationary. Therefore, the classical assumptions do not hold and the latest research is probably correct. Before going on, let us reconsider the insight so far. We now take a step back and look at some insights taken out of signal theory. In general, on an abstract level, we take a look again at our signal representations. On the left hand side, one can find the so-called time domain representation. This means for every well-defined point in time a given value exists. In short, a point in time is represented by a value. Therefore, we have an excellent resolution in time, hence no frequency information. Most time series data, like our Apple time series, are represented in time domain. In contrast, if we take a look at the right hand side, the frequency domain is presented. In frequency domain, we see which frequency is existent in a given signal, but we do not know when the frequency occurs. Therefore, we have an excellent frequency resolution, but no time information. Let us reconsider both sides. Perfect time resolution leads to no frequency information. Perfect frequency resolution leads to no time information. But we want to have both. What can we do to resolve this issue? Can we bring together both worlds? The answer is yes, we can, non-attended. We can combine both worlds into a new concept, namely the short-time Fourier transformation. Here is how it works. We know that financial return time series bear frequency information, but the signal is non-periodic. Also, we know that Fourier transformation requires stationarity. How do we get past this issue? We simply assume that if we chop the signal into tiny pieces, these pieces, or so-called windows, are stationary if they are small enough. If the pieces are stationary, we can compose it to obtain the frequencies like we can do it with a periodic signal. On top of that, since we know the length of the chopped pieces, we can exploit information about time location since we take out a period of time of our overall signal. We know the position of the period and get the frequency information for that given window size. That's fantastic, right? We obtain a resolution of our signal in a matter of a linear time frequency representation. No, again, not quite. We have to challenge two issues hands-on while using this approach. First, if the window sizes are too broad, we might violate the stationarity assumption, and the transformation goes off again, so we must keep the sizes small. If, on the other hand, the window sizes are too small, we will lose all frequency information due to a concept in physics which cannot be resolved, namely the Heisenberg Uncertainty Principle. It states that, the more precisely the position of some particle is determined, the less precisely its momentum can be known and vice versa. Mathematically, in wave mechanics, the uncertainty relation between position and momentum arises because the expression of the wave function into two corresponding orthonormal bases in Hilbert space are fully transformations of each other. But before we drift too much into theoretical concepts, we will take a look again at our real-world data. What happens if we apply a short time fully transformation on the price and respective return series of our Apple stock? Let us take a look at the left-hand side, referring to the prices first. What we see is some kind of action, but not really anything useful. Like stated before, price series do not deal frequency information and of story. In contrast, if we consider the returns on the right-hand side, we see there is frequency information. Well, we see frequency information, but we do not get a representation we can grief information from. We see there are two yellow bars responding to frequency, but it seems like the short time fully transformation is not as well suited for our purposes as we have wished for. So, why did he present us all these concepts if they were not valid to use from the beginning? We will now in a second. We are going to sum up the knowledge acquired so far first. We have learned that a fully transformation can be represented via basic functions in linear combinations to compose a signal to obtain frequency information. We have learned that its extension to short time fully transformation cuts the signal into equal pieces which refer to a constant window size and assumes them to be stationary. Therefore, we obtain a decomposition and a constant resolution since we know the window sizes referring to the localization in time domain. We will now introduce a new concept as alternative to the short time fully transformation. This concept is called wavelet transformation and is part of a huge complex of possibilities and applications, namely the multi resolution analysis. One can divide wavelet transformations into discrete and continuous transformations. wavelet transformations can be seen as a measure of resemblance. In case of continuous wavelet transformation, the coefficients refer to the closeness of a given signal and a wavelet at a given scale. The continuous wavelet transformation can therefore be seen as inner product of a signal with a mother wavelet as basic function. Hugh, sounds cryptic. Let us put some light into the formalism and visualize some wavelets. Take a look. The first row corresponds to discrete wavelet functions, the second row to continuous ones. Please take a moment to briefly look at the function plots. Okay, what do we see? We see little wavelet functions which are locally bounded and have some funny names. The name wavelets origins from the French word angolet and means little wave. So, what are they used for anyway? How do they work? We simply take our wavelet and shift it through our signal to see how close they are, romantic, right? If you take a look at the left hand picture, you will find a wavelet which is in the first step shifted through the signal. The closeness of the signal to our wavelet is represented by the coefficients which are the result of the inner product calculation. The first insight we may find is wavelets are finite. They have a starting and an end point, which means they are localized in time. So, in a nutshell, we can measure the closeness of a given signal with a wavelet function which is localized in time. After we shifted the wavelet through the whole signal, we stretch it. And for example, we stretch it to double the size like depicted in the graphic. And now, repeat, we shift it again. Why are we doing this? What is it for? Several questions have come up until this point. Why did we present foie in short time transformation if they were not valid to use from the beginning? What are wavelets used for? Why are we doing all of this anyway? Before answering, let us sum up two core concepts of wavelets, translation and scaling. Translation means shifting our wavelets through the signal to obtain time information. Scaling means dilating or compressing the wavelet to obtain frequency information. Therefore, high frequencies resemble low scales in terms of wavelets and lead to good time and bad frequency resolution. And low frequencies resemble high scales, which means bad time and good frequency resolution. This is represented at a theoretical level on the right hand side. Wait, in straight contrast to our short time foie transformation, the window sizes are not constant. We basically change window sizes to get our different information about time and frequency representations. To understand this, we first had to take a look at the short time foie transformation with a constant resolution. Using wavelets, we obtain both good time and frequency information with respect to the Heisenberg uncertainty principle, which cannot be avoided. Take a look. Low frequencies resemble high scales, means we get a lot of frequency information. If we take a look at high frequencies and low scales, we obtain no frequency information anymore, but time information. We trade time for frequency information. It is not an issue at high frequencies to lose the frequency information because we already obtained it at low frequencies. We get both. This is awesome news before getting too excited. Let us take a look again at our real-world data and see whether it works out or not. For demonstration purposes, we'll start with the Apple price series again using a Shannon wavelet. UI axis represents the scales from low, which corresponds to high frequencies indicating time information, to high, which means low frequencies indicating frequency information. The x-axis represents time denoted in daily steps. In short, we will look at a continuous wavelet transformation coefficient matrix, which consists of 256 rows, representing the scales, and almost 5,000 columns representing the days. Each day is represented by one price in our time series. Each price is therefore considered under 256 scales. Since looking at so many numbers is unsightly and doesn't give us greater insight, we use the Python mudplot lip package to produce a color map presentation of our wavelet transformation. Like stated in the beginning, we use a graphical approach. What do we see? Basically again, not very much. Prices do not have frequency information. We just see the stock price is rising, nothing more. Instead, let us take a look again at our return series. We have calculated the power spectrum of the return series of Apple using the Morley wavelet. And what do we see? A lot. We get a lot of information, especially take a look at the big white stripes at the beginning and in the middle of the picture. You can see in time localization at the top that these are the .com and in accordance with the financial crisis. But why being excited, you may think, looking at the return plots also showed us the crisis. It's because we see the development on different scales. Our cooperation partner is able to decompose a time series using wavelets and represent a signal via trends, which are measured, for example, in days at a different slope for each single scale. We can gather huge amounts of information from that. We have learned that financial markets that are consists of trends and follows fractal patterns. What our research endeavor would be is to validate whether one can use this framework to better forecast stocks. If you look at the middle white stripe, one can see the short time period before the outbreak of the crisis. Can we gather enough information to at least anticipate such crashes? Next, in comparison to real-world data, we will take a look at our random walks again, which are used in almost all banking and risk models. Boom, dark. It's like putting the oven out, no light anymore. What do we see in comparison with the bright real-world data realization? Basically, nothing. We only gather one big insight. Random walk processes do not appear frequency information. Take a look again at the real-world data. This is what we should model, and this is what we model it with. We can clearly see the discrepancies and the room for improvement. With this, the continuous wavelet transformation is concluded, and we are going to take a short detour into discrete wavelet transformations. In comparison to continuous wavelet transformation, the discrete wavelet transformation follows a little different approach. We'll just scratch on the surface and do not delve into this topic too much during this presentation. Discrete wavelet transformation can be seen as a cascade or so-called levels of high-pass and low-pass filters. We take a signal and divide it using these filters. For example, take a 1000 Hz signal, which leads to a 0 to 500 Hz low-pass filter and a 500 to 2000 Hz high-pass filter. We then take the 0 to 500 Hz formal low-pass filter and split it again. This results in a 0 to 250 Hz low-pass filter in the second level and a 250 to 500 Hz high-pass filter in the second level, and so on. We obtain approximation and detail coefficients in the process. It is worth to mention that one can reconstruct the original signal using the coefficients of either the Fourier and wavelet transformation. Special with discrete wavelet transformation is the fact that one can use linear interpolation algorithms to reconstruct a signal using less information than originally delivered by the signal without losing any important details. To choose the right rate, one can use the Nyquist rule, which calculates the minimum data to use for reconstruction of the signal without losing any information. This is a huge bonus in terms of image processing and computational speed. With this, we conclude the part about signal analysis and, like promised, I will now give you an outlook into our research. What are our current research endeavors? Like stated before, we would like to use the wavelet transformations to create forecasting models used on financial time series, since we have learned they contain frequency information. We also would like to utilize not only one time series, but to delve into big data and neural networks in terms of our machine learning solution. We would like to combine both approaches. The computational and prognostic power of machine learning algorithms with the time frequency representations of our wavelet transformations. This topic is part of a research master's thesis of one of our students who I am responsible for. If you take a look at the left-hand upper side picture, one can find an example representation of a neural network with one hidden layer. We use our signal as input, decomposing it using so-called wavelones. This means instead of classical activation functions, like the sigmoid function, we use a mutter wavelet function to obtain a linear combination as the output. What else can we use this approach for, and what has been done in this area so far? You can use this approach for missing data reconstruction, enhance predictions, like stated above, predictions of chaotic time series, which is part of my VHD thesis to evaluate whether financial markets are chaotic or not, and you can use it to reduce nonlinear noise in a given signal. With this, our presentation is concluded and at its end. I would like to thank you and are now open for any questions. If any questions stay unanswered or you have some insights to share, please feel free to contact us any time. Thank you very much.