 Vse je nap BlackTheserones in Triestev. Before that, I wanted to start with a recap from yesterday. I'll try to be slower. I got this feedback that I should be a bit slower in speaking. I'll try that, but if I do not succeed, just tell me again. So, just understand what we were discussing yesterday. By the way, Erika sent you the slides. Hopefully. In zelo izmin homespunje, če ga jo bliz našem, in zelo postane tudi, nekaj ma zelo našem ne več. Nje nožno, da je, in sodaj je, da je mislilo, ki se geni apposti v nekaj nekaj. Samo odrata je. In samo ko je obžešim. Ko bi mlistite zvrfa, vzelo, če zelo našem, nekaj, da je nekaj. In so, there was, there were, I think, many slightly new subjects. So there was a lot of discussion about what markets are and MKT will stand for markets. So what markets are, who are the actors in markets, why they exist, all these. And there was also a long discussion, of course, about what is economics and what is econophysics. And just to make clear, I mean, this was to introduce things, it was for a general culture. So what I think is that it's, these are important ideas and it's to read about and to understand why we are discussing here things and I'm happy to chat about them, but these are not things that you have to study and you don't have to come to an exam discussing why markets are important. So this is, just to make clear, there was the point of, we had an overview of different products, preview of products, now then, there again, I mean, I don't expect you to answer to an exam to questions of what the details of options are, exactly what the payoff looks like, but I think that's more important for, apart from general culture, also to understand the dynamics. So I will discuss in the future, so in the next lecture, it's important to know what these products are, to be able to think about the results that we see. And then there were some things, which were, which are more, which were essentially quite basic in time series analysis, but things that we will really use explicitly. So they are just to make clear. So the main thing, I think, was to discuss variograms. Is it legible, readable, if you write not with capital letters? So variograms and what we call the signature plots, where, so variogram is simply the looking at the second moment of the changes in the time series, so what we defined, so for a time series x, you look at the changes on a time scale tau, and you look at the second moment of the second, you look at the expectation of the square, we called it variogram or variance, if it was defined, which we discussed a bit in detail, and what was important, so this is the first part, and signature plot is, as I said, I don't know why, actually it's called like this, maybe someone knows, but it's the v tau over tau function. Simply how did this variance increases with the time scale, normalized by the time scale, why do you know best by the time scale? It's easier to visualize, for, as we discussed, for a normal diffusion, you expect this guy to increase linearly in time, so if you divide by tau, you will have a flat line, and about these things that we will explicitly look at in this lecture, so as I said, you can also look at correlation, but this is a good way to try to understand if a process is diffusive, or sub diffusive, or super diffusive, so what we discussed yesterday is if this signature plot v tau over tau, for a diffusive process you expect it to be flat, as function of tau, of course, and for a super diffusive, so a trending process, a positive correlation in sequential steps, you expect some increasing behavior, and for mere reverting process, sub diffusive, you expect some decreasing behavior, so this is sub diffusive, this is super. On timescales, typically for actual time series, you will have some time dependence of this v tau over tau for a given time scale, and it will flatten out eventually, because all correlations normally after sometimes can die, but it's just in practice, so this was discussed, and as I said, but just to repeat, so essentially super diffusion is a sign that there are positive correlations in sequential test steps, and sub diffusion is that there are negative correlations in mere reversion, so this is just to summarize from yesterday, I hope it was clear, and we lost five minutes now, but maybe it's better to do that. So I wanted to, there were two things I wanted to discuss yesterday before getting to new questions, so things which surely you all know, but it's good to write them up once, and we'll use them later. So one is about discussing in general, so we looked at random variables, and we looked at typically the second moment of the distribution, but sometimes you want to look at the entire distribution, and one thing that is important is to look at the sums of random variables, which we'll do sometimes, so I'm introducing things that I hope you know, but so let's say that you have x1 and x2, so capital x1 and capital x2, which are independent random variables, and with each having a distribution, so x1 will have some p1, x1 distribution, and p2, x2, so the probability that capital x1 takes value small x1 will be this probability, so this is the distribution, and what we can be interested in, we know these two distributions, but what we can be interested in is that we take a third random variable, let's call it simply capital X, which will be the sum of these two, which happens often, so of course here we are talking about random variables, so it's one with, so summing random variables, but essentially if you have a time series, so a stochastic process with random changes, then of course changing the time scale on which you are looking at some change is similar to this, so the change in a large window will be the sum of the changes in the smaller windows, so it's the same problem, so if you have a random variable, which is the sum of these two random variables, you want to be interested probably in its distribution, and naturally what you know, it will be the joint probability distribution of, well, the probability that this X takes a value X, or in a small window around this, will be, it will be the joint distribution of two things, of one that the first variable takes sum value, let's call it X1, and that the second variable takes a value, which in order to sum to X, will be X minus X1, so these two probabilities, just be two in our definition, and of course you want to look at all the possible realizations, so what you have is an integral over all, sorry, this side I call the X1 something else, so let's call this X prime here, so it could be the X prime, so what you, I hope it's clear what I'm doing here, it's, you look at the two probabilities, and you scan the X, and what you, this has a name, it's not just, I'm avoiding to say the name, but this we call convolution, this what we see here, so the distribution of the sum of two random variables will be the convolution of the distributions, and of course what I discuss here is for two variables, but we can, it can be written up for any number of random variables, you will have much more terms in this, in this, in the convolution, so in the integral, why this is, so this, okay, this is the general rule, I mean I guess you all studied this, and what is, and what is important is that, is that as you know that there are distributions which are stable, what this holds here, under the, stable under convolution, so probability distributions, that the sum of the, so if they have the same distribution, the variables have the same distribution, then the sum of these variables will have the same distribution as well, this is only valid for, these are called stable distribution, and these are, is valid only for the, for two distributions, well, it's a family of distributions which are the levy distribution, which we won't discuss now in detail, with a certain power, parallel, tail dependence, and the other one, which I guess you know well, is the Gaussian, Gaussian, I mean everyone knows the Gaussian, so what the Gaussian is, what is using really the space I'm using in a bad way, so what the Gaussian is is the following, where I can mistake, so it's a well-known distribution I think, so this is a variance sigma squared, and then average mu, of course one can, so mu usually, you take it to zero, you hope that you deem in your time series, but this is the general way of writing. One thing that I wanted to say about, about why this, well, this convolution will be interesting for two things, so sums of random variables will be interested for two things, one is that, no, let's get to directly to the second one, so to, because, okay, I think you discussed scale invariance in detail in the other courses in this, right, okay, so. So there are these distributions, which are stable under convolution, but it's a bit more than this, because Gaussian is a special distribution, that there are many other distributions, which if you sum the variables under convolution, go to a Gaussian, which is called the central limit theorem, which I'm sure that you studied, and I want to just recall this a bit for, to discuss it in a way that it might be, that will be important for us, so, so the central theorem, which is, okay, which is in the classical formulation, let's start with this, you have some xi variables, which are i, i, d, so identically and independently distributed, and that we don't know how it is for the moment, and you define their sum, so you define some s, n, which will be the sum of n of these variables, and what the traditional way, what the central limit theorem says, is that the following variable, so if you take this s, n, you deemine it, and you normalize it by its variance term square root of n, so by the typical variations, so, okay, let's call this variable, is distributed in the following way, so this you have just seen, so it's distributed in this way, if n goes to infinity, so what it means, this we have just seen in this distribution there, so it means that the central region of this distribution, so which is defined by this, the central region will be more and more Gaussian of this variable, if in two cases, so one is written here, if n goes to infinity, center, if n goes to infinity, but another thing that is important in this case, which probably you know, is that n, if n goes to infinity, and sigma is finite, so the second moment of the distribution is finite, otherwise you cannot really write this up, so this is the traditional way to talk about the central limit theorem, this is known, right? What I wanted to discuss a bit in more in detail here is, okay, so how much this IID, what does it really mean, because IID is super nice to say that you have IID data, so identically and independently distributed data, but if you have real actual data, you cannot really know this, and normally nothing is really independent, so I wanted to just quickly review these, so when is this true? Traditionally what you say is one is that, that x i are identical, identically distributed, but it's not really true, so what you actually expect is that they are similarly distributed. No, sorry, this is 2 pi, sorry, sorry, I mean, right, sigma, exactly. No, this is a square root. It is the square root of the number of points times the sigma. No, this is the total variance of this on SN, so sigma is the variance of a single point, the variance of n, the sum of n points will be square root of n. Typical fluctuation. This. So the probability, the probability that this, so this is a number here. SN is the sum of n variables. You can take off the mean and normalize it, and so the probability that it is between two numbers a and b will be this Gaussian integral between a and b. Yes. I mean, we don't say. No, so, okay, so this probability, we didn't, okay, here what we only say is that this probability, which is also the probability that this guy is between a and b, is given by this. We don't yet say about anything, about this probability, but what we have just seen before is that the probability of the distribution of the sum will be a convolution of the, of each probability. Sorry, of each, it will be a convolution of each distribution, of the distributions. So what, actually what you see here is that no matter what the distribution of this is, apart from well behaving second moment, after convolution it will go to a Gaussian distribution. So this is what the central answer is. Yes. Yes, but we didn't specify here what we said about these probabilities here, so we didn't even write up each probability, is that they have a finite second moment and that they are IID. So which means that what we saw for the sum of random variables that under convolution there are some stable laws, so if each variable is distributed in a Gaussian distribution, normal distributed, the convolution will be also normal distributed, so this is the table, but it's also somehow a basin of attraction, so there are many other distributions of which the convolution goes to the Gaussian. The product, in a Fourier space it would be product, but it's the convolution. So we said that they need to be identically distributed if you read the theory, but what it actually means that what you want is you want somehow similar variances. I'm vague here, but so what you want is that the different xi, even if they are not identically distributed, there is no one variance which dominates above the others. They are somehow comparable to variances. It's a bit vague to say like this, but I think it's clear. The other point which is important so what other i we said here is we say that xi are independent, which is again not really true, but what you want is that they are not too much correlated and we will see in a second that they are not too much correlated. So let's... OK, what does this guy really mean here? What we say here is that you can... So you have these xi random variables and you can define, as we said yesterday, you can define a correlation i minus j which will be x squared. So this is cij and let's assume for simplicity that ci minus j is this. So there is no... So there is essentially time reversal independence. So the correlation between i minus j is the same as the correlation between j minus i. So if you have a process like this, you can write up the variance. So let's say that you look at the variance of sn squared, so you look at... So you look at this expectation, so sn is the sum of these variables, sum of n of these variables, which can be... Which will be simply the sum of these... So if you put this inside, it will be just the sum of these correlations, which, very similarly to how yesterday we wrote up some things, if you write this up, there will be n terms which behave as sigma squared. This is a sigma, which will be the cases when i is equal to j, and there will be other terms who will be like this. So it's what we're doing, simply summing these correlations. One can write it up. I think it's... There is... Writing up the sum is not hard. But what the... So what the message of this is, so what does this really mean? You see that here you have some l terms that you are summing, and l terms times cl. So what one can learn from this is that if cl decays 1 over l, so if the correlation with leg will decay faster than 1 over l, then this guy here actually will go to a constant, so the second term, sorry, so the second term will be a constant. This sum. And then you can say that indeed Sn square will be proportional to n, which is exactly what the central limit theorem says that it holds. So what we can learn from this is that, yes, officially we say x i have to be independent, but the truth is that we want them not to be too much correlated, and not to be too much correlated means that the correlation decays faster than 1 over l. So you can have correlations and still the central limit theorem should hold. And the third thing that I wanted to say this was 1, this was 2, and this was 3, that everything here is... So all information we have is about the center of the distribution. So we do not know what we can say that for finite n, of course, that the center of the distribution is going to a Gaussian, but it is not going to be much about the tails. Well, it is written here, but it is to be kept in mind because with actual data it is very hard to... you never have infinite number of points. So I think... I hope this is... Yeah. Sometimes I am doing short... So all information that we have is about the center of the distribution. So this is essentially what you have here in infinity. Then you can... For the entire distribution you will be able to write up. But if n is finite, then between some a and b you will be able to say something, but not about... So more points you have, more you can say, but you cannot describe the entire distribution for finite number of points. So this was what I wanted to discuss yesterday. And... And now we will get something completely different for time and then we will get back to this. Unfortunately, we have to discuss a bit what... where we will get to a bit of finance again. Which may... That's not unfortunate. I can clean this side. But we have to understand... So yesterday, there was a general discussion what is a market, why it exists and all these type of things. But we have to be a bit more concrete and try to understand what are prices so... So... No, then... Then this part, so the second will be a constant. And so then what dominates is this and linear in enter. So the question is, how are prices set somehow this? Or let's say, what is the price? So we are getting a bit more to actual finance, even if in the language we had some... some hints. So, okay, there are some very trivial claims that someone buying in the market wants to buy low, so pay a small amount of money. And... And those who want to sell want to get a lot of money. So it's a trivial claim. But it means that... If trades are infrequent, then you can expect people to negotiate. You go to the market and you're negotiating. We shouldn't lose much time, but... I have this quotation from a book. It's a fun book about finance. It's a type of negotiation. So... How much is it? It's 150. Okay, I'll take it. Oh, then it's 160. But what you just said, it's 150. Yeah, but that was before I knew you wanted it. You cannot do that. I mean, I leave you guys... It's visible, right? I'd like to know if you read it. Okay, it's not extremely deep. There are some deep hints in it. It's not obvious that the price is going up because of the quantity going up. But anyway, it's super hard. So if you have to negotiate on all trades, it takes a lot of time. And apart from that, there are also some what we call counterparty risk, which means that if I buy from you, somehow I depend on you. So if I give you my money and you can run away with it without giving me what I need. So it's not a difficult thing in the market, but it's something that can happen. Or if it's on the internet that I buy, so there is some risk in it that it's a one-to-one trading. So typically what we say is that you need a mechanism to make buyers and sellers meet. But it's not at all trivial how to organize a market. So how to avoid this. Of course, negotiation you can do if you do it once a day, but you cannot do it in this high frequency. So I wanted to discuss first one type of trading, which is called valorizing an auction, which is not the way markets really function today, but I think it's a good way to understand how it works. So valorize is a person that he was Leon Valeras an economist in I think early 20th century. So the solution to all this, you can guess it from here, this is the main thing is that if you specify a price at which you trade, it should be some firm commitment. You cannot just change it whenever you want. It seems to be a trivial idea, but someone had to come up with it. And so the way valorizing an auction works is the following. There is a specified person who is called an auctioneer. So someone who is different from the others who is keeping a list of all wishes of others. So anyone who wants to buy at a given price comes to him and says I want to buy at this price, she writes it up in his small notebook and keeps this list and waits for other people to come. And at some given moment betting is over. It can be decided in advance that it will be at 6 p.m. or it could be a random time. And what he does is he tries to decide on a price so that most people are the highest number of people are happy after this. It seems to be a fair way of doing so. So what you say is that there is an auctioneer who is somehow special and there are prices but what's the good word for it? Quotes, let's call it quotes. So everyone can give a quote of how much he would be willing to buy or how much he wants to get. Quotes are given to him. And then at the end auctioneer sets his start in a way that highest. So to we can also try to, actually I have a figure, let's do it. So one can look at this in the following way. So what you can do is put on the x-axis the prices. So each person defines I'm happy to buy at $103. And on the y-axis we can put the accumulated quantity. What do we understand by accumulated quantity? So if let's say there is a price here of 100 then here you put everyone who would be ready to buy at a price not higher than 100. So that's why, on the buy side so that defines a demand curve which is this one here. So it is a cumulative curve. You can see everyone who is so that's why it's a decreasing curve because as you go to the left you are adding new people to existing ones. So someone who would be available to buy at 101 will be of course available to buy so this is the demand curve for buying and the supply curve for selling which is in the same way just monotonic in the other direction. Is it clear? Someone said yes, but for the other is it clear. So one can write up a demand and supply curve which sums up everyone who is ready to buy at a price this or lower and those who are ready to sell at a price this or higher. And so in this language there will be this P star price the P star price will be the point where these two cumulative curves meet so there will be exactly Q star people who want to buy at a higher price and who want to sell at a lower price so you can set this price all of these will be happy to trade at this price and everyone else will be happy that he didn't trade it because all those who stay and wanted to buy would have wanted to buy at a price which is lower and all those who stay and wanted to sell would have wanted to buy at a price which is higher so they wouldn't have been happy with this price. So this is one type of doing a trade and actually this is what usually is called an auction today. I mean in an auction typically you put all your if you have an auction for one single product of course there it's maximizing the happy number of people doesn't work but if there are many products an auction usually is called like this Vara auction it works well, there are many people who are happy but what is missing from it is right here so what is the problem is that there is no coordination between people so what this means is that they are blind, there is an auctioner who has the list of what people want to do but everyone is giving him what they want to do so this is a happy moment and they have something like this that they said the price well but of course you could have a situation like this so this is cumulative quantity and this is the price exactly like there you can say okay these are those who want to buy these are those who want to sell and there will be no one trading and maybe they would have traded had they known that that this price nothing will happen maybe they changed their price and there will be no information in a single game of course you can do multiple games and there will be more information but it's very slow to advance a solution to this in the traditional Vara auction is to introduce market makers we mentioned this yesterday so what you can add to these markets before getting to another system is to well either the auctioner or someone else who somehow post some visible so someone who knows the inflow of orders coming from the others he gives away a bit of information of where the typical prices are so a market maker can instead of just getting the list okay maybe it's better if I also write things yes so quantity would be any given price so the full curve here so this one is people who want to buy demand so quantity would be how many people do you want to buy at this price here but actually of course if you want to buy at this price you will also be happy to buy at a lower price if someone sells you so accumulated quantity is the number of people who would be ready to buy at this price so that's why it's that's why it's monotonic well if we didn't put zero here we just put at zero everyone wants to buy it would be probably good for everyone who knows about it and and the same for selling what is it? it's those who want to sell supply, those who want to sell and it's the symmetric so so the solution so the problem here is that people cannot they cannot coordinate and there might be much less trade so people will be unhappy at the end so you can introduce what they call market makers who have some obligations in the market and they have some privileges for these obligations so what the obligation is visible quotes so what they do is they get all this information here but in a case they get the information they can have some calculation for them to say what is the typical price at which people want to buy and typical price they sell so he can signal to the others that this is a realistic price if you put around this you might be able to execute if you put very far away of course these quotes that he puts so this is what we put in the beginning here so what he says is that putting a quote is a firm commitment sorry? they don't they don't see Pistar Pistar is set after these two curves are given so this is the beginning I ask you guys how much would you pay for yeah yes this is not here there are the two curves I am writing up I am asking you to buy I have an apple I am selling it and then I look at it and just ok what is the everyone will be so one solution is to have some designated person who gives away information we can discuss in detail about this if you want later but I think it's it's not that important of course that if he puts a visible quote at some measure at some price he has to buy at this price and he has to sell at the other price so he cannot just do what he wants because if he puts a price and everyone wants to buy at this then he will sell a lot of products and he will have to buy them somewhere so he wants to keep everyone every zero in his pocket everyone who wants to sell below p star or who wants to buy above it's not really true the others will be satisfied in a sense that it's a question how you define being satisfied so someone who wanted to sell at this price will be satisfied in the sense that he doesn't trade because there would be no one to trade at this so he wouldn't be satisfied to sell at p star they are satisfied ok, so these are the traditional I'm making a mess here these are the traditional traditional mechanisms of how markets work but actually today's markets are very much based on these mechanisms but what are different and so I will come with that now so I wrote these two lines here and I will clean it I hope you don't mind keeping this for a while so today ok, this could be electronic or not electronic but somehow there is the idea that someone has to collect the orders what markets today work it's called continuous time double auctions I write it up but it's continuous time auction so which the name tells us ok, it's in continuous time what does it mean that everyone at any moment can send his quotes his wish to trade in any sense and of course if he finds someone he is executed immediately so it's not that there is a price set at some either random or fixed time and it's also double auction which everyone can buy and sell in this system now how does it work typically ok, so this is the official name of these of these markets so there is no explicit auction here it's a computer that that manages the orders that come and the figure so this is a figure of a limit order book so orders are stored orders stored in a limit order book so I will call it just for simplification L, O, B in the future and this is an example of a limit order book so what happens is is that well you can see all the buy orders in decreasing price here you have the quantity so it's not accumulated quantity if you integrated this downwards so someone would be happy to buy at 800 at this price ok, you can see it so the orders to sell obviously prices are higher so the lowest sell price and the highest buy price there is a difference between them otherwise they would have already traded probably so this is what we call a limit order book essentially it's the list of all orders that are waiting what is important is that unlike in this situation here it's not only an auction so what will happen here? ok, so that's market dependent so there are typically what happens is what they call price time priority so if you put a better price and if you were the first the precedence but if you were the first in time then you will have the precedence so here probably this arrived before this there are also other markets where it doesn't work like that there are markets which are called prorata which means that the larger volume you put the more probability you have to be able to trade sure, he can buy it but why would he do it? but he invested a huge amount of money for this he bought, sure if you go to the market and buy all the apples you can but unless you have some good goal with this otherwise you just bought so essentially if this guy wanted to buy at this price he wouldn't be in this list to sell but he would have just bought in the first place so so this is a this is what we call a limit order book so the list of everything which has not been executed immediately in the market by definition, so there are the type of orders in a limit order book the first is what we call limit order actually here so this story that we are seeing here especially here, so from what limit order books it seems to be storytelling but this is extremely important to understand the mechanism so don't hesitate to access there are things that we call limit order so how about does a limit order say we more or less see you are there so you can define if you want to buy or sell, of course a given amount the thing there at a given price so at a given price of course means that at a price which is not worse than what you gave you will be happy to trade at a better price so you have three things here so of course you can say what you want in your direction you can define an amount but what is important is that you also define a price which is actually called the limit price to your order, that's why it's called limit order and that's where there is a difference of the other type of orders which are called market orders which say buy or sell of course, you can always define a given amount so you only have two things that you define so your direction and how much you want to trade and you say ok, I want to trade it now I want to trade it at the best that I can, I mean give me the best price that there is in the market but I want to trade it now so market orders give you is is somehow immediacy if there is someone available to sell if there is someone in the list if you say I want to buy you sell the market order to buy you will execute against these people here up to the amount that you want to trade so so you get your trade immediately but of course at a price if you are buying you will buy at a higher price than these people there who are patient so limit orders instead of course are not immediately executed they are queuing in the limit order book so limit orders are queuing in the limit order book of course either until someone executes against them someone sends a market order or of course there is a possibility of cancellation of a limit order ok sorry I will call limit orders LO market orders MO for simplicity so limit orders can be cancelled so someone of course can decide oh I cancel this and instead I send a market order or I cancel this and inside I go home or cancel it and put another limit order at another price so so how does actually one can look a bit at the dynamics of this this is the list that we have and other ways to look at it very similar to what we saw for this that you say that you on the x-axis you put the price at which and on the y-axis you put the quantity so it's not accumulated quantity here it's not an integrated quantity but for each price you see what is the quantity available to buy or to sell at this price and so ok the way this is drawn one can think about this this is a type of deposition process but it's not really important for us but what can happen is that limit order can arrive to any level of level here and can be cancelled by the given person who is there and there are market orders who just execute against the best on the opposite side up to some up to the quantity once if someone wants to buy 5 here so then he will be executing until this against these and he will pay the average price I mean the weighted average prices of these so two things that we see here one is that so prices are discretized so this is a sort of discrete grid which we call tick size so the minimum price difference between two possible limits is called the tick size it's a definition typically it's around 1 cent for example in the US what you can also see is actually quantities are discretized as well of course if we call them quantities it's easy to imagine but it's not it's a multiple of something that you can buy you cannot just say that I want to trade for 3 euros whatever the price is and two other things that we see here so ok these are definitions and they are sort of trivial so one is that it's just a question of language buy orders are called bid and sell orders are called ask orders it's an English language traditionally this is the way they call them so sometimes keep it in mind because sometimes I pick this language more you can see that typically there is some difference between the lowest sell price or lowest ask and highest bid price which we will call bid ask spread and we will see some difference because if there was zero difference of course they would execute against each other so at least a one tick difference at least this minimum price difference there will exist and then one other thing that we that is here that we will discuss sometimes which we call mid price which is the average of the mid price is by definition simply the flat average of the highest bid and lowest ask price of course you could define other prices that your quantity weighted between these two so so I just to define them once and for all so if you call the best which means lowest highest bid you call it B and lowest ask you call A then B A minus B will be bid ask spread and A plus B over 2 will be the mid price so these are definitions nothing new here sorry T here so on this it seems to be a snapshot but of course these are time dependent quantities so I could have not written there but sure these all depend on time so the state of the book depends on time so because if it were zero they would execute against each other well the price in this case what prices will we have we will have an execution a trade price so someone who is buying now will pay this price someone who is selling now will pay this price and usually it depends what we are looking but very often we are looking at this mid price between the two because we do not care exactly if you want to buy you care more about this price if you want to sell you care more about this but on average it is more than the mean of the two that you care about sure but that price can be depend on the quantity you could say how much do I have to pay if I now in this moment I want to pay by 100 if I want to buy 200 and price will be different if you do it in one shot this is actually very important so so this is the limit of the book I hope the dynamics are clear I just want to say one word about this I am really super slow there is that's about the limit I won't say the other thing I'll get to it later is this clear? Can we continue? so this sort of defines how a price is set there are several mechanisms several definitions of prices but this helps us know what a price is so what the next thing that we actually care about is trying to model things now hopefully we will meet so we discussed you care about the fluctuations of a quantity or fluctuations of a second moment you want to look at how the price is fluctuate and to look at this first I will start with something which is called the random walk model which is we need some help which is a very traditional model so it was by Louis Bachelier in nineteen nineteen zero zero who wrote, he was a mathematician he was a student of Henri Poincare in Paris and he wrote his thesis on Theoret de la Speculation so he wrote, he was interested in gambling and what is actually interested for physicists but probably people know so he was the first person actually to describe brownie motion before, I don't know, four years before Einstein and so he had two ideas which were very remarkable especially for his period but I think they are remarkable also now so one thing that he said is that okay we saw here that there are people but in every transaction there is one buyer and there is one seller so he said, okay so at any given moment the number of those who want to buy at the current price and those who want to sell is the same if there is a buyer and the seller in all sides so what he said, okay but if there is a same number that there is a balance so what you can expect is that prices should be unpredictable in practice what he said is that you want to buy because you think that price will go up and you want to sell because you think price will go down so if each trade involves a seller so in each trade so the number of sellers will be the same as number of buyers roughly and he said, okay so prices should be unpredictable which today one would say that they are marketing it so they would say that the expectation of price in the next step given all the information up to now is equal to the price now he didn't write it this way but it's the same type of claim which is I think very interesting we will see how much it is true and something else that he said he said that if price changes are iid I'm too fast if price changes are iid so independently and identically distributed and they have zero mean then due to the central limit theorem that we have seen before you expect that price changes should be Gaussian so if I write just price changes should be Gaussian so this is there should be Gaussian on some aggregate timescale of course and if you add up small timescales you should be Gaussian maybe on daily timescales so what I just say here I mean this is a modern way of saying so he said prices are unpredictable so there is no linear correlation what I say is that the expectation of the price at t plus 1 given all the information up to now so we are in t now sorry in time t now the expectation of price at t plus 1 given all the information is the price now in probability that it will go down and it will go up so it's unpredictable weighted by the size of the step yeah so what he said that prices are unpredictable it's what today if one wants to be clean says that it's a martingale pt here, yes yes so if you want to be clean with a martingale you would put this but actually I can say that even more so even if you knew the price yesterday and the day before it won't turn so that's more the way the increment yes no no so the price changes are Gaussian on an aggregate so what he said it is essentially centered if these are iid zero mean here I think that yes on one day maybe I don't know if this changes every second so on in one day how many seconds there are they should go to no the change about the value of the price we don't know what he says here is that on an aggregate scale price changes should also here of course before this he said if changes iid then on some aggregate scale because of the central element theorem to your Gaussian yes exactly but the price change on a long scale is the sum of price changes on short scales it's right you can always write up pt plus t minus pt sp t plus t minus p t plus t minus 1 plus p sorry plus t minus 1 minus 2 et cetera so so so this was these were the two ideas in his thesis and there is one thing out of this which actually is called Bachelier's first law but he will only talk about one law of Bachelier is essentially putting things together that he had in his phd is that exactly the price variogram so in today's language the price variogram should increase linearly in time so exactly what we said it's visible so he said that this guy here should go linearly in the time scale meaning that prices are diffusive so it's a variant of this first claim here and he obtained a large amount of results about this so what he said is this so that prices are diffusive actually it was super interesting so there are a lot of results exactly on option pricing and all these he came up so which results on how the price on a time scale should diffuse and how for example an option in this case so 70 years before modern option pricing has been done so let's see if these are true or not so this claim this is a way this was the law of Bachelier this is what Bachelier claimed at the end of all his thesis and it's well it's very much related to this first claim here so that they are unpredictable actually the second one you don't even need for the law is and so sorry that I didn't get it but it's the same it means this we didn't go through the entire thesis he made some claims but the main claim was this so we should test if it's true or not indeed I didn't go through the entire thesis so so the question is this we want to look at these things is these true or not and so here we have two figures which should be related so one is that's why we discussed all these variograms and signature plots yesterday so one is the variogram itself so this guy has a function of time for 50 years for the downjones index and you have the feeling that indeed it's very much linear in time linear in time scale variogram is tricky because visually it's not obvious to see what's the truth you see that here there are some deviations but you see that indeed it seems to be diffusive similar to a random law behavior and another way to look at this this is why we discussed the signature plot and the other day is to look at the variogram divided by the time scale so it's sort of the same information but it's easier to visually see actually it's for other data it's for the S&P 500 index futures contract and what you see here is that there is a signature plot as a function of time lag what you can see is that it seems to be very much flat it's the same type of result so it seems to be diffusive at least after a few hours there is a very slight decay maybe but if you zoom in so this part here can be seen here you see that there is a slight negative trend on short time scales you seem to have some subdivision so some mean reverting behavior on time scales that say under so this is in hours depends on which years in a few minutes you have some negative slope here you seem to have some mean reversion of the price but afterwards prices are diffusing actually we won't go into detail but so this initial mean reversion of the price is related to the microstructure of the book so that since prices are not continuous so that there is discretization in the structure that can cause some bounces back and forth as a mean reverting behavior so that that about about about Bachelier so it seems that at least the question of diffusivity of prices is true or is close to true for most of the time scales which of course brings up ok, which of course brings up a question that if yes so the so the fact that if you actually start to look at prices what you find on relatively long time scales is log log graph log log yes, no it's a lean log so it's log on the log on the x axis and linear on the y it will be and effect that what you say that here there is a slightly more but yeah this actually I didn't make this plot myself so what happens here is simply on the log log figure you set some what they do is they set some minimum time scale here so it's probably it's from a few minutes that they start and they might have just two or three points here which are not on that log log plot so indeed this that one is here it's not really well visible but it's here here you see a small hump and going back so here it's not super nice I can maybe look for another figure but so what this is absolutely real data from now on we are only talking about real data otherwise it's not a big deal that I show you something which is diffusive it's real data so real prices indeed after at least a minimum time scale behave in a diffusive manner it depends 250 hour so this is a mid price which price? it's the mid price of the exactly but it's prices do change but in a diffusive manner so the second moment scales with the time scale linearly no, but is it let's talk about the data maybe I didn't get it your problem is that it doesn't vary too much or it's I don't get the price of mid no, no, no mid, mid, mid, mid mid price the mid price is between it's what I say is that it's the average, not the median but yes here is the dynamics of a limit order book I didn't want to go into this so what you do here it's another way to look at it which is in time ok, let's only look at one curve here which is sorry, only look at the points let's say, so the circles here because I don't want to explain all that so this is in time in seconds so what, it's one hour probably how the price is changing and you say that it's continuously changing so it's for one given stock but it's continuously changing on some it does change a lot, it changes what 10% in one hour 1% in one hour that's not typical but prices vary all the time so there are people trading all the time and prices change accordingly so this 250 hours which is 10 days is a long time so ok, so one thing that I wanted to mention but I don't want to go into detail now here is that actually if you look at at how this thing here behaves I just put proportionality to tau but actually what you see is that the fluctuations of the price are proportional to the price itself typically which gives the question, ok, so is it is it a good way to look at it? yes yes, so if the diffusive behavior is always there it's very general but of course we will get to this in the later so why is there this diffusivity in hand waving manner it's because all these people are trying to buy and sell everyone tries to gain on it and they cancel somehow out each other's effects and it becomes a diffusive process now if there are very few people trading on a market you can indeed find a non diffusive behavior maybe up to larger time scales because if it's if the limit order book is very empty you can have deviations from this and of course this is a big time of it so locally you can have moments when you are able to build predictors if you are very smart for the price but very weak ones and on average the diffusivity holds no the price values do not grow, the prices are diffuses no it's the variance which is growing so it's like a random walk the first moment we didn't write up but the first moment is zero on short times and the second moment goes linearly in time so ok so what I was just mentioning that one also finds that the changes in the price are proportional to the price itself which brings up the question that is a random walk type of model or a brownie motion type of model good or you want rather some geometric brownie motion so a multiplicative process we won't go into these details here I don't really have time for that the answer is that it depends a bit on the time scale how you want to model it so on short timescales things are pretty much additive the prices are additive because of essentially the structure of the order book there are there are minimum distances and this makes things additive on longer timescales it's more close to a multiplicative process which actually is what is used in mathematical finance typically so ok so this was about somehow the first game so our price is behaving a diffusive manner is it our price is unpredictable in a simple way but there is a second question that we should also look at what he said if change is our IID that price changes should be Gaussian on some aggregate timescale and so we want to look at this next so the next question is our price changes Gaussian yes and we will look at it now so it's now that we will really look at it he claimed this so so our price change is Gaussian and well I think the answer is there were people in the segment actually there is Benoamandel brought I think it was one of the first people studying this and claiming that no they are not really Gaussian and we can look at the return so I will put a couple of figures here and this is a very important part of the course so what we put here or again for the S&P 500 index we see the 30 minute returns and the one day return distribution so what we have here eta is the distribution of the return so eta is the return of the price so the variation of price here it's in percentages so it's relative to the price itself and we see on the y axis the distribution of this quantity on the figures the distribution so what we can see the points are let's forget positive and negative for the moment the points are the data and the dashed line is the normal distribution a Gaussian distribution so it's not Gaussian we have the feelings so what we see already here is that well okay here there seems to be a shoulder a wider shoulder of the Gaussian and the much thinner tail of the Gaussian what does this mean that the probability of having a price change of 3% let's say would be 10 to the minus 4 in reality if you look at data and it would be something much lower for the Gaussian distribution as you can see so this is for the 30 minute window but of course we can look for longer windows so let's say one day because maybe we need longer times to get to this Gaussian it seems to be the case that even at one day we are far away from it again this dashed line is the Gaussian distribution and the actual price changes are much more fat tailed probability of a large change is much higher so so this is for so this is for the S&P 5 in index I have a couple of figures like this because I think this is maybe the most important claim here so this is the same type of figure for the GVP-USD rate so just to show that there are yes the return is simply the return return means price change so return is the same as price change in a hand waving manner because you can define two ways return you can say that return is okay at time t on timescale tau is this is the trivial definition but you can also say that for on some timescales actually you find that this thing in itself the amount of which the price changes is proportional to the price itself so often what you want to look at and other definition of return can be more to say that it's this thing here so normalized by its value now that you say that this is more meaningful in general what you can say is that at high frequencies at very small timescales you are more interested in this measure and at longer scales you are more interested in this measure but it doesn't really make it makes a difference for the actual number that you look but the behavior of the two quantities is very similar actually one can write up that that for a multiplicative process the changes in the logarithm which follow a simple random walk so what we have here so here it's in percentages so it's the second definition so the price of three means that the change in the price pt plus tau minus pt is 3% of the price in the beginning is that okay? no, here, okay so that's why you're absolutely right actually we have two curves here because of putting log axis on here so you have the positive and negative tail of the distribution so plot here is flipping the negative side over and looking at both tails of the distribution so and those are the two curves so what you see is that they are quite similar for this time scales typically for short time scales up and down changes are very similar so this is for the rate of GBP-USD a very similar figure these are sort of identical but for the German state bond again you have a distribution which is way more fat tail than a Gaussian on a 30 minute scale and on a daily scale as well and actually if you put together we have seen that this is true for most of the product classes we put different types of products on one so if you scale things together actually here we have a bit newer figure but for different types of financial products I won't go into much detail but equity is equities vol is volatility so it's option prices and CDS I won't go into detail but very different products have very similar tails so what you can see here in this case this is a log-log figure the case as a power loop very similar parallel behavior which is an exponent of 3.5 ish in this case so the points are observations here everywhere more what I think but we will get to this so I cannot give you a I don't know where large deviations that happens here why it's not the case and why we will see for longer time scales is that things are very much correlated so not the first moment so things are unpredictable but in higher moments you have correlations here we don't assume anything we just look is it Gaussian thinking that it's Gaussian we assume that correlations are not very strong as we have seen before and here we just see that it's not Gaussian that actually there are correlations and that's what causes it so to write up so what we seem to see here is that it's not just not Gaussian but it seems to be somehow a parallel tail that governs it actually I write up we won't use it but it's good it's important to know so the best fit for these curves up to so let's say to a few hours for a few minutes to a few hours or daily scale is a student distribution I don't know if it's a known distribution to you I will write it up but it's important to model these prices we won't use it explicitly so what they say is that the distribution of the price changes is the following thing I'll write it up so it's this distribution I'll write it up it will be in the notes that I send you so don't stress about that but it's more interesting to look at this distribution which is this so well there is this gamma function here which is related to the what's the name of the factorial function here is that this distribution has a tail which behaves in the following way one has problems no no damn it so the importance so this is the formula of the student's distribution we won't go into detail there is new parameter which is called I think the degrees of freedom so we can see I will discuss about it in a second but what you can see is that for price change is above this A parameter A then the tail of this distribution is a power law with an exponent 1 plus 1 plus nu so the best fit is usually the student distribution with a nu around nu which is somehow between 3 and 5 that's what you find empirically what's important to know so this is the student's distribution here what's important is that nu equals infinity you get back the Gaussian distribution so the black curve is the normal distribution it's a limit of the students how do you find it? this you see it from data that you're looking for a from here you see that you're looking for a distribution that has in the tails behaves somehow in a power law manner and then people are trying different distributions we don't need this explicitly now what's important for us is this that it's a very much fat tailed distribution it's good to know that it's a student's distribution but unless you're actually modeling price changes for something you don't it's not something to learn by heart so for infinite number of degrees of freedom you get back the Gaussian distribution and for you can see here for different you get a wider tail a fatter tail of the distribution what is important from here actually is that we see that this nu is between 3 and 5 but what one can know if you write up this distribution is that actually that means that there is a finite second moment so in general for nu above 2 you have a finite second moment so this will be important this will get back to it's a fact about the student's distribution and when okay I don't want to go more in detail into fitting this but what is very much important the main message from this is of course you can say what's the fit but the probability of large price changes in real data is much much higher than what you expect from Gaussian distributed data for example I just wrote this up but one can calculate for him or herself that for example for example if you say that okay you want to look at the probability that that you have a price change which is equal to 10 times let's say the standard deviation of the process something that is in a Gaussian so that in a Gaussian world would be almost zero so if the distribution is Gaussian then this probability would be I wrote it up it would be 10 to the minus 23 so it's something really negligible while if it's actually a student with I think it's nu equal to 3 so which is not far from a good fit but it would be 10 to the minus 4 which is a small number but finitely small so and I said that I will it wasn't just blah blah yesterday about the difference between economics and economics so actually in traditional finance even today most of the models are using normal distribution for for price changes meaning that they completely impact any large price change which can in practice happen quite often so if you look at how often a given sigma event how often this happens you can see that very often you can have large change and of course if people have models which are based on I don't think I have to go much into detail so if all your models are based on the fact that there are no large price changes then first of all you will be surprised but also if all people have similar models which are based on the fact that there are no price changes they will be surprised at the same moment which can make the markets extremely turbulent so if there is a big price change that the models people are using never predicted then everyone tries to escape from the market when these price changes happen which will just enhance enhance the the turbulence it will just make an even larger price change so so I am again at the point of what should I do ok so maybe we should stop here I don't know it's time, right? it's now ok so let's stop here ask questions if you feel yeah but the problem is that for 5 minutes