Complex Systems - Jean-Philippe Bouchaud - Lecture 5: Optimal Liquidation (Valentina Ros) — Transcript
Full transcript
- 0:01this conference will now be recorded
- 0:05okay so before we start uh let me just
- 0:11a warn you of the fact that we forgot to
- 0:13record the previous lecture but there
- 0:16will be lecture notes that I will upload
- 0:18uh to our ens folder so at least the
- 0:22material will be there available for
- 0:24everybody to read and I saw that there
- 0:27are some questions on both homeworks and
- 0:30lecture notes in the question and answer
- 0:31five so now we go through them between
- 0:34today and tomorrow
- 0:35so hopefully that will also be addressed
- 0:39uh very soon
- 0:41okay and now let's come to the topics of
- 0:45the uh today of today which is related
- 0:47to this problem of optimal control that
- 0:51was discussed uh in the last lecture so
- 0:54uh what we're going to do is go through
- 0:56this exercise so we will do the main
- 0:59part and then there are some
- 1:00calculations that I will leave
- 1:02an exercise and if there is time I will
- 1:05go back to uh to the final part of today
- 1:09number three uh just to discuss a little
- 1:11bit how to solve for the stationary
- 1:13state of soccer plank equations for
- 1:17multiplication noise so that's uh quite
- 1:20an easy thing but it's good to see it at
- 1:23least once uh as a Blackboard
- 1:27before let's start with with the today's
- 1:32the text
- 1:35mail
- 1:36and the idea is to discuss a simple
- 1:39application of this Hamilton Jacobi
- 1:42Bellman equation
- 1:43and the problem that we have in mind in
- 1:45here is you can think of it as a problem
- 1:48of optimal liquidation which means that
- 1:52there is a summaries or some agents that
- 1:55has for instance x times zero a given
- 1:58amount
- 1:59q0 of some tradable instrument as we
- 2:03call it here so this can be whatever you
- 2:05can even think about some stocks uh that
- 2:09you have at time t equal to zero and you
- 2:12would like to sell all of this uh
- 2:14quantity of uh of stocks or of this
- 2:17instrument and you want to do it before
- 2:19a given final time T so this is the
- 2:22finite time Horizon and the question is
- 2:25what is the optimal way to do this so
- 2:27what is the speed at which you should
- 2:30sell should you try to sell everything
- 2:32very fast at the beginning or should you
- 2:35somehow have a strategy that is more
- 2:37flat over this time interval or or let's
- 2:41say in general what is the best way to
- 2:42do this
- 2:43and we will try to discuss two
- 2:46Frameworks so the first part is about
- 2:48let's say one single agent that has to
- 2:52face this uh optimization problem and
- 2:55the second part is uh about uh so in the
- 2:58second part we will introduce some
- 3:00interactions that we will treat at the
- 3:03mutual level so the idea is that you
- 3:05have one agent that wants to sell its
- 3:07quantity of each amount of this uh of
- 3:11these stocks let's say but he or she is
- 3:14not alone and there are many others with
- 3:16whom there is some interaction
- 3:19okay so let's start with uh with part
- 3:22one
- 3:23and let me summarize a little bit
- 3:26uh what are the quantities uh let me
- 3:29first uh let me
- 3:31um tell you that the way we will treat
- 3:34this problem with interaction uh Falls
- 3:37within the framework of the so-called
- 3:39meaningful gains and there is some
- 3:40reference in the text of the today that
- 3:42you may look at if you're interested
- 3:44into this subject of maybe games
- 3:47okay but first let's start with uh with
- 3:50a single agent
- 3:53foreign
- 3:58so there are some random variables which
- 4:00describe the state of your systems that
- 4:03I will encode into a vector Y which
- 4:06depends on time
- 4:07and these random variables are Q
- 4:10Depending on time are some X of T and
- 4:14some f of t
- 4:17so this Q is the amount of instrument
- 4:21that you want to sell in this finite
- 4:23time interval so I will call it to be
- 4:25inventory
- 4:28it's time t
- 4:30x is essentially the amount of money
- 4:33that you make out of this selling so I
- 4:35will call it the wealth just to
- 4:39uh just to have a name for it and X is a
- 4:43variable which does not describe
- 4:44directly the state of the agent but if
- 4:47you want to describe the state of uh of
- 4:50the market in some sense so this is the
- 4:52price Associated to uh to the object
- 4:55that the agent wants to sell
- 4:59and of course this quantity are a
- 5:01dynamical quantities so they satisfy
- 5:03certain equation of motion in time
- 5:06so in particular
- 5:08Q of T will vary over time because of
- 5:11course it will decrease whenever you are
- 5:13selling this quantity and it will
- 5:16decrease proportionally to some
- 5:18velocities that I call VT
- 5:21and the velocity is precisely the
- 5:24control so it is the function of time
- 5:27that you on which you have some power so
- 5:30you can choose how fast you want to sell
- 5:32this quantity over time so let me call
- 5:35it as we did in the lecture
- 5:39the control
- 5:42so you see that when you're selling this
- 5:45quantity is diminishing and so your
- 5:46velocity is is negative in this
- 5:49definition
- 5:51then how much money do you make in an
- 5:55interval DT by selling this quantity
- 5:56well this is this has to be proportional
- 6:00to minus VP
- 6:02times uh what what you would put in here
- 6:06a priority would be
- 6:08somehow the price of of the quantity
- 6:11that you are selling
- 6:13uh that that is given by S of T but then
- 6:17the idea is that when you do this type
- 6:19of financial operation let's say there
- 6:21is also a cost which is associated to
- 6:23the fact that you are selling or uh or
- 6:26buying and in the model that we will
- 6:28consider today the cost we will take it
- 6:30to be simply proportional to the
- 6:32velocity at which you are selling these
- 6:35quantities so I will introduce
- 6:37in here
- 6:39an additional factor of K times the
- 6:43velocity and this is telling you that
- 6:46essentially when you are selling so this
- 6:48velocity is negative the effective price
- 6:51at which you sell your your good is uh
- 6:56is let's say the price of the good
- 6:57itself minus the cost Associated to the
- 7:00operation which is uh which is given by
- 7:03this kvt
- 7:04and then you have an equation for the
- 7:07third dynamical variable in here which
- 7:09is the price
- 7:11and uh and this will be given by some
- 7:15quantities that I call MU of t
- 7:18and this function mu is uh is where the
- 7:22interaction will enter when we will
- 7:24discuss it uh in in part two but for the
- 7:27moment let me write it generically like
- 7:29this
- 7:30plus what we can do is to add some noise
- 7:33so some volatility that tells you that
- 7:35there are fluctuations uh in the price
- 7:37that due to uh two different reasons and
- 7:41that you encode generically into into
- 7:43some noise term so just to give you some
- 7:46terminology this quantity in here that
- 7:50decreases uh the price is uh often
- 7:54called in this literature market price
- 7:58and this quantity here which controls
- 8:01how the price is varying with respect to
- 8:04the to
- 8:05say some external input which may
- 8:09contain uh also the state of of other
- 8:12agents is what is usually called so let
- 8:15me try to put an arrow like this it's
- 8:17called Market impact
- 8:19and can you put up the Blackboard a
- 8:22little bit because it's out of the sure
- 8:25this way
- 8:29perfect thanks
- 8:32okay that's good
- 8:35okay so this is what we are going to
- 8:36discuss in part one now let me just uh
- 8:39mention what shall one do uh to
- 8:42generalize this to the case of many
- 8:45agents so I will be a little bit floppy
- 8:47in here but
- 8:49let's say that the idea is that
- 8:53if you have many agents you can label
- 8:55them with some index a so you will have
- 8:58one of these State vectors
- 9:01the Y of T will go to some y of T
- 9:05labeled by a and a identifies each of
- 9:09your agents so let me
- 9:11assume that they go from one to n
- 9:13and the interaction between them as I
- 9:16said will enter through this quantity mu
- 9:20in here and what we are going to
- 9:23consider in the following is the case in
- 9:26the in which the MU
- 9:27and let's see that enters into the
- 9:30equations for the agent a
- 9:33is the average of the velocities of all
- 9:38of the other agents in the in the market
- 9:41let's say so I will think about
- 9:43something like this this will be one
- 9:46some one over and some overall other
- 9:49agents of
- 9:52their velocity
- 9:54and what we will we will do in part two
- 9:56is to go to some sort of continuous
- 9:58limit and replace let's say this average
- 10:01with with A continuous average but I
- 10:04recommend more about this in the
- 10:07following
- 10:08okay so to conclude uh the introduction
- 10:10to the model what I have to do is to
- 10:13specify the objective function or the
- 10:16cost function which is actually a
- 10:18functional which depends on all of the
- 10:21trajectory over time of this Vector y
- 10:25so let me call it g
- 10:27of
- 10:29e0 and Y 0 so t 0 and 1 y 0 are the
- 10:33initial time and the initial condition
- 10:35and this function is given by the sum of
- 10:38two terms
- 10:39so there is a first term which is the
- 10:42game
- 10:43that is actually just a function of the
- 10:46final State the state at time capital T
- 10:50of your system that I will write in a
- 10:53minute and then you have some so this is
- 10:55the game
- 10:57that you want to maximize
- 11:00and you have also some cost which
- 11:02contributes to this objective function
- 11:04which is the integral from the initial
- 11:07time to the final time
- 11:10of
- 11:12your inventory to the uh to the power
- 11:16two so this is something that penalizes
- 11:18you whenever you still have uh the
- 11:21quantity of of your good uh to sell and
- 11:25you have not yet uh sold uh all of it
- 11:29so this will be a cost Associated to the
- 11:33fact that you have still a finite
- 11:35inventory at any time uh s here
- 11:39and uh how do we write the gain well
- 11:43so again this is an example of a model
- 11:48that we take here and in here we choose
- 11:51the gain to be to be what well you have
- 11:54the final wealth uh that you get by
- 11:56selling your quantity at the final time
- 11:58capital T that of course you want to
- 12:01maximize
- 12:02and then if you are left with some
- 12:05amount of these quantities that you have
- 12:07not yet sold then there is some value
- 12:10Associated to it that in principle would
- 12:13be the product so the amount of this
- 12:16quantity times the price at that
- 12:19particular uh final time but again you
- 12:22may have uh or it is realistic to assume
- 12:26that the price is not really so a little
- 12:28bit similarly to what you have in here
- 12:30uh the final price is somehow diminished
- 12:33by the fact that maybe you want to
- 12:36liquidate at finite time T so you really
- 12:38want to sell whatever you're left with
- 12:40at the final time and when you want to
- 12:44sell it so fast at the end there might
- 12:46be a penalty so let's say a cost an
- 12:49execution price this is how it is hold
- 12:52associated with selling at the finance
- 12:55time which again diminishes the uh the
- 12:57effective price
- 12:59at the time capital T
- 13:02okay so what we're gonna do is to try to
- 13:05look at this example and derive some
- 13:08Hamilton Jacobi Bellman equation for
- 13:11this particular model
- 13:15and before let me check that you see
- 13:19okay
- 13:22so let's start with the first part and
- 13:24before let me just make a comment so
- 13:26this is part one
- 13:33so the first point is is just a comment
- 13:35if you want to uh if what we can do is
- 13:39to look a little bit at the model and
- 13:41try to figure out how many parameters we
- 13:43have which are quite many so we have two
- 13:46parameters which enter into the equation
- 13:48for the price which are Theta that
- 13:51measures uh among the strength of this
- 13:54Market impact and we have the variance
- 13:57Sigma Associated to the noise
- 14:00and then you have three other parameters
- 14:02so this Kappa here in the equation for
- 14:05the wife
- 14:07and uh whereas we have the Phi in in the
- 14:12in the cost function there and we have
- 14:15capital A which controls some of the
- 14:19cost Associated to selling everything at
- 14:22the final time
- 14:23and what I just want to point out so we
- 14:25will go back to analyzing a little bit
- 14:28the effects of these parameters and once
- 14:31we have the solution to the problem but
- 14:32I just want to uh pose a moment to to
- 14:35figure out uh what should be at the
- 14:38effects of all of this parameter in
- 14:40particular of the last three
- 14:42and the idea is that more or less the
- 14:45parameters Phi and the parameter capital
- 14:48a Are quantities that uh won't you or
- 14:52push you to sell faster in a way right
- 14:55because Phi is associated to the uh cost
- 15:00that you pay at any time by having a
- 15:03finite inventory so it's due to the fact
- 15:06that you have not sold everything at
- 15:08that time and so there is a cost
- 15:10associated with so when this high is
- 15:13large you expect that you want to choose
- 15:15a velocity that is somehow fast enough
- 15:17so that you have all of this quantity
- 15:21fast enough and more or less the same
- 15:23role is played by this uh capitalane
- 15:25here
- 15:26uh whereas K as you see here penalizes
- 15:29uh those choices in which you uh sell
- 15:33very very fast because if you sell very
- 15:35very fast you are diminishing the
- 15:37effective price for your good and
- 15:40therefore you are diminishing the total
- 15:42wealth that you are making
- 15:44so this is just to point out that Phi A
- 15:47and K are a little bit in competition so
- 15:51this would want you to sell fast
- 15:55and this would want you to sell
- 15:58not so fast let's say
- 16:03so the problem is not uh totally trivial
- 16:07okay so having said this what we can do
- 16:10now is to try to derive uh Hamilton
- 16:13Jacobi Batman equation along the same
- 16:16lines
- 16:17okay uh
- 16:20of lecture four
- 16:25so now
- 16:29but why is it cut
- 16:31my video
- 16:34okay
- 16:38okay so let's
- 16:40try to derive this Hamilton Jacobi
- 16:43Batman equation
- 16:46so to do this I will introduce uh let's
- 16:49say just for notation let me call small
- 16:53y a particular value for the vector for
- 16:56the random variable Capital wiser so
- 16:59this will be the vector given by small
- 17:02Q's Molex
- 17:03and small s
- 17:06so these are my state variables
- 17:08and let me introduce as it was done in
- 17:12lecture four the so-called cost to go
- 17:18okay
- 17:19which is a function V of time and of a
- 17:25particular configuration of of my system
- 17:27at the time T and in general so what we
- 17:30are gonna do in this first part as I
- 17:32said is to work at fixed value of this
- 17:35function I'm one of the most B so we are
- 17:38not assuming that this comes from
- 17:40interaction but just that somebody gives
- 17:41you uh this function and then you try to
- 17:44solve the optimization problems for
- 17:46these dynamical system so this is why
- 17:48there will always be a dependence on
- 17:51this fixed function mu of T in whatever
- 17:53I'm going to do in this first part
- 17:56and what is the definition of this cost
- 17:58well well this is the soup over
- 18:00the velocity
- 18:02t
- 18:04at any later time of the expectation
- 18:07value of my cost function up there
- 18:12from uh
- 18:14so as you see in the way that I wrote
- 18:17so this is an expectation value over the
- 18:19noise it's an average over the noise and
- 18:21I wrote the cost function so in
- 18:23Principle as I say this is a function of
- 18:26the whole uh let's say trajectory for
- 18:28your vector Y at any time but I'm
- 18:32indicating in here only the dependence
- 18:34on the initial condition so this is the
- 18:36cost that you get starting at time t 0
- 18:39from a given configuration let's say y0
- 18:43and therefore what I have in here is uh
- 18:46is the following so I assume that I have
- 18:49some time T that is larger than zero but
- 18:52smaller than capital T and I assume that
- 18:55I know uh what is the optimal strategy
- 18:58to follow from that time T
- 19:00onwards and this defines precisely my uh
- 19:04my cost to go
- 19:06so just to repeat
- 19:09a little bit the sketch
- 19:13of the lecture
- 19:15the idea is as follows so you have time
- 19:19you have your final time capital T
- 19:23and then you assume that you know how to
- 19:27solve the problem at any time so this is
- 19:29zero at any time late larger than this T
- 19:33here so in this region you assume that
- 19:35you know
- 19:38what is the optimal strategy to follow
- 19:40so what is the cost to go and you know
- 19:41this for any possible
- 19:44initial value at a time a small T so in
- 19:48in the lecture of course the problem was
- 19:50formulated in terms of a one-dimensional
- 19:53function here we have a vector so let me
- 19:55draw it like this
- 19:56uh
- 19:58so of course this is higher dimensional
- 20:00but the idea is that whatever is the
- 20:03particular value of the vector y s time
- 20:05T you know what you have to do from time
- 20:08T onwards so you know what is the
- 20:10velocity that optimizes uh that gives
- 20:13you the optimal strategy up to the final
- 20:16time
- 20:17and the question is once I know this for
- 20:20any particular initial point it's time T
- 20:23can I derive an equation that tells me
- 20:27what I should do in the little time
- 20:30interval which is between T minus DT and
- 20:33N time t
- 20:36and that is that to choose the optimal
- 20:39strategy in this user-time interval I
- 20:41have to usually if you remember from the
- 20:44lecture I always have to compensate
- 20:46between two things
- 20:47so first of all I told you that we know
- 20:49how to solve the problem for larger
- 20:51times
- 20:52so we know the value of the cost to go
- 20:55for any particular choice of why and
- 20:58therefore for instance we know what is
- 21:00the best point where to start from that
- 21:02would optimize our gain at the final
- 21:05time t
- 21:06but then we assume that at time T minus
- 21:09DT we are in some particular initial
- 21:12condition some particular point and it
- 21:15might be very costly to go uh from that
- 21:17particular point to the initial
- 21:19condition at time T which optimizes your
- 21:22your total gain because there is some
- 21:24cost Associated for instance to moving
- 21:27much into this small interval DT so you
- 21:30always have to compensate between the
- 21:32extra costs associated with movement in
- 21:36this small step and again that you would
- 21:38have from the final point that you reach
- 21:41with this movement up to the final time
- 21:44and this is what gives you an
- 21:46optimization equation which is which is
- 21:50not totally trivial
- 21:52so let's see this and uh just a reminder
- 21:55so in the in the lecture the cost which
- 21:58was Associated to this small step was
- 22:00essentially uh due to the elastic term
- 22:03in here things will be a little bit
- 22:04different but let me show this
- 22:07concretely
- 22:09okay so to derive this uh Hamilton
- 22:11Jacobi Bellman I will do
- 22:15introduce
- 22:17just for the sake of notation so I will
- 22:20introduce
- 22:23uh I will call the Velocity in this at
- 22:27this time T minus DT which is what we
- 22:29want to optimize over I will just call
- 22:32it U to simplify the notation
- 22:35and then I will assume and I will cause
- 22:37the noise
- 22:38in this interval T minus DT simply by
- 22:42ETA
- 22:44um writing
- 22:46and we can see what you're writing
- 22:48you're right but I don't know why okay
- 22:51wait
- 22:54ah now I see because I'm not moving
- 22:58the camera
- 23:01okay
- 23:06now you see it
- 23:09foreign yes okay
- 23:13so I was just introducing I mean I just
- 23:15want to drop this dependence on T minus
- 23:18DT and I will assume that if I start at
- 23:24a point why
- 23:26no let me write it like this so if I am
- 23:28at a point Y at time T minus DT
- 23:33at time T I will be at a given point
- 23:38y plus b y
- 23:44and this b y will depend on what well it
- 23:47will depend both on the velocities that
- 23:50I choose in this small interval DT and
- 23:53and it will also depend on the noise uh
- 23:56in this small intervality and so I will
- 23:58try to solve an optimization problem for
- 24:00this velocity in the interval DT
- 24:02averaging over the noise in this small
- 24:05interval DP so I'm just repeating what
- 24:07was done in the lecture
- 24:10and so to derive this equation what we
- 24:13have to do so does it fit in here
- 24:17so what I can do
- 24:21is to try to write an expression for the
- 24:25cost to go
- 24:27at the previous time P minus BT
- 24:31so V at T minus DT assuming that I am at
- 24:35the point Y at P minus V T So Y is a
- 24:38variable so I will use it uh
- 24:42here I use it for time T but now let me
- 24:46assume that y identifies my position at
- 24:48the previous time and let me drop the
- 24:51dependence on mu p in the following
- 24:55so what would be this equal to well
- 24:58exactly as we had in the lecture so as I
- 25:01said I want to optimize over my velocity
- 25:03in the legal interval you
- 25:06the uh total cost so the total cost will
- 25:09have two contributions
- 25:11there is one contribution that comes
- 25:13from the extra cost Associated to this
- 25:16small step that I'm doing and this is
- 25:19proportional
- 25:20to this integral in here
- 25:24that's given that the time intervalism
- 25:27is very small I can approximate as minus
- 25:31Phi Q squared
- 25:32DT
- 25:35where Q is one of the components of this
- 25:37Vector y the first one
- 25:40and then the remaining cost is encoded
- 25:43in uh in the function that I assume that
- 25:46I already know so it is encoded in the
- 25:48cost to go from time T except that I
- 25:52have to compute this cost to go and to
- 25:55the point that I reach starting from
- 25:57point Y at the previous time and
- 25:59applying the given velocity U so what
- 26:02this means is that in here I will have
- 26:04my function V at time D but computed at
- 26:09y plus d y
- 26:12and Y plus d y is is noisy so it depends
- 26:15as I said both on this small U that I'm
- 26:18optimizing over but it also depends on
- 26:20the noise which acts in the small
- 26:22interval so what I have to do is to
- 26:24average uh that function there with
- 26:27respect to this noise in the small time
- 26:30interval
- 26:32okay and now exactly as we did in the
- 26:36lecture the the way to proceed is to
- 26:38give an expansion a failure expansion
- 26:41for this function here and then average
- 26:43over the noise
- 26:48so let me do it in here
- 26:54what do you see so we need
- 26:57this which I think you still see okay
- 27:17but now I have to received a little bit
- 27:42okay
- 27:46so let's try to expand and we want to
- 27:49expand to linear order in DT so this is
- 27:52V of Y plus v y
- 27:56uh and in order to uh to do the
- 27:58expansion we should remember what are
- 28:00the equations so remember that Y is
- 28:03the vector of all our three variables
- 28:05which satisfy some equations which are
- 28:07just erased
- 28:09but you have them written so let me do
- 28:12this uh Taylor expansion here so the
- 28:15first term will be just real
- 28:17d y of course
- 28:20and then I have a term which is the
- 28:22partial derivative of my function V with
- 28:25respect to the first uh sorry I forgot
- 28:27the DT
- 28:31I hope that you see it there is a small
- 28:33bit in here
- 28:36Plus
- 28:37DV over DQ and here I would like to put
- 28:41Q dot times DT right
- 28:45so the derivative of Q over time times
- 28:47uh the DT and the derivative of Q over
- 28:50time we have it from the equation so
- 28:52this is just given by U times DT where U
- 28:54is the velocity in the small interval DT
- 28:59then we have to take the derivative with
- 29:00respect to the variable X
- 29:03foreign
- 29:05x dot if you want so the time derivative
- 29:08of x and this was minus
- 29:10the velocity times the price
- 29:14plus k u
- 29:18okay
- 29:19and then there is the derivative with
- 29:22respect to S will be V over DS
- 29:25and the equation for S dots sorry I keep
- 29:28forgetting the DT
- 29:33there is always a DT so the equation for
- 29:35s dot was what so there was the Theta
- 29:38term
- 29:39we will see
- 29:41times DT let me put it at the end so
- 29:44there was Theta mu of t
- 29:51uh this one you're right
- 29:55exactly
- 29:57thanks
- 29:59so here we have Theta mu and then there
- 30:02was a noise term so let me write it like
- 30:04this so that was Sigma times
- 30:08each of the DT
- 30:12and so let me put a detain here
- 30:16okay
- 30:18I'm becoming messy sorry
- 30:21um and here we have so remember this is
- 30:24White Noise I I didn't specify but I'm
- 30:26assuming that this is quite nice so
- 30:28remember what we discussed last last
- 30:30time namely that this noise in the in
- 30:33the limit of uh correlation function
- 30:35which goes to a Delta function ease of
- 30:37the order of 1 over square root of DT
- 30:41and therefore the product it of T times
- 30:44DT is of the order of square root of BT
- 30:47and this tells us that if we want all of
- 30:50the contributions which are awarded DC
- 30:52we also need to take the term which
- 30:55comes from the square of this uh factor
- 30:58in here and this will come with the
- 31:00second derivative
- 31:02of V with respect to the variable s
- 31:07right because then this will be
- 31:09multiplied essentially by uh the square
- 31:13of this equation of motion for S and let
- 31:16me just keep the contribution that is
- 31:18awarded DT which is
- 31:20of the form
- 31:22so let me write it like this
- 31:26ETA Square Times DT square plus higher
- 31:29order terms that we will neglect when
- 31:31deriving the uh
- 31:33when going to the continuous limit
- 31:36so now what I do is I take the average
- 31:39of this expression with respect to the
- 31:41noise
- 31:46okay both of the left and the right hand
- 31:49sides
- 31:50so this was what I called eat them
- 31:52before it's the noise which acts in the
- 31:55little time intervals and you see that
- 31:57once I take the average so this is
- 31:59independent this is independent this is
- 32:00independent the average of these uh
- 32:05is equal to zero because the noise has
- 32:07zero average whereas the average of this
- 32:10quantity in here is precisely equal to
- 32:16DT so it will give me the uh the
- 32:20contribution that I'm looking for to uh
- 32:22to linear organity so this is exactly as
- 32:25as it was in the lecture
- 32:27and once I have this what shall I do
- 32:30well what I can do is
- 32:32to
- 32:34um
- 32:34where is it
- 32:36to go back to the expression in there
- 32:38and substitute uh to the right hand side
- 32:41what I just derived so what I'm
- 32:44left with is V of T minus b t
- 32:48y
- 32:50let me bring this to the other side so
- 32:52that I have minus
- 32:54V of t y
- 32:57and then on the right hand side I have
- 32:59the sup
- 33:01over you
- 33:03of the first term which is untouched
- 33:07so now I have c q squared and the DPI
- 33:11will collect it at the end actually let
- 33:14me divide everything by DT
- 33:16directly
- 33:17so these terms come from uh the cost in
- 33:21the leader interval DT and then I have
- 33:23to plug my expansion so I have
- 33:25DV over DQ
- 33:28times U
- 33:30minus DV over DX
- 33:34you
- 33:36S Plus k u
- 33:39okay and then I add
- 33:42DV over the S Theta
- 33:45mu of t
- 33:47Plus
- 33:49Sigma Square over 2 this square of V so
- 33:53the contribution of the noise
- 33:55and that's it
- 33:57okay
- 33:59and of course if you if I now take the
- 34:01limit of uh DT going to to 0 what I get
- 34:05in the left hand side is nothing but
- 34:09minus the time derivatives
- 34:12of my cost to go with respect to teams
- 34:17okay so this is our form for today of
- 34:21the uh Hamilton
- 34:24Jacobi Bellman equation
- 34:27which is an equation where your time
- 34:29derivative has the minus sign in front
- 34:32as you remember from the lecture and
- 34:35were so this is no longer as we are used
- 34:37to we are used to initial value problems
- 34:40where we specify the value of the
- 34:42function at time zero and then we want
- 34:43to solve forward in times whereas what
- 34:46we have in here is more a boundary value
- 34:49problem where we specify the value of
- 34:51the function at time capital T and then
- 34:53we want to solve backwards in time and
- 34:55get the solution at time zero so what is
- 34:58the boundary value what is the value of
- 35:01the function at
- 35:03capital T
- 35:05well this we know it from the expression
- 35:08for the uh for the function G that
- 35:11unfortunately I erased but if you
- 35:13remember the function G had a cost which
- 35:16was Associated precisely to the value of
- 35:18this function at the final time plus
- 35:20sorry s again which is associated to
- 35:23that plus a cost and the cost is an
- 35:25integral which goes from T up to capital
- 35:28T so the integral Advantage is when I
- 35:30compute it at the lower Edge equal to
- 35:33capital T so this is just to say that
- 35:35the boundary value in here is just given
- 35:38by X
- 35:39flash Q
- 35:42s minus A2
- 35:46which is the value of the function G
- 35:49evaluated at a vector y so this is the
- 35:51boundary condition
- 36:02okay
- 36:04and now what we have to do is to try to
- 36:06solve this equation for the cost to go V
- 36:10and we try to do this and I don't
- 36:13remember if this is 0.2
- 36:16probably yes
- 36:19um
- 36:23yes so we try to do it with an answer so
- 36:27we we just
- 36:28[Music]
- 36:29um
- 36:30try to get to to guess a little bit what
- 36:33is the shape of this function B at any
- 36:35time and the guess comes from the
- 36:38structure that you see at the final time
- 36:40so as you see the your boundary
- 36:41condition is of the form
- 36:43X Plus QX
- 36:46minus A2 squared
- 36:50so what we can assume or try to guess
- 36:52this is an asset is that at any time T
- 36:55our function V has in some sense the
- 36:58stature so there is this linear term
- 37:00plus some genetic function of Q so we do
- 37:03the following answer which as we see
- 37:06we will see we simplify the calculation
- 37:09and now I hope that you see it
- 37:12so we assume that our V of t y can be
- 37:16written as
- 37:18X Plus Qs
- 37:21plus some generic function of time and
- 37:24only of q that I call Omega
- 37:27of d q
- 37:30and these answers is good because it
- 37:33allows us as I will show in a minute to
- 37:36reformulate the problem as more or less
- 37:40a problem in terms of uh of Q okay so
- 37:44let's see this uh how this works
- 37:48so what I have to do is just to replace
- 37:50this answer into my equation and see
- 37:54I think simplify a bit
- 37:57okay
- 38:02this is just algebra
- 38:15so on the left hand side I will just
- 38:18have minus the derivative of this
- 38:21forming a function with respect to time
- 38:23which is the only thing that depends on
- 38:24time
- 38:25and on the right well I have terms which
- 38:29do not depend on the velocity use so let
- 38:31me write them
- 38:33separately so there is this High then
- 38:35there is
- 38:37uh
- 38:39the Theta term
- 38:41DV over Dash
- 38:45your steep
- 38:47and perhaps already in here so you see
- 38:51if we make Visions that's the only
- 38:53dependence on S is linear so DV over
- 38:55Dash gives me just a factor of Q so let
- 38:58me write it here
- 39:01okay
- 39:02plus there should be another term up
- 39:05there which does not depend on you that
- 39:06is this second derivative but because we
- 39:09are making designs that which is linear
- 39:11we see that the second derivative
- 39:13vanishes so I don't have any
- 39:15contribution in this particular example
- 39:18which is proportional to uh to Sigma
- 39:20square and let me comment about this in
- 39:22a minute but before
- 39:25let's write what remains so what remains
- 39:27is the soup over you
- 39:30of what
- 39:32a few times the derivative with respect
- 39:34to q that gives me
- 39:36S Plus the derivative of w with respect
- 39:40to Q's we have a factor of U
- 39:42t w over DQ
- 39:45and then we'll have a factor of U times
- 39:47s
- 39:48but the factor of U times x comes us
- 39:51with the contribution the first
- 39:53contribution from the derivative over X
- 39:56which is simply equal to one so you see
- 39:59that the factor U times s will cancel
- 40:00and what I'm left with in here is minus
- 40:04okay
- 40:07U squared
- 40:10and that's it
- 40:13okay
- 40:16so our equation is now quite uh simple
- 40:19or simpler and we can directly solve for
- 40:24uh the optimal value of U so if we
- 40:26maximize this quadratic function what we
- 40:29get out of this is that U optimal
- 40:33will just be given by 1 over 2K
- 40:37times
- 40:39V Omega over the Q
- 40:45and if we
- 40:47now substitute this value of U optimal
- 40:50into this expression
- 40:52we see that the contribution in here is
- 40:54just
- 40:55one over four K times
- 40:58the Omega over DQ
- 41:01to the power 2.
- 41:02yes
- 41:05okay and this is the final form within
- 41:07our answer of the Hamilton Jacobi byman
- 41:10equation and let me add two comments
- 41:14which are actually point three of the
- 41:16exercise I think
- 41:21so the first comment is that this
- 41:25equation is a little bit different with
- 41:26respect to the one that was given in the
- 41:28lecture and the difference is that there
- 41:31is no diffusion term so the diffusion
- 41:33term would correspond in here to a
- 41:35second derivative of our function
- 41:38Omega and here the second derivative
- 41:40disappears because so in general the
- 41:43second derivative comes from the noise
- 41:45so from higher order contributions
- 41:48due to the noise as we saw in here
- 41:50and we are killing this contribution in
- 41:53here because the noise is only coupled
- 41:55to the price viable and we are making an
- 41:58assets which is linear in the price
- 42:00variables so in this particular example
- 42:02what we find is that our optimal
- 42:05strategy
- 42:09which will be the velocity
- 42:14does not depend
- 42:18on what
- 42:21people calling in the economics language
- 42:23the volatility so the fluctuations of of
- 42:26the price
- 42:30foreign so at least one among the many
- 42:34parameters that we have simplifies uh
- 42:36once we make and goes away once we do
- 42:39this onsets and the second comment is
- 42:41that there is no diffusion term so this
- 42:43is an equation which is uh non-linear
- 42:46because you have a derivative square but
- 42:48which is first order in the derivative
- 42:50so there is no
- 42:52diffusion term
- 42:57so it's a little bit simpler with
- 42:58respect to the one given in the lecture
- 43:01and indeed we can solve for for it
- 43:04explicitly
- 43:06as I will show right now
- 43:11okay
- 43:24so now what we can do is try to solve
- 43:26directly for this function Omega of Q
- 43:30and this is a calculation that can be
- 43:32done explicitly I will not do all of the
- 43:34steps but
- 43:38I will just highlight
- 43:40some things which are perhaps more
- 43:42interesting
- 43:45and so the first thing that helps you
- 43:49when you try to solve it
- 43:55is again so what we can do is try to so
- 43:59if you look at the structure of the
- 44:00equation I don't know if this is still
- 44:02visible yes
- 44:05so what one can do in general is try to
- 44:08write down so you have any function
- 44:11which depends on two parameters times
- 44:13and Q you can try to write down some
- 44:16uh let's say power expansion in your
- 44:19variable queue
- 44:20okay
- 44:21which in general has some coefficients
- 44:24that will depend
- 44:26on time and then you have q to the n
- 44:32so this is announced that's again that
- 44:34you can make in general but now if you
- 44:36look at the structure of our equations
- 44:37you realize that things are actually
- 44:40very simple so you can truncate this
- 44:43expansion and you will get only a few
- 44:46coefficients that you have to solve for
- 44:48and the reason is that so you see on the
- 44:50right hand side I have only terms which
- 44:53depend on at most on Q Square
- 44:55and then I have the derivative of this
- 44:58function with respect to Q to the power
- 45:012. and so you see that if I truncate
- 45:04this expansion to the power Q Square
- 45:06what I get on the right hand side are
- 45:09only terms which are at most of order Q
- 45:11squared and on the right hand side I
- 45:14will always have terms which are at most
- 45:16of the order at which I truncate and so
- 45:18I can close the equation just uh
- 45:21stopping to say n equal to
- 45:25so what this means is that
- 45:28I will write this in the following form
- 45:30so there will be an h0 of t
- 45:33plus H1 of T Q and then just for
- 45:37Simplicity let me put a minus in front
- 45:41of the quadratic term
- 45:46Q squared and this is in us so if I plug
- 45:49now this expression into my equations so
- 45:53you see on the left hand side I will
- 45:55have just the derivatives of the
- 45:56coefficients with respect to time on the
- 45:59right hand side I will have several
- 46:00terms and then I can equate all of the
- 46:03terms which correspond to the same
- 46:05powers
- 46:06of Q and if I do this I will get
- 46:08equations for this coefficients uh
- 46:11depending on T so I'll give you just the
- 46:13form of the resulting equation this is
- 46:16easy to uh to derive
- 46:20so the equation for h0 is of the
- 46:23following form
- 46:25the derivative of h0 will be equal to
- 46:28minus
- 46:29H1 of V over 2K
- 46:33then I have a
- 46:36the equation for H1
- 46:41which is minus Theta times this function
- 46:44mu of t
- 46:47plus 1 over 2 K
- 46:50H1 of t h two of t
- 46:55this comes from the square on the right
- 46:57hand side
- 46:59if you do the calculation and then I
- 47:01have the third equation for H2
- 47:04foreign
- 47:10Plus
- 47:121 over 2K
- 47:15H2
- 47:16Square
- 47:17depending on t
- 47:20okay so this is a system of equation now
- 47:23of course I also write a boundary uh
- 47:25term which gives me conditions for these
- 47:29functions at the time capital T so
- 47:32remember that due to our answer
- 47:36Omega of capital T Q
- 47:39will be simply equal to minus A2 square
- 47:42if you go back to the equations that we
- 47:44wrote before and so this means that at
- 47:47time
- 47:48capital t h 0
- 47:51and H1
- 47:55will be equal to 0 whereas H2
- 48:00is equal to minus 2A
- 48:07no plus 2A because I have a minus here
- 48:11foreign
- 48:13okay and now given this what one has to
- 48:16do is to solve uh somehow this system of
- 48:18equations for the coefficients so what I
- 48:21want to do in the next uh half an hour
- 48:24maybe are just two things
- 48:26so the first thing is that if you look
- 48:29at the factor of this equation you see
- 48:31that equation three
- 48:32is closed in the sense that it only
- 48:35depends on H2 so we can solve it
- 48:37directly and I just want to show how to
- 48:40solve this equation by a separation of
- 48:42variables because this is something that
- 48:44comes up uh came up several times in the
- 48:47lecture so we can just do this exercise
- 48:50once together in here and then what you
- 48:54would have to do is to solve for h0 and
- 48:56H1 and these are two coupled equations
- 48:58where the variables appear in both of
- 49:01them and most importantly you have now
- 49:04this function U of T so so far we said
- 49:06okay let's assume that mu of T is a
- 49:09fixed function and we try to look for a
- 49:12solution at fixed value of mu of T but
- 49:14now you see that to solve this uh this
- 49:17system of equations it would be nice to
- 49:19specify what is this function mu of T
- 49:22and this brings us to this idea of uh
- 49:25interacting systems and meaningful games
- 49:27so I will give the idea for that and
- 49:29then perhaps leave most of the
- 49:32calculations to uh to you as an exercise
- 49:36okay so this is the plan so let's start
- 49:38by solving equation three so this is a
- 49:40parenthesis if you want
- 49:43um
- 49:45just to discuss together this idea of
- 49:49separation of variables which
- 49:51comes up when you want to solve for the
- 49:53stationary state of Planck for
- 49:55instance and it was also given I think
- 49:57today in the lecture uh several times so
- 50:02let's do an uh the tour
- 50:08for example actually
- 50:18okay you still see it but
- 50:22that you have to do this
- 50:26okay
- 50:27so there is as follows we have a
- 50:29differential equation on the left hand
- 50:30side you have dh2 over DT so let's
- 50:33rewrite it in differential form so I can
- 50:37write that dh2 is equal to what I have
- 50:42on the right hand side so minus 2 5
- 50:45Plus
- 50:47H to square over 2K
- 50:51times PT
- 50:53foreign
- 50:58of 2K
- 51:00and so here I have minus 4 K Phi
- 51:04okay
- 51:06and now you see that I have here a
- 51:08product of something which depends only
- 51:11on H2 times the differential in DT so
- 51:14what I can do is to bring this product
- 51:16to the other side
- 51:18and get to the other side so that I get
- 51:22a left hand side which depends only on
- 51:24H2
- 51:26the H squared minus 4
- 51:30K Phi
- 51:32and the right hand side depends only on
- 51:34t
- 51:36through the DT
- 51:38okay
- 51:40and once I have this what can I do well
- 51:43I can integrate both sides
- 51:46so I integrate the right hand side with
- 51:49respect to T from a given time P0
- 51:53up to a Time
- 51:55uh
- 51:56what
- 51:58p in general
- 51:59and the left hand side I integrated with
- 52:03respect to the corresponding value or
- 52:05between the corresponding value of the
- 52:07function H2
- 52:08so from H2
- 52:10of t 0 to
- 52:12H2 of t
- 52:15so I hope you see it maybe it's small
- 52:17okay
- 52:19now what is the right hand side well
- 52:21okay let me first do the left hand side
- 52:26so the left hand side is an integral
- 52:28that I know how to do so
- 52:31it's
- 52:32anarchical tangent hyperbolic
- 52:36this you can check
- 52:40uh okay we need the equation again but
- 52:44never mind
- 52:52so you can check that the following
- 52:54holds that the integral
- 52:57in the x of x square minus a where a is
- 53:03some positive constant
- 53:05so for a larger than 0 this is given by
- 53:08minus
- 53:091 over square root of a times
- 53:15the hyperbolic
- 53:18the inverse of the hyperbolic tangent
- 53:20evaluated at x divided
- 53:23by square root of a so this is just an
- 53:26example it allows me to compute the last
- 53:2910 sides so in particular it tells me
- 53:32that
- 53:36the hyperbolic Arc sound of
- 53:39my function H2 of t
- 53:43divided by square root of 4K C which is
- 53:47what plays the role of a
- 53:49is equal to minus well now let me do it
- 53:53correctly I think there is a Phi over k
- 53:56e
- 53:59Plus
- 54:01e so C is a constant which incorporates
- 54:03if you want P0 and also what you would
- 54:07get so what we will get from the left
- 54:09hand side is the value of the integrand
- 54:12sorry of the integral at H2 minus the
- 54:15value at H2 of t 0 which is a constant
- 54:17so I can absorb everything into this
- 54:20constant T and what I get out of this
- 54:22equation is that
- 54:24by inverting the hyperbolic arctan I
- 54:28will get that this is
- 54:29simply given by square root of
- 54:334 K Phi
- 54:35so I go a little bit fast but that's
- 54:38just because it's
- 54:39it's not so relevant
- 54:42just to give you an idea pi over KT
- 54:45Flash
- 54:47my constant C
- 54:49that is now
- 54:51it's the same constant okay and once I
- 54:55have this how do I fix C well remember
- 54:58that we had an information about the
- 55:00boundary value of this function so we
- 55:02know that H2
- 55:04at time capital T has to be equal to 2
- 55:08times a
- 55:10and therefore what I have to do is to
- 55:12compute this quantity at Capital time T
- 55:14and then solve for C and I will get an
- 55:18expression for C which depends on on
- 55:21Capital a okay so in particular
- 55:24you get the C is
- 55:27square root of C over K times capital T
- 55:30Plus
- 55:36a over square root of K Phi okay so this
- 55:39you can check and afterwards it is just
- 55:42algebra and this gives you the solution
- 55:45for
- 55:47the coefficient H2
- 55:50and somehow the only thing that I wanted
- 55:52to uh to to do is to discuss an example
- 55:55for this separation of variables which
- 55:58as I said comes up several times
- 56:01uh in this type of problems
- 56:04okay now we have a H2 and so we have
- 56:07solved the equation three here so now
- 56:09let's go to uh this problem of trying to
- 56:12solve equation one and equation two uh
- 56:15for one particular choice of mu of T
- 56:18which comes from the interactions
- 56:20and this is part two
- 56:24of the exercise
- 56:30it's a square yes
- 56:32so the question very much is that there
- 56:35is a squaring here thanks that I forgot
- 56:39people see it
- 56:41I hope so
- 56:45okay
- 56:48now let's go to part two
- 56:57and let's try to be a bit more precise
- 57:00about the idea that I sketched before
- 57:03that now we want to choose uh this New
- 57:06York team
- 57:07to be somehow the average of all of the
- 57:10velocities of all of the other investors
- 57:13which are in the market
- 57:16and we want to do it with the reasoning
- 57:19that is very close to main field so this
- 57:21is let me summarize
- 57:23the point of
- 57:26uh
- 57:28of 0.5 of the exercise
- 57:32and various the following so suppose
- 57:34that now we have many investors
- 57:36okay labeled by uh as I say by a so you
- 57:41will have
- 57:42this Vector a
- 57:45uh which labels my investors you will
- 57:47have a solution for the optimal velocity
- 57:50uh for each of these investors and you
- 57:54want to Define mu as an average over all
- 57:57of the others velocities
- 58:00that you get from the corresponding
- 58:02equations
- 58:03so how do you do this in a meanful
- 58:05scheme well let me sketch it very
- 58:08briefly so the idea is that you start by
- 58:10choosing one
- 58:15representative
- 58:20agent
- 58:24let me label
- 58:26her by a one specific value of a so this
- 58:31is a little bit like when you do easy
- 58:32mean field you choose one side that you
- 58:35assume to be representative of all of
- 58:37the sides
- 58:38and then once you have chosen this agent
- 58:41you assume
- 58:43that you know
- 58:44uh
- 58:49that you know
- 58:53this New York tea
- 58:55that is given by the behavior of all of
- 58:58the other agents so in sometimes you
- 58:59know you assume that you know what all
- 59:02of the other agents are doing and you
- 59:03solve the problem for your
- 59:05representative agent given these
- 59:08particular value of Mufti which is
- 59:10precisely what we did in part one so if
- 59:13you do this you get the results
- 59:16that we get so you get the optimal
- 59:18velocity now for our particular agent a
- 59:23given value of mu T we can write it as
- 59:281 over 2K
- 59:30the derivative of this function Omega
- 59:32with respect to q and this is a function
- 59:34of p q
- 59:36at the given u t
- 59:39so you assume you know what everybody
- 59:41else is doing you use this information
- 59:43to solve for the velocity of your
- 59:46particular agent so if you want
- 59:48thinking about easing you assume that
- 59:51you know the magnetization of all of the
- 59:52other sites this tells you what is the
- 59:55effective field which acts on the
- 59:57particular side that you are looking at
- 59:59you solve for the magnetization of that
- 1:00:02particular site at fixed value of the
- 1:00:05field and then you have to impose
- 1:00:06self-consistency
- 1:00:08and so this is the step which is missing
- 1:00:11here that is
- 1:00:14impose
- 1:00:16self-consistency meaning that
- 1:00:18the results that you get is consistent
- 1:00:22with your assumption on mu and namely
- 1:00:24with the assumption that mu is the
- 1:00:26average of this velocities so let me
- 1:00:28write it down and then I will specify it
- 1:00:30so the self-consistent equation in this
- 1:00:33setting will correspond to saying that
- 1:00:35mu of t
- 1:00:36is what is an average
- 1:00:40over if you want all of the
- 1:00:43representative sites of the solution for
- 1:00:47this particular site
- 1:00:50that you get
- 1:00:52that you got
- 1:00:56a fixed value of new p
- 1:01:00so you see that this is I hope you see
- 1:01:02it now I will tell you what I mean
- 1:01:05precisely by this average but before let
- 1:01:08me stress so this is really a
- 1:01:09self-consistent equation so it is an
- 1:01:11equation in which it's an equation for
- 1:01:13Mu of T in which mu of T depends appears
- 1:01:17on both sides yes out of her screen ah
- 1:01:21yes you're right
- 1:01:23usual problem
- 1:01:25thanks a lot guys for
- 1:01:38okay
- 1:01:41so you have Mufti both on the right and
- 1:01:42then on the left hand side and you have
- 1:01:45to solve for this function you'll see
- 1:01:47knowing what is the velocity at fixed
- 1:01:50profile from your team
- 1:01:53so let me tell you how should we intend
- 1:01:55this average with respect to all of the
- 1:01:58other agents
- 1:01:59so the way we can interpret it
- 1:02:04is as follows
- 1:02:16uh now I can write here
- 1:02:20yes
- 1:02:27so what is the average
- 1:02:31well to make this average precise we can
- 1:02:34think in the following way so as I said
- 1:02:36we have many many agents and all of
- 1:02:38those have a particular initial value of
- 1:02:41their
- 1:02:42inventory
- 1:02:45q0
- 1:02:46labeled by by the agents
- 1:02:49and these initial values we may assume
- 1:02:52that they are distributed so that there
- 1:02:54is a probability
- 1:02:55P0 of
- 1:02:58of this distribution of initial uh
- 1:03:02values for the inventors inventories
- 1:03:05so what you want to sell or buy
- 1:03:08and then we know that each of this agent
- 1:03:12has its own velocity that determines the
- 1:03:15time evolution of this quantity Q so if
- 1:03:18you look
- 1:03:19at the differential equation for Q and
- 1:03:22we integrate it then you know that Q T
- 1:03:24of a
- 1:03:26is q0 of a plus
- 1:03:29the integrals from t0 to T in the S of
- 1:03:34your velocity
- 1:03:36BS of a which depends
- 1:03:40as we saw solving the optimal problem it
- 1:03:42depends on your trajectory and in
- 1:03:45General on your teeth
- 1:03:47times DT that I'm integrating over uh in
- 1:03:51here
- 1:03:53okay
- 1:03:56so this is the optimal solution
- 1:04:05and then you see that if I have a
- 1:04:06distribution for the initial value the
- 1:04:08initial value of my inventory will
- 1:04:11determine uh what is the optimal
- 1:04:14solution together with all the other
- 1:04:16parameters and this equation will tell
- 1:04:18me that I will have also a distribution
- 1:04:20at any time T So if this is a random
- 1:04:23variable Q at any time will be itself
- 1:04:25random variable with a given
- 1:04:27distribution
- 1:04:29pity of QT and so in some sense when I
- 1:04:32say that we want to average over uh all
- 1:04:36of these the investors so what I mean
- 1:04:38with this average
- 1:04:40that again you don't see with this
- 1:04:43averaging here is essentially an average
- 1:04:44with respect to uh to the state of the
- 1:04:48system at any time assuming that we have
- 1:04:50a given distribution of uh of the
- 1:04:53initial uh inventory for all of our
- 1:04:57agents
- 1:04:59okay so this is how we should interpret
- 1:05:01the self-consistent equation and now
- 1:05:03let's see just very briefly
- 1:05:07um
- 1:05:08how to
- 1:05:10finish and solve or at least let me
- 1:05:14sketch
- 1:05:15uh how the solution can be obtained
- 1:05:20for this system of equations so let me
- 1:05:23start from here
- 1:05:27so to
- 1:05:29to go on
- 1:05:30we now need essentially another equation
- 1:05:33for this mu of T to solve our system of
- 1:05:37equations
- 1:05:38and it is convenient to introduce
- 1:05:42the quantity that I call E of t
- 1:05:45which is the average in the senses
- 1:05:47digest described
- 1:05:50of
- 1:05:51Q of P
- 1:05:54so it's just the average with respect to
- 1:05:56this distribution
- 1:06:00and why is this nice to introduce well
- 1:06:03the idea is that if I take the
- 1:06:04derivative
- 1:06:07of this language so let me say what is
- 1:06:10this average so let's look at this
- 1:06:12equation in here and take the average so
- 1:06:14if I do this this will tell me that I
- 1:06:18get a factor which is the average at
- 1:06:19time 0. and then I have the integral I
- 1:06:22bring the average inside the integral
- 1:06:26so now t 0 I must mean it to be zero
- 1:06:29and I will have the integral over DF
- 1:06:32of the average of all my velocities
- 1:06:35optimal velocity which depends
- 1:06:38on Qs and on mu
- 1:06:41okay
- 1:06:45and this average is precisely what I
- 1:06:47defined as to be equal to Mu of T
- 1:06:50through my self-consistent equation so
- 1:06:53this means that if I take the time
- 1:06:54derivative of this quantity that I just
- 1:06:57introduced this
- 1:06:59so the time derivative of the constant
- 1:07:01is zero and the time derivative will
- 1:07:03just give me the integrands so it will
- 1:07:06give me the average
- 1:07:07of
- 1:07:09my velocity at the time t
- 1:07:13given mu of T that through the
- 1:07:15self-consistent equations they want to
- 1:07:17impose is just equal to Mu of t so if I
- 1:07:21solve for this quantity is taking the
- 1:07:23derivative I have this function mu of T
- 1:07:26which is what appears in my system of
- 1:07:29equations
- 1:07:30so now to complete the system of
- 1:07:31equation we just have to derive an
- 1:07:34equation for this e of t
- 1:07:37in here
- 1:07:41okay
- 1:07:44and before yeah
- 1:07:50yeah and then we are almost done
- 1:08:00okay
- 1:08:04so once I'm here let me also or let's
- 1:08:07say once I am here let me look at this
- 1:08:09equation that I just wrote and remember
- 1:08:12that I know the solution for the optimal
- 1:08:14uh velocity at fixed value of mu of T so
- 1:08:19I found before that VT so here there
- 1:08:23should be a not uh
- 1:08:26a subscript that tells me that I am
- 1:08:29Computing this at the solution of uh for
- 1:08:33for the optimization problem so let me
- 1:08:35write it here V opt
- 1:08:38as a function of Q
- 1:08:41and if we're given U of T was just given
- 1:08:44by
- 1:08:451 over 2K
- 1:08:48the derivative
- 1:08:53of the function Omega that I introduced
- 1:08:57to the power 2.
- 1:08:59and using the answer for the function
- 1:09:02Omega this is just 1 over 2K
- 1:09:06times so the derivative of Omega is H1
- 1:09:10of t
- 1:09:14minus
- 1:09:16H2 of t
- 1:09:18the two countries with a one-half Q to
- 1:09:21the power two
- 1:09:23you see it okay
- 1:09:27here I'm just using the answer that I
- 1:09:30made for the expansion of Omega
- 1:09:33and therefore if I now plug this
- 1:09:35expression into this equation for E
- 1:09:38Prime I get a fourth equation
- 1:09:40that I call equation four
- 1:09:43which tells me that e Prime of t
- 1:09:49is also equal to the expectation value
- 1:09:52of this quantity here with respect to Q
- 1:09:55so now I'm
- 1:09:58I'm let me write small q so this is a
- 1:10:02solution for any possible value of small
- 1:10:04q now if I compute the optimal
- 1:10:06trajectory as a fixed uh the optimal
- 1:10:09velocity get a fixed trajectory for my
- 1:10:11random variable q and I take the
- 1:10:14expectation value what I will get so
- 1:10:16this is just from here I will get that
- 1:10:18this is
- 1:10:191 over 2 K
- 1:10:23there is no Square here right all right
- 1:10:27okay
- 1:10:29H1 of T minus h2c times the expectation
- 1:10:35value of Q which is nothing but e of T5
- 1:10:44so from all using all of these
- 1:10:46identities and my solution for V let's
- 1:10:48fix mu I get this fourth equation that
- 1:10:51allows me to relate the quantity that I
- 1:10:53just introduced to H1 and H2 for which I
- 1:10:57have the two other equations up there
- 1:11:00and so now what's the strategy to solve
- 1:11:03the system of equations I will just
- 1:11:05sketch it so the first thing that you
- 1:11:08can do is you take another derivative
- 1:11:11with respect to time of equations four
- 1:11:15so now I want to close to get a closed
- 1:11:17equation for E of t
- 1:11:19so what I can do is I take
- 1:11:22the second derivative of my equation 4
- 1:11:25with respect to time
- 1:11:27and what I have is 1 over 2K
- 1:11:31H1 Prime
- 1:11:34with respect to D minus H2 of T Prime
- 1:11:38this is not a problem because we solved
- 1:11:40the problem for H2 so we know what is
- 1:11:42the explicit form
- 1:11:44of this derivative times e
- 1:11:49minus 1 over 2 K
- 1:11:53h two of T times e Prime of t
- 1:11:57okay
- 1:11:59so now we have a true H2 that as I said
- 1:12:02we know we have e that is what we want
- 1:12:04and we have this
- 1:12:06H1 Prime
- 1:12:09that uh that the the say depends
- 1:12:13indirectly on uh on the function e why
- 1:12:18because if you look at the equation two
- 1:12:19this gives you precisely H1 Prime as
- 1:12:23minus beta mu and mu is what mu is e
- 1:12:27Prime of t
- 1:12:29plus 1 over 2K H1 H2 so you will see
- 1:12:33that this Factor if I now replace
- 1:12:36I place equation 2 in here
- 1:12:39okay
- 1:12:41what I see is that and I use that mu of
- 1:12:44T is e Prime of T I will get out of this
- 1:12:47so this you can check
- 1:12:49I will cancel terms like this I think
- 1:12:51and I will get a second order equation
- 1:12:55for E which is of the following form
- 1:13:01so I'm going a bit fast in here but just
- 1:13:03because this is
- 1:13:05just algebra
- 1:13:08I have H2 Prime of T minus H2 square of
- 1:13:14T over 2K
- 1:13:18equal to zero
- 1:13:24okay so this is what you should get
- 1:13:29and the quantity in parenthesis you can
- 1:13:31further simplify it by using equation
- 1:13:34three so you know that this will be
- 1:13:37equal to minus 2 5.
- 1:13:41okay
- 1:13:43so this quantity in parenthesis well
- 1:13:45okay you see the quantity parenthesis
- 1:13:47here is minus 2 5.
- 1:13:49so now you have a simple second order
- 1:13:52differential equation for e
- 1:13:54and you can solve it
- 1:13:59so you know that when you have equations
- 1:14:01of this form the solution is always
- 1:14:03given by
- 1:14:05linear combinations of exponentials
- 1:14:12so again I will just give you the
- 1:14:15general form and then you can fill in
- 1:14:18the details
- 1:14:20foreign
- 1:14:25second derivative of t
- 1:14:28plus T by Prime of B
- 1:14:31and then we have minus 2 Phi
- 1:14:34e of t
- 1:14:36equal to zero
- 1:14:39and if you
- 1:14:41do all of the calculation you will find
- 1:14:43that you can write
- 1:14:45the solution so y will be an exponential
- 1:14:48well okay because this is a linear
- 1:14:50equation in the derivatives so if you
- 1:14:52make an answer which is of the
- 1:14:54exponential form e to the alpha T you
- 1:14:57will be able to rewrite this as an
- 1:15:00equation for the coefficient Alpha and
- 1:15:02by solving these equations you find that
- 1:15:08you can write it as
- 1:15:10in the following form
- 1:15:19or what you can do is you take these
- 1:15:21answers you plug it into the equation
- 1:15:22and this gives you a second order
- 1:15:24equation for this
- 1:15:26omegas
- 1:15:27that each of the following form
- 1:15:34so which will depend on the parameters
- 1:15:36you see in this equation so 5K and Theta
- 1:15:41and if you do it you will find this
- 1:15:44dependency here
- 1:15:48okay
- 1:15:49so the equation will allow you to fix
- 1:15:51the values of Omega plus and Omega minus
- 1:15:54and then you see you have an extra
- 1:15:55constant C and you have to fix it
- 1:15:58knowing the boundary value for uh for uh
- 1:16:02for your quantity e that you can deduce
- 1:16:06for example
- 1:16:08from uh you can deduce it from the
- 1:16:11boundary values of H1 and nh2
- 1:16:16uh that you have from before
- 1:16:20okay so uh I don't want to do uh now do
- 1:16:25all of the details uh of the solution of
- 1:16:27the system of equations because we also
- 1:16:28do not have time but what is the idea so
- 1:16:31the idea is that through this game of
- 1:16:33introducing e of T and solving for E of
- 1:16:36T you now have everything that you need
- 1:16:39to go back to what I call before
- 1:16:41equation one two and three so equation
- 1:16:44three we solved the equation uh one or
- 1:16:47if you want just look at
- 1:16:50it's in this form here
- 1:16:53so from here you know that if you know
- 1:16:55H2 and you know e of T and its
- 1:16:58derivatives then you can solve for H1
- 1:17:00and if you know H1 you can solve for the
- 1:17:04equation of for h0 which was just that
- 1:17:07the derivative of h0 is minus H1 Square
- 1:17:10over 2K and so you have sold all of your
- 1:17:14equations and what you can do and this
- 1:17:16is a little bit an exercise for you is
- 1:17:19to
- 1:17:20try to write them down this equation and
- 1:17:23try to plot them as a function of the
- 1:17:25various parameters of the problems that
- 1:17:28that we have
- 1:17:30and of course I'm not going to do it at
- 1:17:33the Blackboard but I just want to
- 1:17:35make perhaps
- 1:17:37one final comment that is related to
- 1:17:40part three
- 1:17:42so part three are just questions about
- 1:17:46the dependence on the parameters
- 1:17:51so I will just make two comments so let
- 1:17:54me keep
- 1:17:55Omega in here
- 1:18:00or maybe one comment so one comment is
- 1:18:03uh the following
- 1:18:06so let's go back to equation four up
- 1:18:09there
- 1:18:10which you see
- 1:18:12yes so equation four
- 1:18:17okay so let me conclude with the final
- 1:18:19comment which
- 1:18:20is one of the questions
- 1:18:233.7
- 1:18:27foreign
- 1:18:37so equation four is of the form
- 1:18:40so you see that you have
- 1:18:43e Prime and e but let me maybe just take
- 1:18:50let me look at the line which is above
- 1:18:55equation four which gives me the
- 1:18:58um the optimal velocity
- 1:19:01so the idea is the following so I can
- 1:19:03write
- 1:19:04that the optimal velocity which is e
- 1:19:07Prime of T because of the
- 1:19:10self-consistent equation
- 1:19:11is given
- 1:19:13by what so using principle given
- 1:19:19no sorry this I can write in the
- 1:19:21following way
- 1:19:29okay
- 1:19:33and where does it come from well it
- 1:19:36comes from
- 1:19:38essentially this
- 1:19:42so I have this equation up here and then
- 1:19:45I can rewrite
- 1:19:47H1 as a function of e and if I rewrite
- 1:19:51H1 as a function of e by solving
- 1:19:54equations four for H1 I get this
- 1:19:57expression for uh for the optimal
- 1:19:59velocity
- 1:20:01and it is useful to write it in in this
- 1:20:03way just to tell you the final comments
- 1:20:06and the final comment is that you have
- 1:20:07two contributions to the optimal
- 1:20:10velocity so you have one contribution
- 1:20:12that goes like e Prime T and remember
- 1:20:15that e Prime T is
- 1:20:19what we call U of B
- 1:20:22so it is an average of all of the
- 1:20:25velocities of the other players in the
- 1:20:28game
- 1:20:28so what this is telling you is something
- 1:20:30that people in this literature call
- 1:20:33follow
- 1:20:36the trading flow
- 1:20:44so this is the term that is basically
- 1:20:46telling you that if everybody is selling
- 1:20:48very fast
- 1:20:50each of the other agents will have a
- 1:20:52velocity that is large and negative and
- 1:20:55so your e Prime contribution in here
- 1:20:57will be the average of all of these
- 1:20:59velocities that will be large and
- 1:21:00negative and so you also want to have a
- 1:21:02velocity that is large and negative so
- 1:21:04you want to match with what all of the
- 1:21:08other people are doing uh on average and
- 1:21:10this is what uh
- 1:21:12people in the literature call indeed
- 1:21:14following the flow with an extra
- 1:21:17contribution though which comes from uh
- 1:21:20from this difference in here
- 1:21:22and this difference in here it tells you
- 1:21:24so typically you can show that this
- 1:21:25quantity is positive
- 1:21:28and therefore it's telling you that yes
- 1:21:30you may have a large negative
- 1:21:32contribution uh from the the flow of the
- 1:21:36other people but then you can compensate
- 1:21:38a little bit with this this trend by
- 1:21:41this term and this term is proportional
- 1:21:44to let's say Q so the amount of
- 1:21:47inventory that you still have at the
- 1:21:49given time c and e of T is what is the
- 1:21:53average of this of the inventory of all
- 1:21:55of the other Traders so what this is
- 1:21:57telling you is that if you have an
- 1:21:59amount of inventory that is smaller than
- 1:22:02the average so you have already so sold
- 1:22:05more than what the average has sold then
- 1:22:10you get a contribution which is positive
- 1:22:12which compensates a little bit uh the
- 1:22:15negative contribution of the velocities
- 1:22:16of all of the others so you somehow have
- 1:22:19to adjust to what the average is doing
- 1:22:21and this is the essence of
- 1:22:24um in field meaning that if everybody is
- 1:22:26selling fast you want to sell as they
- 1:22:28are are to satisfy also the
- 1:22:30self-consistent equation and at the same
- 1:22:32time you want that your average
- 1:22:34inventory matches somehow the average
- 1:22:36for all the others so if at the time you
- 1:22:39have an inventory which is smaller you
- 1:22:41slow down a little bit you're selling so
- 1:22:43as to compensate and somehow be
- 1:22:47consistent with uh with what the system
- 1:22:50is doing on average
- 1:22:52so this is uh slow down
- 1:22:57if if Q is smaller than
- 1:23:01than the average at a given time t
- 1:23:05okay so that's basically uh What uh
- 1:23:09say and the other comments that you find
- 1:23:13in section three are again about
- 1:23:15analyzing a little bit uh the structure
- 1:23:18of the solution that you see in
- 1:23:21particular as you see
- 1:23:23um well okay you can go through it by
- 1:23:27yourself one observation that you can
- 1:23:28make is that in the behavior of e of T
- 1:23:31you see that the parameters enter in
- 1:23:35here like Theta K and Phi but the
- 1:23:37parameter a which was related to the
- 1:23:41cost of liquidation at the final time
- 1:23:44doesn't enter in here so this tells you
- 1:23:46that maybe you can somehow to this level
- 1:23:49you can forget about that extra
- 1:23:52parameter and what you can really play
- 1:23:53with to get to different strategies are
- 1:23:56the three ones that appear in here but
- 1:24:00if you can check by yourself
- 1:24:03and okay I think this is enough and for
- 1:24:06the plank that's really very fast
- 1:24:09but maybe we do it uh next time so there
- 1:24:12is the next day
- 1:24:14to the number five is
- 1:24:17um
- 1:24:18or or there are two weeks that I
- 1:24:21allocated for the same today and that is
- 1:24:23just to have a little bit of pose to
- 1:24:25also catch up with what was left behind
- 1:24:28and I think that is next week and uh and
- 1:24:30the following one after the holidays so
- 1:24:33this is to say that we will have time to
- 1:24:34uh to discuss soccer plank again
- 1:24:37and for the moments we can stop here I
- 1:24:39think so are there questions
- 1:24:45nope
- 1:24:51okay
- 1:24:53okay then I stopped
- 1:24:56the record
About this transcript
This page contains the full transcript of Complex Systems - Jean-Philippe Bouchaud - Lecture 5: Optimal Liquidation (Valentina Ros) by EconophysiX Lab, generated from the public captions YouTube serves with the video. The transcript has 11,358 words across 1,789 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.