This needs the details of a specific problem to have a discussion.

- Cuchulainn
**Posts:**64420**Joined:****Location:**Drosophila melanogaster-
**Contact:**

QuoteOriginally posted by: AlanThis needs the details of a specific problem to have a discussion.OK. I am thinking out loud so I avoid transforming rectangles to rhombi as it gets complicated.The goal is still to remove the mixed derivatives scenarios. I reduce the scope to 2d and a basket-type PDE(S1,S2) on a 1/4 plane with non-zero correlation.Define x1 = log(S1), x2 = log(S2) then we get a PDE(x1,x2) in the 2d plane with still mixed derivatives.Now rotate the axesX = (x1+x2)/2, Y = (x1-x2)/2 to get a PDE(X,Y) in the 2d plane with no mixed derivatives.The question is: how do we even start thinking about numerical boundary conditions? It's a kind of impasse. ?If we reduce the scope even more to 1d diffusion on the real line we can use Fourier Transform or other technique to deduce asymptotic behavior at infinities if the initial condition has compact support.

Last edited by Cuchulainn on August 31st, 2015, 10:00 pm, edited 1 time in total.

"Compatibility means deliberately repeating other people's mistakes."

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

If the initial condition has compact support, I will guess the solution function tends to zero as you approach infinity in any spatial direction.So that's still true in the rotated coordinates.

- Cuchulainn
**Posts:**64420**Joined:****Location:**Drosophila melanogaster-
**Contact:**

QuoteOriginally posted by: AlanIf the initial condition has compact support, I will guess the solution function tends to zero as you approach infinity in any spatial direction.Some initial brainstorming ..I don't normally do log coordinates but I intend to for a number of reasons. Typically x = log(S1), y = log(S2) so we get a PDE with constant coefficients on in the plane. There are no boundary conditions and we just have a Cauchy problem. I want to flag some assumptions:1. initial condition has compact support is nice, but a call does not have this property in S1 and S2 but maybe things are different in x and y variables?2. Boundary conditions in S1 and S2 have a 'isomorphic' mapping to x and y coordinates?e.g. V(0,S2,t) = IC(S2, t) gets transformed to V(-INF, y, t) = IC(y,t).3. Just ride roughshod over the PDE and put V = 0 everywhere at the faraway infinities?4. What's the magic number for truncation e.g. [-1,1] X [-1,1]5 Domain transformation a feasible option instead of 3.6. I don't need rotation.Fuzzy questions but I got to start somewhere.

Last edited by Cuchulainn on May 22nd, 2016, 10:00 pm, edited 1 time in total.

"Compatibility means deliberately repeating other people's mistakes."

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

QuoteOriginally posted by: CuchulainnQuoteOriginally posted by: AlanIf the initial condition has compact support, I will guess the solution function tends to zero as you approach infinity in any spatial direction.Some initial brainstorming ..I don't normally do log coordinates but I intend to for a number of reasons. Typically x = log(S1), y = log(S2) so we get a PDE with constant coefficients on in the plane. There are no boundary conditions and we just have a Cauchy problem. I want to flag some assumptions:1. initial condition has compact support is nice, but a call does not have this property in S1 and S2 but maybe things are different in x and y variables?2. Boundary conditions in S1 and S2 have a 'isomorphic' mapping to x and y coordinates?e.g. V(0,S2,t) = IC(S2, t) gets transformed to V(-INF, y, t) = IC(y,t).3. Just ride roughshod over the PDE and put V = 0 everywhere at the faraway infinities?4. What's the magic number for truncation e.g. [-1,1] X [-1,1]5 Domain transformation a feasible option instead of 3.6. I don't need rotation.Fuzzy questions but I got to start somewhere.Re 3.If a put or call, then in the original coordinates, you know some (numerical) boundary conditions that will work,lets say in a bounded computational domain [$](S_{min},S_{max})[$]. So, after the coordinate transformation, I would just apply these same conditions at [$](X_{min},X_{max})[$] where [$]X(S)[$] is the coord. transformand [$]X_{min}= X(S_{min})[$], etc.Re 4.If it is a log transformation, you typically set the cutoffs by the 'sigmas'; for example [$]X_{max} = \log S_0 + 4 \sigma \sqrt{T}[$], etc,where [$]S_0[$] is a hotspot value where you want an answer. This makes the probability that the 'particle', starting at [$]X_0 = \log S_0[$],will reach/cross the numerical boundaries before time [$]T[$] expires, small, and so have little effect on the answer.Re 5.Any other coordinate transformation should work similarly, say [$]X(S) = S/(S+S_0)[$]. There is going to be a numerical bc at [$]X_{max} = 1 - \epsilon[$];I would probably use a derivative condition at that one. For me, I have found that sometimes I can take [$]X_{min} = 0[$] andsometimes I need [$]X_{min} = \epsilon[$], depending on the problem. Here [$]\epsilon[$] is a grid point spacing.

Last edited by Alan on May 23rd, 2016, 10:00 pm, edited 1 time in total.

- Cuchulainn
**Posts:**64420**Joined:****Location:**Drosophila melanogaster-
**Contact:**

Alan,

Thinking out loud; solving PDE barrier options numerically is a bit of a challenge.

Let's say we transform the interval [$][0,B][$] ( where [$]B[$] is the barrier) to the positive semi-infinite interval. Would this avoid nasty gradients etc. and still get accuracy. So a transformation like [$]x = S/(B - S)[$].

This is like 'kicking the can down the road'? Steep functions are more benign than steep BCS?

Thinking out loud; solving PDE barrier options numerically is a bit of a challenge.

Let's say we transform the interval [$][0,B][$] ( where [$]B[$] is the barrier) to the positive semi-infinite interval. Would this avoid nasty gradients etc. and still get accuracy. So a transformation like [$]x = S/(B - S)[$].

This is like 'kicking the can down the road'? Steep functions are more benign than steep BCS?

"Compatibility means deliberately repeating other people's mistakes."

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

- Cuchulainn
**Posts:**64420**Joined:****Location:**Drosophila melanogaster-
**Contact:**

There was already a discussion on BCs for convertible bonds PDE. Interest rates can become negative. We transform r to interval (-1,1).

The 64 dollar Question is what BC (if any) to specify on y = -1.

@berndl

@bearish

The 64 dollar Question is what BC (if any) to specify on y = -1.

@berndl

@bearish

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

You don't explicitly say what domain you transfer [$] r [$] from, but if you are asking what should be the BC in the limiting case where [$] {r \to -\infty} [$], I think you took a wrong turn somewhere.

- Cuchulainn
**Posts:**64420**Joined:****Location:**Drosophila melanogaster-
**Contact:**

The original domain is [$](-\infty, \infty)[$] and we transform it to [$](-1,1)[$] by the transformation [$]y = tanh(r)[$] (Also BTW [$]z = S/(1+S)[$]. )You don't explicitly say what domain you transfer [$] r [$] from, but if you are asking what should be the BC in the limiting case where [$] {r \to -\infty} [$], I think you took a wrong turn somewhere.

So we need numerical BC on [$]y = -1[$] for the transformed PDE.

Where's the logic error?

// One ansatz is to give a large value on y = -1 (e.g. [$]10^4[$]) as larger values don't affect the solution.

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

So we used to think that the proper domain for interest rates was [$] [0, \infty) [$] to avoid arbitrage with cash. Then we observed negative rates due to a combination of regulatory and practical limitations on what financial institutions can actually hold on their balance sheet, pushing some rates as far down as about -1%. I don't honestly think that justifies changing the interest rate domain to [$] (-\infty, \infty) [$]. It's one thing to say that a dollar tomorrow is worth more than a dollar today. It's another to say that a dollar today is essentially worthless, since if you do, everything else will have an infinite (dollar) value. But when all is said and done, you are probably right that some arbitrarily large number will do...

- Cuchulainn
**Posts:**64420**Joined:****Location:**Drosophila melanogaster-
**Contact:**

Is this not just an example of a change in requirements (it's only aSo we used to think that the proper domain for interest rates was [$] [0, \infty) [$] to avoid arbitrage with cash. Then we observed negative rates due to a combination of regulatory and practical limitations on what financial institutions can actually hold on their balance sheet, pushing some rates as far down as about -1%. I don't honestly think that justifies changing the interest rate domain to [$] (-\infty, \infty) [$]. It's one thing to say that a dollar tomorrow is worth more than a dollar today. It's another to say that a dollar today is essentially worthless, since if you do, everything else will have an infinite (dollar) value. But when all is said and done, you are probably right that some arbitrarily large number will do...

A PDE on an infinite interval is fairly tractable.So, solving it has to be checked against reality?

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

Hi Cuchulainn,There was already a discussion on BCs for convertible bonds PDE. Interest rates can become negative. We transform r to interval (-1,1).

The 64 dollar Question is what BC (if any) to specify on y = -1.

@berndl

@bearish

Maybe its too mathematical and too far away from modelling asset returns to demand really yields should go up to - infinity. But i once asked it because if we do domain transformation to [-1,1] this question pops up definitly.

Maybe we should think more of bond prices as asset prices. If the asset price is very high what do we do (without too much rigour maybe)? We think the option should not have a significant gamma any more (thinking of a call on it for example). Then setting Gamma = 0 gives us a BC. But you know all of this know. And a lot of the guys here know it also better than me.

This is why i wondered if anyone comes up with doing it all the way. That is domain transformation for a Vasicek or Hull White Model from -infinit, + infinity to -1,1. But so far i didnt see it.

- Cuchulainn
**Posts:**64420**Joined:****Location:**Drosophila melanogaster-
**Contact:**

We (3 of us) are almost finished in this regard. We hope to publish parts of it in the next 3 weeks (my MSc student) and then later the 3 of us on a combined article.

We also 3 separate implementations in ADE, CN and MOL for HW1, HW2 and convertible bonds which is a good cross-check.

// We also did domain truncation as well.

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

- Cuchulainn
**Posts:**64420**Joined:****Location:**Drosophila melanogaster-
**Contact:**

Update: the one-factor model is in bed and complete, including calibration.

For the two-factor stochastic interest rate problem we are happy that the PDE is well-defined view of the problem. Since we don't have analytical solution we tested ADE-BarakatClark-Robert-Weiss (berndl!),**ADEBCRW** for short! against ODE(MOL) solvers

* modified_midpoint

* Runge_Kutta4

* Runge_Kutta_dopri5

The answers were the same.

Of course ADE >> MOL qua performance.

For the two-factor stochastic interest rate problem we are happy that the PDE is well-defined view of the problem. Since we don't have analytical solution we tested ADE-BarakatClark-Robert-Weiss (berndl!),

* modified_midpoint

* Runge_Kutta4

* Runge_Kutta_dopri5

The answers were the same.

Of course ADE >> MOL qua performance.

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl