Serving the Quantitative Finance Community

Cuchulainn
Topic Author
Posts: 64700
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

### Re: One-liner questions of a numerical kind

Issues relating to derivative’ sensitivities
0.      Using 2nd order divided differences is error-prone: round-off errors, catastrophic cancellation, spurious oscillation. Complicated and tedious mathematics is needed in order to verify the Carr/Madan conditions for no-arbitrage.
1.      When calculating sensitivities we choose for differentiation-then-approximation approach (1) to the BS PDE. In particular, each sensitivity satisfies a BS-type equation with a possible inhomogeneous forcing term + BC + IC (2).
2.      Instead of (trying to) compute the solution of the PDE  analytically we use the maximum principle (positive input implies positive output/solution (not many quants use/know this). It is crucial and it allows us to give sufficient conditions for no-arbitrage without much effort at all. The result is the continuous analogue of the Carr/Madan conditions.
3.      The next step is to approximate the solution of the PDE by monotone finite difference schemes that satisfy the discrete maximum principle for any mesh size and set of input parameters (not all schemes are monotonic  and L-stable which is the reason for all that hullabaloo around Crank-Nicolson). CN gives oscillations around the strike, making it unsuitable as it can cause discontinuities in LV function.  Fully implicit is L-stable but not perfect. It is only 1st-order.
4.      For convection-dominant problems or tricky diffusion terms, we can use exponential fitting to preserve monotonicity and avoid spatial instability.
5.      Example; gamma and strike gamma solve Fokker-Planck PDE and you can see that the approximate integral adds up to 1. The initial condition is a Dirac delta function. The maximum principle can be applied to prove positivity of this PDE.
6.      For sensitivity ‘theta’ it is non-decreasing in maturity as can be seen by looking directly at the Dupire PDE. No need for messing with integrals which I find to be a bit grungy TBH. It soon becomes a Pandora’s box (what’s the Laplace-Carson transform?)
7.      I am fairly confident that the same techniques can be applied to compute duration  and convexity sensitivities etc. for IR models. I suspect it should also be possible to compute swaption and CVA greeks assuming you have a PDE for the underlying.
8.      I don’t know yet how this approach fits into the LV calibration algorithm. At this stage, we can at least say that the volatility in Dupire’s formula will always be positive no matter what. Not sure if piecewise constant vol or cubic splines are necessarily superior.

(1)   This is in essence the Continuous Sensitivity Equation (CSE) approach and is used in shape design and optimization.

(2) Many current approaches use the approximation-then- differentiation approach, for example discretization of a SDE by Euler and then differentiating the discrete equation wrt vol using AD or the complex step method.
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl

Cuchulainn
Topic Author
Posts: 64700
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

### Re: One-liner questions of a numerical kind

An open question is how to compute C/K; the strike is 'hidden' in the payoff and is nowhere to be seen in the PDE.

That makes it easy. You can still differentiate the PDE => $u = C_K$ follows the same PDE with the differentiated payoff.
Alan,
If we want to compute theta, what then?

1. Use the fact that all terms price, delta and gamma are known just use balance PDE $\frac{\partial C}{\partial T}$ = Known.
2. Do 'tricks' e.g. $\tau = t/(t+T)$ and solve a PDE on (0,1). Somehow we have to get T into the limelight.

?
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl

Alan
Posts: 10655
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

### Re: One-liner questions of a numerical kind

I would just solve the PDE for C twice, once for maturity $T$ and once for $T - \Delta T$.

Or, just solve it once for the longer time, recording the solution at two appropriate time steps.

Or, as you say, just apply the r.h.s. operator of the PDE to a known solution.

Cuchulainn
Topic Author
Posts: 64700
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

### Re: One-liner questions of a numerical kind

I would just solve the PDE for C twice, once for maturity $T$ and once for $T - \Delta T$.

Or, just solve it once for the longer time, recording the solution at two appropriate time steps.

Or, as you say, just apply the r.h.s. operator of the PDE to a known solution.
Of course.
But we are not approximating theta using a PDE but divided differences that may or may not be 'good'.
I would like to have theta as a first-class object. At the end of the day it may prove to be unproductive. It is one of the big 3 no-arbitrage conditions.
Then we can say a-priori theta always has the same sign at all points.
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl

Alan
Posts: 10655
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

### Re: One-liner questions of a numerical kind

Well, for a put option, theta does not have the same sign at all points.

Cuchulainn
Topic Author
Posts: 64700
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

### Re: One-liner questions of a numerical kind

Well, for a put option, theta does not have the same sign at all points.
My bad (something in the cornflakes) Looking at diagram  theta = -dP/dt is not always negative? It can be positive?
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl

Alan
Posts: 10655
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

### Re: One-liner questions of a numerical kind

Well, for a put option, theta does not have the same sign at all points.
My bad (something in the cornflakes) Looking at diagram  theta = -dP/dt is not always negative? It can be positive?

Sure: r > 0 (European option, no divs) and small enough stock price $S_0$.
Then, $P \sim K e^{-r (T-t)} - S_0$.         (Presumably your t is my T or T-t).
Classic interview question.
However you define it, theta switches sign at some strictly positive stock price.

bearish
Posts: 6522
Joined: February 3rd, 2011, 2:19 pm

### Re: One-liner questions of a numerical kind

There is always some annoying carry term messing up the nice, clean $\Theta = - \frac{1}{2} \sigma^2 S^2 \Gamma$

ikicker
Posts: 21
Joined: June 8th, 2011, 12:19 am

### Re: One-liner questions of a numerical kind

Subject:

gamma (second derivative of option  price wrt S). Does it have a value at t = 0?
Can we model gamma as a PDE?

This is for t == 0 -> t = 1.0e-3
When t = T for initial conditions gives a better approximation..

Probably. That most closely resembles a poisson distribution. A lot of financial distributions resemble poisson distributions.

You can find the CDF equation here: https://en.wikipedia.org/wiki/Poisson_distribution

You can compute the probability by integrating: P(aXb)=∫ f(x)dx
----

Blog: Www.ThinkerTinkerSolutions.com

Cuchulainn
Topic Author
Posts: 64700
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

### Re: One-liner questions of a numerical kind

Subject:

gamma (second derivative of option  price wrt S). Does it have a value at t = 0?
Can we model gamma as a PDE?

This is for t == 0 -> t = 1.0e-3
When t = T for initial conditions gives a better approximation..

Probably. That most closely resembles a poisson distribution. A lot of financial distributions resemble poisson distributions.

You can find the CDF equation here: https://en.wikipedia.org/wiki/Poisson_distribution

You can compute the probability by integrating: P(aXb)=∫ f(x)dx
Doubtful. Apples versus oranges.
It's a description, not an explanation.

Maybe I missed something.
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl

Cuchulainn
Topic Author
Posts: 64700
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

[\$\[\frac{\partial V}{\partial t} + \frac{1}{2} \sigma^2 S^2 \frac{\partial^2 S}{\partial S^2} + r S \frac{\partial V}{\partial S} - r V = 0\frac{\partial B}{\partiall t}\tau$"Compatibility means deliberately repeating other people's mistakes." David Wheeler http://www.datasimfinancial.com http://www.datasim.nl bearish Posts: 6522 Joined: February 3rd, 2011, 2:19 pm ### Re: One-liner questions of a numerical kind [\[\frac{\partial V}{\partial t} + \frac{1}{2} \sigma^2 S^2 \frac{\partial^2 S}{\partial S^2} + r S \frac{\partial V}{\partial S} - r V = 0$
$\frac{\partial B}{\partial t}$
$\tau$
This is the cleaned version. Still a bit terse...

$\frac{\partial V}{\partial t} + \frac{1}{2} \sigma^2 S^2 \frac{\partial^2 S}{\partial S^2} + r S \frac{\partial V}{\partial S} - r V = 0$
$\frac{\partial B}{\partial t}$
$\tau$

Cuchulainn
Topic Author
Posts: 64700
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

### Re: One-liner questions of a numerical kind

Consider the well-known  PDE for the bind price $B$ in the CIR model.Then differentiate the PDE with respect to $r$ to get a PDE in $\frac{\partial B}{\partial r}$ (this is a bespoke CSE equation).

Some points:
1. The Fichera/Feller conditions implies that no BC is given at $r= 0$ and that  the PDE reduces to a first-order hyperbolic PDE.
2. The real question is how tor 'find' near and far-field boundary conditions?

What do you think?
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl

Alan
Posts: 10655
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

### Re: One-liner questions of a numerical kind

Consider the well-known  PDE for the bind price $B$ in the CIR model.Then differentiate the PDE with respect to $r$ to get a PDE in $\frac{\partial B}{\partial r}$ (this is a bespoke CSE equation).

Some points:
1. The Fichera/Feller conditions implies that no BC is given at $r= 0$ and that  the PDE reduces to a first-order hyperbolic PDE.
2. The real question is how tor 'find' near and far-field boundary conditions?

What do you think?

Well, we beat this to death in earlier threads for the case of the PDE for B. I don't think the PDE for $B_r$ is going to change things, although maybe you'll need to solve a PDE system with both $(B,B_r)$. Apart from that system issue, my opinion would be the same discussion as in my Vol II, Sec. 10.2.1. And easily checked by solving the PDE (system) in that way and comparing with the exact $B_r$. That's the discussion for $r=0$.

For $r \rightarrow \infty$, since $B \rightarrow 0$, then $B_r \rightarrow 0$ is going to be pretty inescapable.

Cuchulainn
Topic Author
Posts: 64700
Joined: July 16th, 2004, 7:38 am
Location: Drosophila melanogaster
Contact:

### Re: One-liner questions of a numerical kind

The PDE for this greek does indeed contain terms in the bond price. The far-field BC sounds reasonable. At the near field the Feller condition for the 'greek PDE' is always satisfied which means we have a drift PDE at that boundary. It must be solved numerically (upwinding) in the worst case.
I get at r = 0:

dD/dt = (1/2 sig^2 + a) dD/dr - b D - B

where B = bond price, D = dB/dr  and a,b,sig are the pararmeters of CIR model.

(the question is from my MSc student who is rounding off this part of his thesis).
"Compatibility means deliberately repeating other people's mistakes."
David Wheeler

http://www.datasimfinancial.com
http://www.datasim.nl