viernes, 27 de noviembre de 2020

Matematicas para la Ingenieria Financiera - Black-Scholes for a minute

 

Mathematical Preparation for FinanceA wild ride through mathematicsKaisa Taipale


https://www.softcover.io/read/bf34ea25/math_for_finance/differential_equations


Chapter 12Differential equations

Goals of this chapter

  • find equilibrium solutions of basic differential equations
  • classify equilibrium points of systems of first-order equations, at least roughly!

Chapter 12Differential equations

Goals of this chapter

  • find equilibrium solutions of basic differential equations
  • classify equilibrium points of systems of first-order equations, at least roughly!

This topic is mostly qualitative, but involves elements of review from earlier topics as well. Keep an eye out for:

  • short-term prediction
  • long-term prediction
  • Euler’s method
  • a possible application of Newton’s method
  • optimization
  • eigenvalues and eigenvectors

12.1 Equilibrium: the concept

Differential equations allow us to study how quantities change in relation to each other, as they’re equations that set out the relationships between given derivatives. Equilibrium is a useful concept to group our exploration: it’s defined as “a state in which opposing forces or influences are balanced” according to Google’s source on August 27, 2018. In the world of differential equations, think of equilibrium as a solution to a differential equation in which quantities are not increasing or decreasing, but instead are constant... a solution in which derivatives are zero!

12.2 A single ordinary differential equation

Consider a basic differential equation like

dxdt=0.02x.

This is the sort of equation we considered at the beginning of the semester: we were able to solve such an equation using the method of long-term approximation or using analytical methods:

dxx=0.02dt

so

ln|x|=0.02t+C

and thus

x(t)=eCe0.02t=Pe0.02t.

In general, humans are more interested in gaining or losing money than keeping it the same, but it’s actually extraordinarily useful for mathematicians and analysts to understand equilibria, points at which the rate of change of a quantity is zero. For this equation under consideration, the equilibrium solution would be when dxdt=0, which is when 0.02x=0 (by the design of the equation), which occurs only when the function x(t)=0.

Equilibrium analysis is useful because if we consider a smoothly-changing dxdt, then dxdt can’t change signs without passing through zero! (When I say “smoothly-changing” I mean that f(x) in dxdt=f(x,t) is a continuous and differentiable function. This is stricter than necessary but will serve our purposes.) In fact, for a single differential equation like this which depends only on x, we can draw a phase line that illustrates the behavior of x(t) by looking at the sign of dxdt.

Example 2.1 Consider the example

dxdt=0.02x(1x).

For what values of x(t) is the system at equilibrium? That is, when is dxdt=0? Draw a phase line and indicate where dx/dt is positive and where it is negative.

The equation above is an example of a logistic differential equation. The logistic equation is very useful in population ecology, and there is written

dPdt=rP(1PK).

In this situation P(t) is population as a function of time, r is the growth rate of the population, and K is the carrying capacity of the environment.

Example 2.2 Practice reading the differential equation: change in population is proportional to the rate parameter times the population times one minus the ratio of population to carrying capacity. What are the equilibrium values for the differential equation? Draw a phase line and characterize the behavior of the population with various initial conditions. redReview: Remember initial value problems were introduced in September.

To carry out heuristic analysis of these differential equations, another great graphical tool is the slope field or direction field. Slope fields can be generated by computer or drawn by hand. To draw a slope field for a single differential equation of the form dxdt=f(x,t), draw the t- and x-axes and then for every point (t,x) draw a small tick mark with slope f(x,t).

Here is an example: the slope field for dxdt=3x(1x2) is

To use a slope field for qualitative analysis of solutions to a differential equation, start at an initial value (t0,x)) of your choice and simply follow the arrows! This traces a solution curve, and this curve is the graph of a solution to the differential equation.

Recall that we discussed Euler’s method for numerically solving these differential equations. Euler’s method puts together many short-term predictions to make a long-term prediction. How does that work again? Review!

Example 2.3 Use Euler’s method or the method of long-term predictions to estimate x(2) if you know dxdt=3x(1x/2) and you start at x(0)=1. Use two steps.

Example 2.4 (Challenge) Solve dxdt=3x(1x/2) analytically.

12.3 So I can model a caribou population: what about money?

A good qualitative understanding of differential equations is essential to progressing toward the Ito calculus and Black-Scholes equation. Let’s take a look at the Black-Scholes equation for a moment:

Ct+rSCS+12σ2S22CS2=rC.

Here C(S,t) is the price, when the stock price is S and time is t, of a European call option struck at price K with an expiration date of T. The parameter σ is the volatility of the stock’s returns. This equation is a partial differential equation (PDE) as opposed to the ordinary differential equations (ODEs) we’re considering in this document. But the principles of “reading” a differential equation remain the same! A very first analysis can go as follows:

  • If we considered a simplified C(S,t) under some extraordinary condition in which C(S,t) did not vary according to S at all (imagine simply holding S constant but letting time run) we’d end up with the equation
    Ct=rC.

    Look familiar? Yes, it’s just the exponential growth from the first page of this document!

  • If we let t stay constant and just let S vary, as a thought experiment, we’d get
    rSCS+12σ2S22CS2=rC.

    This is a second-degree differential equation, as it has those second derivatives. Ordinary autonomous second-degree differential equations can be split into two ordinary first-degree differential equations; check out this concept in the next chapter.

Understanding the uses and pitfalls of the Black-Scholes equation is a significant endeavor in financial math! Having an acquaintance with ordinary differential equations gives a mental context for dealing with Black-Scholes.

12.4 Systems of Differential Equations

Systems of differential equations: use everything you know about linear algebra and transfer it to the differential equation setting! Let’s start with something simple to get an idea of why this might work.

Example 4.1 Consider the system of equations dxdt = 3xdydt = -2y. Alone, you’d be happy to solve either of these equations. You would get x(t)=Pxe3t and y(t)=Pye2t. This is still perfectly reasonable.

We can rewrite the system of differential equations using the language of matrices:

(dxdtdydt)=(3002)(xy).

Then the solution is

(x(t)y(t))=(Pxe3tPye2t)=Pxe3t(10)+Pye2t(01).

Solutions to this differential equation, then, are curves in xy-space: they depend on t (they are parametrized by t).

To draw a slope field or phase plane for a two-dimensional system of equations, take a point (x,y) in the plane and draw a tiny vector in the direction of

(dxdtdydt).

***Notice something: no equation I write today has a t appearing explicitly on the right-hand side. Instead, they are of the form f(x,y). These are called autonomous differential equations. It is possible in math to deal with non-autonomous systems

(dxdtdydt)=(f(x,y,t)g(x,y,t))

but that is definitely outside the scope of this class!!

Example 4.2 Systems of differential equations can be linear (the functions describing the derivatives are linear and of form ax+by, for a and b real numbers at least for today) or non-linear. Here’s an example of a linear system:

(dxdtdydt)=(3&11&2)(xy).

Here is a phase plane with some solutions included (for positive t only):

By contrast, here’s a nonlinear system:

(dxdtdydt)=(3x2+yx2cos(y)).

Notice that I can’t write it using the matrix format! Here’s the slope field, with some solutions sketched. Which solution is wrong? Why is it wrong? Where are common sources of error when using Euler’s method?

12.5 Equilibria

We can find “equilibrium points” (we now call them fixed points instead) for these differential equations just as we found equilibrium solutions for single differential equations. Just solve for the points where dxdt and dydt are both zero! For a linear system of differential equations, the origin (0,0) will always be an/the only fixed point. (Why?) For nonlinear systems you’ve got to use whatever techniques you can to find these solutions.

Example 5.1 For

(dxdtdydt)=(3x2+yx2cos(y)),

solve

3x2+y=0

and get the curve

y=3x2.

(A whole curve…! Can you see this on the slope field? What would it mean?) Then solve

x2cos(y)=0

to get

x=2cos(y).

Put these together: if both are true,

y=12cos(y).

This has many solutions, but y1.44969 is one of them and fits into our picture. If that is true, then x0.695147.. and that gives us our fixed point. Messy! This is just one of many fixed points since cos(y) is periodic.

Look at this fixed point in the picture: how do the solutions relate to the fixed points? How do they behave together? It looks like solutions “tend toward’’ the fixed point. When solutions tend toward a fixed point, the fixed point is called a sink. When solutions tend away from a fixed point, the fixed point is called a source. When nearby solutions zoom past a fixed point, careening toward it and then rushing away, the fixed point is called a saddle.1

Let’s deal with a simpler situation:

Example 5.2 Consider

(dxdtdydt)=(3xy2sin(y)x)

This has two equilibria. Solve 3xy2=0 to get 3x=y2, and sin(y)x=0 to get x=sin(y). Then sin(y)=y2/3, so 3sin(y)=y2. This has the solutions of y=0 and y1.72213. That means (0,0) is an equilibrium point and (.98857,1.72213) is also an equilibrium point.

12.6 Straight-line solutions

Looking at phase planes of systems of linear first-order differential equations, you can see that there are often straight-line solutions – solution curves that follow a straight line into or out of the origin. This is no accident. Turns out they run along eigenvectors. In fact, the solutions to a system of two linear DEs

ddtx=Ax

where A has real eigenvalues λ1,λ2 with corresponding eigenvectors w1,w2 are completely classified by

x(t)=c1eλ1tw1+c2eλ2tw2.

(Actually, we can do the same if the eigenvectors are complex, but we have to pick off the real parts of the solution by using the identity

eit=cos(t)+isin(t)

and combining this with the complex eigenvectors.)

Example 6.1 Consider the system

(dxdtdydt)=(2&71&6)(xy)

The matrix A has eigenvalues λ1=5λ2=1: (2-) (-6-) +7 = 02+4 -5 = 0(+5) (-1) =0 . It’s got eigenvectors

w1=(11)

and

w2=(71)

(check yourself!). So the straight-line solutions are

c1e5t(11)

and

c2e1t(71).

Look at the phase plane:

Here I did not draw the whole straight line solution in either situation: I drew only the solution starting (with t=0) at an initial value and continuing for positive t. I did this because then you can see that the solutions associated with λ1 go “in” toward the origin (as e5t decreases when t increases) and the solutions associated with λ2 go “out” from the origin (as et increases when t increases).

12.7 Back to Black-Scholes for a minute

In the first chapter I mentioned that second-degree differential equations can often be split into two first-degree differential equations. The most classic example of this is the motion of a spring with a mass on the end, possibly with some external forcing. Back to physics for a moment!

The equation for the displacement u(t) of a spring in this situation is

md2udt2+γdudt+ku=F(t),

where m is the mass at the end of the spring, γ is some damping coefficient (is your spring moving through air, oil, peanut butter?), k is the spring constant ( stiffness), and F(t) describes the external forcing.2 Use a very simple trick to rewrite this second-order equation as two first-order equations:

dudt=v.

Look: I made up a variable name for dudt! Now we get

(dudtdvdt)=(v1m(F(t)γvku)).

This is not quite linear, but there are standard mathematical tools to deal with this. Moreover, if F(t)=0 (in other words, there’s no external forcing) you’ve got all the information you need to solve

(dudtdvdt)=(v1m(γvku))=(01kmγm)(uv).

  1. How does this remind you of minima, maxima, and saddles when we look at optimizing functions like z=f(x,y)
  2. Compare it to Black-Scholes:

    Ct+rSCS+12σ2S22CS2=rC

    There are some similarities; the big difference is that Black-Scholes has derivatives with respect to time and stock price.




No hay comentarios:

Publicar un comentario