Welcome everybody again for this third day of the school. Today we're going to have three speakers and the first one is Matteo Marcilli who is a professor researcher here at ICTP. We'll give a tutorial on stochastic processes. So I leave the floor to Matteo. And before we start, just let me remind you a couple of rules. So if you have questions, you can either post them in the chat or you can raise the end with the zoom feature. And if you're following from YouTube, you can ask questions by posting the question on the YouTube chat and I'll keep track of that. Please, Matteo, thanks for. Okay, welcome everybody. So in this, this is a tutorial. And the idea of this tutorial is to give you an idea of how you introduce stochastic effects in theory and simulations of individual based models. Okay, so going from the ordinary differential equations that you have seen in many of the talks to models that also include stochastic effects. Okay, so. So the idea is say this is just an example of some data from epidemics. I don't remember exactly what the epidemics was, but as you can see, the dynamics of the number of infected in time is not at all a smooth function as you would get from the integration of differential equations for populations. So, which means that you have to include the other terms. So one of course is seasonality. So a term that depends on time explicitly, but the other one is also what I shall call generally noise. And the idea of this lecture is to discuss what type of noise and how this noise comes about. Okay. And, in particular, I'm going to discuss demographic noise. Okay, so if you take a simple model like MSI model, then these are the two differential equations that you have. And generally if you integrate these two equations you would get just a continuous curve. But if you are interested in a model that is going on in a real population, then the increase in the number of infected individual has to be an integer. And if you look closely at this curve, it should be like a step function. And these steps corresponds to microscopic events where a particular individual in the population get infected. So this is what we want to describe. So what we want to do is to modify these equations of this model in order to take into account this discreteness and these stochastic events. Okay, so let's start from the very simple, simplest case. Let's look at just one individual, and let's imagine that he may get infected in time with a rate which is constant in time. So this probability, RDT, that a new individual will get infected in time interval from T to T plus DT. And these events are independent. Okay, so you can represent this on a line and these events are represented by these star symbols. If you plot the number of individuals as a function of time, then each time there is an event, the number of individuals will increase by one. Okay, so how can one simulate this event? If you imagine you want to write a computer code that generates this function I of T, then one idea is to fix a small DT. For every interval with a probability, RDT, you will increase I of T by one. Okay, and you can do this for a particular interval T, T plus DT, and then you advance time to T plus DT, you consider the next time interval. Okay, and for each interval you should draw just a random number, and if this random number is less than R times DT, then you increase I by one, otherwise you don't. Okay, so now how should you choose this DT? So, the idea is that if you choose this DT too large, you may have that more than one individual gets infected in this time DT, so DT should be very, very small. But if DT is very, very small, then your simulation is going to be very small, very slow. Okay. So the question is, can we find a more say smarter way to simulate these problems, to simulate this process. And the idea is to ask, well, how much time given that I have an event at time T, how much time should I wait for the next event? Okay, so this is a little bit of math. So essentially, if this P0 of T, T plus S is the probability that there is no event that occurs in the interval between T and T plus S. And then because of time translation invariance, so this probability will only depend on S, it will be constant in T, it will be the same for every interval. And this probability can be written as the probability that the time that you have to wait has to be larger than S. Okay, so it will be the integral from S to infinity of the PDF of the probability density of this waiting time. The next observation is that if you ask this question for two interval consecutive intervals of length S1 and S2, then it must be that the probability that you don't get infected in an interval of length S1 and S2 is the probability that you don't get infected in the first interval times the probability that you don't get infected in the second interval. Okay, and this should be true for whatever is the size of the intervals. So this requirement implies that this probability, which is a cumulative probability of this waiting time distribution, must be an exponential, okay, must be e to the minus r times S. And then the PDF is just given by the derivative of this and it's the PDF of the waiting time is just r e to the minus r times S. Okay, so now we have this probability distribution. It is very easy to draw a random variable, which has this probability distribution is just given by this formula here where RAND is a uniform random variable. And so what you can do to simulate your process is just to draw a random variable TW with this PDF, then increase your I of t by one and then advance time and then you can repeat it in this way many times. Okay, this is a more efficient way of simulating this process because it requires you to draw fewer random numbers, and it's also exact is not approximate. Okay, so you can also do the same simulation. More efficient with a larger fix the team. If you observe that the probability to get K events in an interval of length. The probability is given by the Poisson distribution. Okay, so it's all in this case, essentially you can keep a DT fixed draw the number of new infected the distribution and then advanced time by by you or by town essentially. Okay. So, these, these all these mathematics that I've been describing is essentially what is called the Poisson process. And these are is a is a process that describes events that occur and that have no memory because essentially in every interval, you can have an event independently of whatever has happened before. Okay, so now let's go back to our problem. We have a set of simulating a population model like the SI model.  So there are two compartments in our model. We can say that for every individual, sorry, for every individual, there is a variable Xi, which is either zero, if he's susceptible or one, if he's infected. And the model is say, it's a model where at each time interval t t plus dt, each susceptible can become infected with a certain rate and each infected can become susceptible. So, now what is the the important point is the rate at which a susceptible individual becomes infected depends on how many infected individuals are there, how many susceptible individuals are there, and also on the state of the individual. Of course, in order to be infected, an individual has to be susceptible in order to be become susceptible and individual has to be infected. So this rate generally depends, depends on the variables Xi. So this makes the simulation a little bit more complicated. But again, you have the, you can see at this simulation is a situation where you have n Poisson process, which are, which interact with one another. Okay. And so let us see how we can deal with this situation. Okay, so imagine that we are a time P. And then, and the, the each individual which is represented by a different line here is in a particular state Xi. And at each time, every individual, every each of these states can change. Okay, so now we can use the idea that we developed before and we can draw waiting time from the exponential distribution and ask ourselves, when is it that the state of Mr. I will change. And then you can ask yourself, what is the, what is the individual that will change next, this will be the one for which the waiting time for the next event is the smallest. And then you can simulate this process by just finding what is the, who is the guy with the minimal waiting time you draw waiting time for each of these persons. Then you'll find who is the guy with the minimal waiting time and then you advance to you, you change the state of Mr. I start, and you advance time. Okay. So this is exact. You need to draw n random variables, which is, which are the waiting times for each of the individuals. But, well, you can argue that when you, when you perform the, when you change the state of Mr. I, you don't need to redraw the waiting times for the other people, unless their state has changed. Because of the memory less property of the process. Okay, so can we do this simulation, even better. So, the idea is that essentially, we can figure out what is the time that we have to wait for the next event to occur, regardless of which is the variable that will change this state. Essentially that we are a time t and where this violet guy change the state. And then at this point, essentially, we are interested in understanding, which is the next event with that will take place. We don't need to keep the distinction between the different individuals. We can just deal with this as a single Poisson process. And, and we can just find what is the time that we will have to wait for the next event to occur in this combined Poisson process. And then once we find this time we can also ask, who is the guy, what is the probability that the guy that changed the state is a particular guy, I start. Okay, the way to do this is is simple. The probability that the minimal time that you have to wait is larger than T is the probability that all the times that you have to wait for the next events, the events on all individuals are all larger than T. And of course of this, because these are independent events, then you can factorize this probability, then you know that all these are exponentials. And then you can compute directly, the, what is the probability that the next event will occur later than T. And this is e to the minus this capital RT, but capital R is just the sum of all the rates of all the individual rates. So, you can just draw a exponential distribution or exponential random variable from using this simple formula. Okay, then the second step can be done easily, because if you ask yourself what is the probability that the next guy that will change the state is Mr. I, then this is the probability that is he's or her, he's waiting time is smaller than all the other waiting times. And you can compute this because this is just the expected value on his weight in time that of the probability that all other waiting times are larger. If you do this integral, you get a very simple answer, which is just the ratio of the rate of the process I divided by the capital R, which is the cumulative rate or the rate for the whole population. So you see that if you, you can do a simulation very efficiently in this way by just drawing the time for the when the next event will occur, and then drawing which is the individual that will change his state from this probability distribution. And this way of simulating processes like this is called the Gillespie algorithm. So if you go back to the SI model, then here we are interested in two variables, the number of infected individuals, which is just the sum over I of all these random variable Xi. This is just and the number of susceptible is just the total population minus minus I. So and the rates are equal to beta times the probability that if I pick, if I meet a person at random it will be infected. This is just I divided by N. This is the rate for all the people who are susceptible for which Xi is equal to zero. And otherwise the rate to recover is just me. Okay, and this is the rate that applies to all individuals whose state is infected. So for which Xi is equal to one. And the prescription that I told you before is that if you want to simulate the SI model at an individual level, you just throw a waiting time for the next event from a from an expansion distribution with formula by drawing a random number, taking the log and divided by air. And where are here is given by this simple formula and depends on I, and then you draw I star from the formula that I told you before and essentially corresponds to advancing time to TW by TW and to setting the number of infected individual at time t plus TW as the number of infected individual at time t minus one with probability mu R divided by R. So this is the probability that yes that sorry this I think there should be a plus here and the probability that I get an infected infection more should correspond to it plus one and otherwise it decreases by one. Okay. So if you write a program, then this is essentially is very easy to write the program and then you can compare what is the difference between the ordinary differential equation the user ordinary differential equation which is the black line. The curve that you get from this stochastic simulation which is the green one and as you see you get some stochastic fluctuations. Okay, so a couple of questions, a couple of comments, if you don't have questions. So one comment is why can't I use a finite d t and use the fact that this is a personal process so I know how many events occur in a time between a personal process because it's given by the Poisson distributions I told you where the problem is that when an event occur this changes the rate of other events that can occur. Okay, so one cannot use a finite d t in this case. So this way of simulating can also be written down, can be described mathematically by what is called the master equation. Master equation is the is an equation for the probability of having a high individuals infected at time t and the idea of this master equation is that essentially you want to understand if you want to understand how this probability changes in time, then you have to consider what are the events that are to increasing this probability and these are the events where either you have one less individual who is infected and then someone gets infected and then you go from I minus one to I, or you get I plus one infected individuals and then you get one of them who recovers, or otherwise you have infected individuals and some of them either recovers or some other susceptible individual gets infected so you go to I plus one. Notice that here these two terms that describe the transition from I to I plus one I to I minus one are proportional to the probability of having I individuals at time t and they have a minus sign because the probability then decreases. Okay. So, now, of course, in a real situation like the one I told you before there are other stochastic events. In particular, the rates themselves depends on time. So, you should also take this into account. However, typically, the, this does not change much the way in which we have been doing our simulation. Probably because the, the rates so the time the typical time over which one event occur is a border one of the total population over the size of the total population, and you don't expect rates to change that much over such a short. Time interval. Okay. So essentially, this less the algorithm can be used also in the case where there is a seasonality. This is an interesting observation that has been made by a McCain and co workers. Sometimes ago, and he says to do with the fact that you can get seasonality, even without seasons. And if you look at this master equations solution of this master equation for system system systems. Stationary state with a fixed point and essentially was deterministic evolution. That would be very smooth. Then instead, if you look at the finite population size at the evolution of a finite population you find these large stochastic oscillations. Okay. And this is just an effect which is entirely due to the stochastic nature of the system and this has also been applied to epidemics. As you can see in this plot which is taken by from this paper. Okay, so I would post here if there are questions because then I'm going to change a little bit subject. Yes, exactly. So it's perfect. So I think it's a good moment to stop and see if there are questions from the audience. So if you have questions, please use the raise hand or type it in the chat. Yes, please model and mute yourself and ask. I just try to understand your slides, the previous slide, when you show about stochastic. Yeah, the previous one. Yeah, this one. So meaning that here we can see the slide in picture. Yeah, that one. This one, meaning that meaning that he can see the discrepancy between prediction of the deterministic model and stochastic model is it. Because you can see that the stochastic can predict like the solution with like some sort of verdict solution or cycle or something. But it seems like the deterministic part giving you stable state. Right. That is what you are saying. Exactly. Yes. And the reason is because of the demographic stochasticity. Exactly. Exactly. Exactly. Because you have this demographic stochasticity, you can have this oscillation. So this is a property that depends on the hessian of the when you compute the hessian on the stationary state of the model. Okay, so if you want to know more, I think it would be ideal if you go to these two references where the problem is discussed in detail. Okay. Hello. Yes. Yes. Yeah. Is it okay? There is a question in the chat from Jordi who asks is the period of seasonality in the stochastic process the same as the period of the deterministic damping. In this case here, when in this case here, I think I cannot, I don't recall exactly, so I would not like to make statements that are not exact. And So, so this is essentially related. So indeed, if you see in these plots, the the damping or if you look at the period of the deterministic dynamics is pretty much synchronized with the period of the stochastic oscillations. So, so in this sense, these two things are clearly related. And, and as I told you, well, if you if you look at the fixed point condition, then, and you look at the hessian, then the this periodicity here of the deterministic dynamics will be related to that. And this is the periodicity which is explored by this stochastic fluctuations in a, in a finite system. There is another question by some mass who is asking in the method of adding noise to the master equation. Can we add noises with different distribution or different frequencies like pink or white noise. How can we change this kind of parameters in the algorithm. So the. So if you want to ask the population noise is is given by by is a discrete noise and is is given by this description that I gave you here. So if you want to add the other type of nice, which is exogenous noise. Then this cannot all this can so like a stochastic forcing with a particular distribution. That of course can be done but probably this is more relevant. So we can discuss this better in the next part of the lecture. Oh, sorry. Yes, if you want to ask a question please go ahead. Yeah. Can I ask a question. I understand mathematically that there is an equation, as you said before that we can find the process which accused next. But what does it mean ecologically like how a how we can translate that in what is happening like you can if the model you can predict how the distribution is going to go in the future for the next time. I'm sorry if I don't explain myself well. So here, this is a model, say the stochastic the master equation this is a model where you make a very simple assumption on the dynamics of what is going on. You say that this is a model where is a well mixed population of infected and susceptible they bump on each other and you have this. And for this model under this condition you can compute in this way, the probability distribution if you are a time T you can compute what will be the probability distribution at a later time. Okay. Now, the question is how, how much this model describe a real ecological, real technology. And this is something on which you will learn across all the, I mean, I think this whole winter school is about that. Thank you. I mean, the tutorial is just to give you a sense of, if you look into this model, what is the mathematics and what is the, what are the arguments that are that are on the basis of these models. Okay. Yeah, thank you. So if there is time. Yes, there is another, I will say there is another question by model so we can go ahead with that and then we Okay, thank you. I got another silly question for you about that picture right when you got this divergent between deterministic and stochastic prediction it seems like the deterministic curve should be like of stable spiral part solution. Can you repeat always the case, can you get that whenever you got like the stable case or something. No, no, you don't get it. So for example, if you, for example, for a simple as I model as the one I describe you don't get this, this dynamics. So there are specific conditions on the on the rates on this rate that make this phenomenon possible. Okay, and again, if you are interested in this I really recommend you go through this very nice papers that discuss this property in detail. Okay, thank you. Okay. Let's go ahead. Okay, so now what I would like to discuss is probably a more direct way of introducing stochastic effect into the dynamics of population dynamics by adding a term directly to the deterministic equations. Okay, so if you have an equation again for the SI model for the number of infected. So this would be the deterministic dynamics. So, so what you can ask is, what is the term that I should add to this model in order to account for population noise. Okay, so, and so this is essentially a subject that goes under the name of stochastic differential equations. The, the summary is, if you want the two line summary is that the, the effect of noise you think about the effect of noise on a finite and small time window is the accumulation of many, many infinitesimally small events. So essentially the noise that you should consider can be considered as the sum of many, many random variables. So it is essentially described by the central limit theorem. And because of this, the noise, the type of noise that you should add to this stochastic differential equation cannot be anything, but it has a very specific mathematical form which is essentially related to what is called the vener process. Okay, and the main thing that you should remember about this vener process that I call W here is that is different, it's different. So the increment in this stochastic function over a small time interval dt is of the order square root dt. Okay, and this is a very important consequences that really are important to take into account when you want to simulate this process. Okay, so let me go through this in some detail. Okay. So, as I told you what we want to do is to take a differential equation and add the noise to it. Okay, in this case I'm using this variable why which is the fraction of infected individual in a population. So in order to give a meaning to this noise, I say we should tell, well, how do I integrate this stochastic differential equation so how do I get the value of the random variable why from a time t from the variable at time t zero when I integrate this stochastic differential equation from t zero to t. Okay, so the first part is rather easy because this is just a normal integral, but what is this integral of the noise. So, now in order to describe this integral of the noise, you should really think about it as, as what you would get if you discretize the time interval between t zero and t into small intervals of size dt. Okay, so the number of intervals is of order t minus dt, t minus t zero divided by dt, and this sum is is the sum on the contribution of this noise over this small interval between of size dt. Okay, so now let's think about what what should be the properties of this random variable Xi, which is the integral of the noise over a small time interval of size dt. Okay, so, first of all, if this, if we think this, these are stochastic effects, then it's natural or reasonable to think that these are also independent and identically distributed. Because noise is expected to represent something which we don't know anything. And, and so if, if this is so then the sum of these small effects is going to be to obey the central limit theorem. And so we know that this sum is going to be n times where n is the number of intervals times the expected value of this Xi plus square root n times the variance times Gaussian variable. Okay, where the PDF of this variable Z is a Gaussian. Okay, so in our case I remind you that n, the number of intervals or the number of some of variables that we are summing here. It's inversely proportional to dt. And also the expected value of these increments because this is noise is going to be zero. Okay, so now, if you look at this term here, and if you want a finite limit when dt goes to zero and n goes to infinity, then you should have that the variance of these random variable x time divided by the t should be finite. Okay. Because otherwise you don't get a finite limit. Okay. Sorry. So this is what essentially defines the winner process. And the idea is that each of these Xi which is the integral of the noise. So if I want an integral dt that I call DW should be proportional to the square root of the team times a Gaussian variable Z. Okay, and so I want that if I integrate this noise over a time from T zero to T. Then I get a sum which will will be of the order of square root T minus T zero times a Gaussian variable Z. Okay. Okay, so this is the first lesson so that this DW should be proportional to square root dt.  So your your increments should always be a square root dt. So notice here that this defines a curve, which is essentially this winner process. And which, which is a fine, which is a well defined limit when the T goes to zero. And this you can see graphically by the fact that I have been running this program with two values of dt, which is 10 to the minus three and 10 to the minus four from time equals zero to one. And you can see the function w of t that I have observed that I obtained, and you can see that, well, you cannot tell which is which actually I don't even remember which is which. Okay, which one was integrated with the DT which is 10 to the minus three and which one was integrated with the DT which is 10 to the minus four. Okay. So did the winner process, which is this stochastic random curve as is a very interesting object mathematical object and it has this process properties that you can show that it is continuous is a continuous path. And almost surely. And also it has independent increments if you look at what is the increment of the inner process in a time interval, and you know, another time interval that are not overlapping then these are independent. And also, as I told you, the most important thing that you have to remember is that the differential of these finite processes proportional to square root dt. And because of this, this is nowhere different. Okay, so we get some creative addition to the slides. Okay, so now let's go back to stochastic differential equation so what we have understood is that if we have a deterministic equation which is the first part. If y is equal to a times the team, then the noise that we should add is proportional to this vener process or to the differential of this vener process will be can be any function that also may depend on why. Okay. And if I want to define how what is the solution of this equation, then I should tell you how you integrate how you integrate it. Okay. So in order to do this, well, you have two parts one is just a usual integral is all the basic integral that you compute with a usual rules like. Whatever you like. But the other one is is stochastic integral is an integral that also involves DW. Okay. And so you can think, well, okay, I will compute these integral in the same way so define a time tau i discretizing in many many small intervals. I'm tau i between inside each of these intervals and just evaluate this function at these points and then some these function times DW and then that's it. Okay. However, if you think a little bit more closely, then what you find out is that the value of this interval integral. Depends on how you choose the midpoint. Okay, how you choose this tau i. In particular, what you can see is that if you look at this particular integral, which is w w d w between t zero and team, then you can define it as the limit as it goes to infinity of this discretize some. And if you take this tau i to be alpha times the endpoint plus one minus alpha times the beginning of the interval, then you get that the result actually depends on how you choose the midpoint. Okay. So it depends on this alpha. Okay, so then in order to give a precise meaning to these integrals, you have to specify how you choose these alpha how you do this. And how you compute the integrals. Okay, how you integrate differential equations. Okay, and this is called a prescription. Okay, and the most natural prescription is just to take alpha equal to zero, which corresponds to what you do when you do forward integration of stochastic of differential equations. Okay, so, so the consequence of this is that the, if you, if you look at the differential, so the rules that this mathematics for integrals and differential obey a little bit strange. Because, for example, if you compute this integral here, you get one part, which is what you would get if you just integrate if w were a normal function, which is just this part here. You get a new part, a new term here, which, which, which just comes from this, this prescription and the fact that w is a stochastic function. Actually, it comes from the fact that the DW is proportion to square root dt. Okay, so when you compute the differential of a function of w, then this does not only contain so this differential should be f of w plus the w minus f of w. So this does not you have to expand the f of w plus the w to second order there, not only first order term, because DW square is equal to dt, and then you'll get also this this term here. Okay, so this is consequences for how you deal with the stochastic differential equations and how you change variables. And because when you change variable you have to always take into account that DW square is equal to dt. And so there is another deterministic term that comes out in your differential equation as a consequence of the stochastic term. Okay, so you can do many exercises, but let me go back to the SIS model. And so what distance you so for the SIS model, you can derive a stochastic differential equation, which is, which is this deterministic part. And then the stochastic part, the fact that you have this stochastic part can be derived from looking at what should be the variance of the noise that you add here. Okay, and, and the variance of the noise for each interval. Okay, so this form and depends on dt. So here you should put the square root of the variance of this term here which is given by this, this object here. Okay, then essentially you can run a simulation just integrating forward this stochastic differential equation. And what you get is a, is a path that approximate the deterministic solution, but it has this population noise added to it. Okay, and now how you can relate to these two things that I've been telling you about population noise, the Poisson process and master equation and the stochastic differential equation. There is one way of doing this, which is rather natural and it's called the fun camp and system size expansion. I don't think we have time to go through it. But essentially, what I want to tell you is just these two different, what I've been telling you are not two different ways of two different stochastic processes is the same stochastic processes discussed in two different ways. Okay. So here are a couple of references to which are rather accessible for with a minimal and mathematical say education so and where you can find all the things that I've been telling you. Okay, thank you very much. Thank you very much Matteo for the very nice tutorial. So I think we have time for a few questions. So there was one in the chat that I can start to ask by pleasure I think you sort of answer to that already. How does the stochastic prescription affect simulation. Does it even affect simulations. It does.  Okay, so when. So, okay, so sorry. Let me go back to this point here. Let's take this example here. Okay. So you see, when you take the expected value of this integral here. d w. If if time is computed at the beginning of the interval, then d w and w are independent. If you take the expected value of this, this is going to be zero. If instead, you take a midpoint, which is not the starting, not not the beginning of the interval, you don't take t i as, as, as the t i equal to t i minus one, sorry, which is alpha equal to zero. Then, if you don't take the, the, the starting point of the interval, then these two variables here w and d w are not independent. And so when you take the expected value, this is not going to be zero. So, when you integrate, and so this means that when you integrate these stochastic differential equations. So you know, when you have an integration, when you have a, when you have a normal differential equation, you can choose any midpoint you want. Okay, you can have say implicit methods where you essentially solve this when we're essentially here you estimate your function x of t at the end of the interval so this becomes an implicit equation, etc, etc. So, and for normal differential equation, this makes no difference. Okay, it only changes the accuracy. You can only affect the accuracy with which you, you can integrate this equation. So, but if you have stochastic differential equation instead, you should be very careful how you choose the midpoint, how you integrate this, this equation. The idea of the ETO prescription is that the noise is in a time t is independent of x at time t. Okay, is a, is a, is an effect which is, which is, yeah, is independent of what was developed. Is this clear? Yes, that part is clear. But my question more was along how does it show in simulation? How does this prescription show up in simulation? It shows in this way.  Say for example, if you take alpha equal to one half, alpha equal to one half correspond to a difference prescription, which is called Stratonovich. Then these are the prescriptions such that you don't have these other terms here. Okay, you don't have the second term here. Okay. And so the rule that you apply to stochastic differential equation are the same as the rule that applied to differential equations. Okay. And so the results are completely different. Also, if you do numerical simulations, the results are, well, not completely, but they are different. Okay. Okay, so there is something you should care about. You should be always specific about what prescription you are using when you're dealing with stochastic differential equation. And I tell you this because also in, in papers that you, that you can read, this is not always specified. Okay. But if you want your result to be reproducible, you should say what is the prescription that you are using in a stochastic differential equation. Okay, so there are a couple of more questions in the chat. So I think we have five minutes more to leave like two minutes for a break. So, next question from Zoret. Can we study bifurcation in a stochastic model. Yes, of course. So now bifurcation, so you always think of, so if you think at a discrete map, then this is like, I don't know, if you look at the map or the logistic map, then you can add noise in different ways. But then if you look at it, like something like Lawrence system, where you have stochastic differential equations, couple differential equations. You can add stochastic noise to that. And, and see, and I think that many people that have started these problems. Yes. Another question about typically noise by John Luca was, are there models for which the stochastic differential equation involved a noisestorm that depends on the state of the system at that time. Say DW depends on X. Yes. So typically, you, you, you do this by saying that, well DW is always an independent at least in the prescriptions so DW is always the differential of the final process. So DW depends on X at time T is the, is the variance of the noise is B of X and of XT. Okay, so the, so this is the way in which you can build this dependence of X and T of, of the, of the noisestorm on on the state of the system. Okay. Great. So, is there any other question. I have, I have a question. Yes, please. I have a question that if the paper does not say what alpha they, they used. It's not reproducible. But then I was wondering if I can reverse engineer and given a solution or some, some characteristics of the solution. I can find what alpha or, or make, or maybe a distribution of probability of alphas they use. Yeah, so let's see. Yes, you can. In many cases in fair, what is the prescription that has been used also because different communities, typically use different prescriptions so theoretical physics. Many people use strato which prescription. And whereas for example in, I think in epidemiology, the natural prescription is more the ego prescription. But yes, I mean, the principle to, to, to figure out what is the prescription use but I mean when you write a paper you should ensure that your results are reproducible so you should state what is the prescription essentially. It's a, yeah, it's on the side of the authors to specify this. Great. So, I think it's time to take a short break before the next tutorial so thanks a lot there again for this very nice introduction.  So, now we're going to take this small break and


What's good jobs boy Ross back again with another video. So we're gonna check out 10 WWE finishers that actually put the opponent over I recently just checked out a video of wrestlers not putting over people's finishers or like not selling it in a sense Like they get here with the finisher they independent and they get right back up Well now we're checking out a video where the wrestlers actually put over the finishers and it looks devastating the move look Credible and that's just an important part of wrestling in my opinion I think a lot of you guys will agree man and when it comes to putting people over It makes it makes the match what it is You don't want to be facing someone or you know you see on television Someone is you know going at it with an individual and they're just no selling all the moves like it comes off It's phony doesn't come off. It doesn't give that realism. It just looks weird So it's always good to see when wrestlers put over other wrestlers by selling their moves Sometimes you can sell it. Well, you can oversell and then it becomes kind of kind of hokey You know kind of comical, but we're gonna check this out. Appreciate all love and support you guys have been showing on the channel, man I appreciate you guys and let's get right into this bad boy There have been several instances throughout WWE history and a wrestler Out their opponent get over from extremely impressive selling to a kick out of an iconic finishing move making a wrestler look credible Legitimate and heroic these finishes have elevated that wrestler and have actually created some of the most memorable moments in all of WWE so join us now as wrestling me a look set 10 WWE finishes that actually put the opponent over Be sure to subscribe and hit that notification bell for daily If you haven't already exclusive lists also check out wrestling me a code UK and an on wrestling channel incredible Number 10 Hulk Hogan's a leg drop rock in terms of protected WWE finishes the most protected of all time could potentially be The move was rarely kicked out of and if a wrestler ever managed to successfully kick out of it It was presented as a huge deal when the rock collided with Hogan at WrestleMania 18 and a dream match And Hogan performed a signature leg drop fans assumed that the match was officially over To the shock of the audience the people champion kicked out this kick out showed fans that the rock was as tough as they come And they also highlighted a clear picture of just how they valued the rock number nine The crazy thing is like people have hit the leg drop and they'll just kick out of it But when a Hulk Hogan hit his leg drop for whatever reason it was like getting hit with an atomic bomb You were done for the night. So it's crazy. How some finishers Used to be like I guess you could say Devastating back in the day and now they're just used as setup moves for example the super kick Shawn Michaels Super kick once it was hit nine times out of ten. You thought that opponent was done for now People to hit super kicks all the time and it's really not that effective the Cobra JTG WWE star JTG is mostly known for his work alongside In the popular tag team crime time However, fans often associate JTG for one of the most hilarious oversells in WWE history JTG was wrestling Santina Marella in 2013 on WWE Superstars and during the closing moments of the match He was hit with the Cobra for whatever reason JTG decided to sell the move by It was a fantastic cell that didn't just give credibility to Marella's often mock finishing move But it also showed fans as well as WWE Remember when I said sometimes you can oversell and it just become comical.  He was quickly moved down the card There was one highlight of his time as an in-ring competitor in WWE is viewed in the summer of 2000 with Jerry the King Lola with rather entertaining They showed that Taz had a ton of charisma Taz and Lola would collide at SummerSlam And they realized the match that the old ECW Taz was returning During the match Lola would hit Taz with a pile driver. Lola's pile driver is one of the most pretty He knows only wrestling Amazingly Taz come and it's crazy because this was in the video I was talking about with wrestlers no selling finishes. He knows sold it. No, he just got right back up like Try this again, bro. He knows all the move and immediately got to his feet This made him like a monster and the reaction from the attitude our audience spoke volumes of how well received the particular spot Where's that's crazy.  That's common I'm pretty sure we know what clip He's about to show Ricochet is Fantastic at selling and making you look like a million bucks and oversell to go viral and in turn make the person responsible for the oversell Insanely popular with fans. This was certainly the case when Ricochet over delivered an unbelievable sell of the iconic RKO in 2019 this was really good During ricochet's match with like he broke his neck. You'll see the closing moments of the match as Randy Orton would slide Sales of the RKO any wrestlers ever delivered Praced ricochet on social media ricochet, man If you want your move to be devastating hit up ricochet One of the reasons why the seller the RKO was so notable was that it didn't just make ricochet look like one of the best sellers in Oh my god, bro, they made the RKO look incredibly devastating It was simply marvelous work from the former US champion number six the tombstone Shawn Michaels They claim showdown between Michaels in the Undertaker 25 It's gonna be a match that is celebrated for decades to come for sure The most memorable spots in the match took place when taken performed a tombstone pile driver on HPK This finishing move had been protected to such an extent that it was rare that anyone would ever kick out of it Only a select few wrestlers had ever kicked out of the move and HPK was one of them The dead man performed the move but to the shock of fans in the audience HPK kicked out Unbelievable to witness kick out made HPK look like the ultimate baby face and the undertaker's insane reaction to his kick out Took the spot to a whole new level When he initially kicked out that first time and you have Jim Ross calling it bro. I thought for the very first time. Oh Shit, I think he made in the streak here. I had goosebumps.  If you have not seen it. I haven't seen this match I don't know how you haven't go check it out. WrestleMania 25 Undertaker pressure Shawn Michaels Oh number five manhandle slam Bianca Belair I love this move in a ton of effort into making sure Becky Lynch's manhandle slam was protected This was the move that Lynch would squash Belair with back in 2021 It was a move that whilst not too impressive visually was awarding Lynch great success Yeah, I like the move when Lynch and Belair collided once again at WrestleMania 38 The first few moments of the match Yeah Was speechless. I thought the match was over.  Oh, no, they're about that. No way. They're gonna screw out of this, right? No way. She loses like this. No Believe that the match was going to end Thankfully Belair kicked out kick out may bella even more credible. Let's show that this wasn't the same Bella that Lynch had defeated months prior I was like, no, not this way Yep Replicated by talents such as John Cena and Kevin Owens. Yeah, when fans think of the stunner They often think of the rock sell of the move as whenever Austin and the rock were collide in a match The rock sold a move in the most over-the-top way imagine Really help elevate the rock and make the few between the two legends even more memorable The reason for the rock selling the stunner in the manner He did was that he wanted to make Austin laugh The great one would try to make each more cell outlandish than the last number three And the crazy thing is a lot of I've seen some people say they're not a big fan of when the rock would over sell the stunner They kind of feel like it took away from it And I can understand that cuz he would be flopping all over the place But as a kid watching it bro, I thought that was the funniest shit ever I thought it was the coolest shit ever even watching it back now I can appreciate the comedy in it or whatnot. I don't know man It worked when he got here with the stunner. You knew like it's just it worked. You know I'm saying so I'm one of those people where if it makes sense and you know, it's entertaining for the most part I'm cool with it even though the cobra and uh, what's his name? JTG I think I said about JTG selling it over selling it It was funny. It was mean worthy. It's just I couldn't take the wrestler series But I could take both of these guys seriously even if the rock is flopping around like a fish It's the Rockets don't go the running knee Kofi Kingston A Kofi mania was one of the most compelling storylines of the modern era and the work of everyone involved was exceptional The Kofi mania storyline began at the elimination chamber pay-per-view in 2019 this Kingston was involved in the elimination chamber match for the title and the final two in the match were Kingston and reigning WWE champion Daniel Bryan WWE decided to do something different for the match and Kingston and Bryan would have had a full on 10 minute epic war As a blessing was so good during this mini match at Bryan would hit his trademark running knee on Kingston and fans believed It was actually over. So he's running knee was protected as a finishing move Yeah, great indication that the match was finally over But Kingston managed to kick out and you could tell by the reaction from the audience that they thought the match This this this this moment here Solidified as Kofi Kingston. It was his time. It was his time. Oh, this was so good Dately over Kingston kicking out of the mood showed that he was a heroic baby face And that he was quite rightly presented as a huge deal It was expertly done and this particular spot really helped plant the seeds for Kingston's WWE title victory at WrestleMania 35 Number two the end of days drew McIntyre a Baron Corbin's Unprecedentedly protected up until April 2022 finishing move was so We didn't even have top talent such as John Cena and Roman Reigns kick out of the move However, when it came to Drew McIntyre, they made an exception Corbin would hit the end of days and it was believed that Corbin had just secured the victory And one of the most shocking moments in recent times at McIntyre kicked out That shit was a great great moment Cuz usually I mean he had a hundred percent rating with that like a hundred percent from the field No one kicked out of the end of days since he was in WWE Nobody kicked out of it. It was the most protected move at that time And he kicked out at WrestleMania and I was like, oh, he's about to win.  That was a surprising moment Baron Corbin. I love his end of days End days such a beautiful transitional move. You can just hit somebody with it. It just looks so good and devastating Now it's handled really well by WWE It was a satisfying payoff to years of protecting one of the best finishing moves in WWE and number one Stone Cold Steve Austin Yeah One of the most important double turns in all of WWE Steve Austin with faceoff against arch rival Bret Hart and the matches known for Austin ascending to the very top of the wrestling world The match itself was tremendous But it's the final stages of the match which truly stand out Following the then babyface heart-showing heel tendencies throughout the match Locking the sharpshooter on Austin at this stage Austin's face was covered in blood And it ultimately created a visual that would be synonymous with the career of the Texas rattlesnake Instead of tapping out Austin pass out from the pain He refused to give up in the most babyface act possible The reason this works so well is that it still kept the legitimacy of Hart's finishing move in time While still presenting Austin as a never-seen-die wrestler that was never gonna surrender He was masterfully delivered by both men and Austin quite rightly refers to the match as the greatest song he ever sang That match right there that that was so it worked so well because He didn't tap out He didn't tap out. He passed out due to the pain and people buy into that Yeah, he lost the match but people buy into that gives like oh, bro. He's really tough He tapped everybody else taps. He passed out blood running down his face passing out. I refused to quit Love that, bro. I love the end of double turn, you know, once that happened Stone Cold what he had to be a face It was gonna be impossible to not want to cheer the guy that didn't tap out to the sharpshooter You know damn. I want to see him try to get the title from I want to see him go for the title I want to see him where he can go cuz he didn't Brett can even make them tap, you know I'm saying so I can appreciate that double turn It was a legendary moment in wrestling legendary moment for both Individuals both wrestlers. So yeah, man, this was a great video man. Comment down below. Let me know I want to know what's your favorite finisher of all time. It doesn't anyone you have to even be in WWE it can be AEW new Japan. Let me know your favorite finisher of all time For me personally, I when I think of a finisher, I'm probably gonna go I'm thinking more so RKO is really good that RKO is so good, especially depending on how it's hit RKO is fantastic But I think for me always It'll either be out of the rock bottom or the stone coast and I love those moves Just cuz I love the wrestlers man. So comment down below. Let me know about appreciate all love support Roll to 100k appreciate y'all kicking me. See y'all on the next one. Peace


Hello friends, welcome to SSUnited. My name is Susheel Singh and this is continuation of SQL Server interview questions and answers. So today we are going to discuss about what are the real time use of unpivot operator. When interviewer ask such type of question to us then they want to know have we used these objects in our real time scenario or not. So here I have created a scenario if interviewer ask this question to you then you can explain this scenario to interviewer. So let's move to another slide where I have created a scenario. So here we can see we have two input tables. First table contains the information of location and second table contains the information of invoice. So in our first table we can see we have column 1 which is location and this is our form location and rest of the columns contains the information of two locations. So here we can see when we want to deliver any item from location Mumbai to location again Mumbai then it doesn't take any time. So if any customer purchase any item on the same day it would be delivered. If item would be delivered from Mumbai to Bangalore then we can see it takes three days. In our second table it contains the information of invoice as you can see we have invoice number customer ID date from location to location and in our output we can see invoice number customer date from location and to location is same. But we want to calculate the expected delivery date would be calculated from location table. But here we cannot apply join between these two tables because location table doesn't contains the data in normalized form. So how we can get the normalized data. So we have to rotate our columns to our rows. So it would be very helpful by using join we can get the output. So how we can do the same. So let's move to another slide. So this is our slide by using unpivot operator we can rotate the column values to our row values. As we can see we have from location and then to location. To location comes from columns like Mumbai is our from location then to location is Mumbai and then second column is Bangalore then Bangalore then third Delhi so Delhi Lucknow then Kolkata so it's Lucknow and Kolkata and value is 0 3 as we can see in our input table. Once we will get the data from this format then we can simply apply join between invoice table and this unpivot output table then we can simply calculate expected delivery date. So how we can rotate this table to normalized form. So let's move to SQL Server Management Studio as I am using SQL 2014 you may have another version of SQL Server but query would be same for all the versions. So here I have already typed the query to create the table. So first I gonna create location information table. So this is location information table so table created successfully and then I wanna insert some record 3 rows affected then I gonna create invoice information table. So execute this statement table has been created successfully and then we gonna insert record on it. So we can see 4 rows affected as we can see in our slide. So now we have location information table and we want to rotate this location information table. So how we can rotate select star from our table as we can see it contains the information as we have explained in our slide. So we have to use unpivot as we are using pivot operator in our previous slide. If you haven't seen that video I would strongly recommend to watch that video. So it would be very helpful to be understand. So first of all we need to write unpivot then we have to specify the value. So value column should be number of days and for what we want to get this number of days so we have to specify 2 location. So this is our 2 location. Then we have to use in operator and then we have to specify the column name. So first is Mumbai and second is Bangalore and third is Delhi then Lucknow and then Kolkata. So we have to specify unpivot. So I am using an alias UN. Now I am going to execute this query. Once I would execute this query then we can see we are getting location and then number of days then 2 location and in our slide we can see. So from location to location and then the value. So this is our value column. So we are getting the output. Now I am going to insert in a temporary table into as temp so 15 was affected. Now we need to apply join between invoice table and this unpivot output table. So select as tick from this is our invoice table. Now we need to apply left join because you want to get all the information from invoice table. Doesn't matter it would be a label on this temporary table or not. So this is our temporary table I am going to put an alias as T and this is our invoice table I want to put an alias with I and then I dot this is our from location should be equals to T dot this is from location and then I dot this is our to location should be equals to T dot to location. So I want to execute this selected statement. Once this selected statement would be executed then we can see number of days are coming over here from location to location all the information are coming. But we don't want all the information we want all the information from invoice table and just want to get the number of days values from this temporary table so T dot number of days. Now we can execute and we can see number of days are coming but we want to get expected delivery date. So we need to use date add function then we need to add days then increment values should be number of days then we want to add this date and now we can execute and we can see it's coming expected delivery date expected delivery date now we can execute and we can see our output and we can compare between slide and our output as we have achieved. So here we can see our advice number I1 expected delivery date is 17 so it's same and second 21 and then 32 and then again 22. So we are getting same output as we have explained in our slide. So I hope you have understand how we can get this output by using unpivot operator. So if you like this video please subscribe our channel to get many more videos and press bell icon to get notifications for new updates. If you need this script it would be available on my Facebook page. You can copy from there. Thank you so much for watching.