Page 3 of 4

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

Posted: August 22nd, 2019, 2:17 pm
The nice thing about NDSolve (in Mathematica) is that it automatically adopts a high order inward pointing derivative at boundaries, which then couples the system smoothly to the behavior of the solution at the interior points.

[Erroneous second comment deleted]

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

Posted: August 22nd, 2019, 7:29 pm
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).

There might be an interesting issue here for the student to explore. Although the so-called Feller condition (or Fichera condition if you like) is satisfied for the [$]B_r[$] PDE, I don't think it implies solution uniqueness here. That's because, for [$]0 < a < \sigma^2/2[$], the bond solutions [$]B[$] are NOT unique. Since the bond solution appears as a non-homogeneous driving term in the [$]B_r[$] PDE, two different bond solutions will lead to two different [$]B_r[$] solutions!

A second bond solution (the "absorbing" solution) is given at eqn (10.4) in my book.

From the point of view of a PDE system with two components [$](f,g) = (B,B_r)[$] (and assuming the interesting case [$]0 < a < \sigma^2/2[$]), consider the boundary conditions. Even if you are not free to specify a boundary condition at r=0 for g, you can or cannot for f. For example, you could specify (A) the "no boundary condition" condition or (B) the absorbing condition [$]B(r=0,t)=1[$]. Again, these two choices should lead to two different solutions for both components -- for the reason given in my first paragraph. Very interesting, I think!

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

Posted: August 25th, 2019, 10:51 am
Yes, a good case. In the past, the BC (or lack thereof) for [$]B[$] is well-known and as supervisor I demand ( )) that each student can work the schemes out from first principles. And stitch it up in C++. In fairness, this is a 3-month MSc projects so the students are working flat out to get results.

For your new great insight, we need indeed to know if a solution is unique or not and under which circumstances:

1. When Feller is satisfied
2. And when 1 in not satisfied

I suppose that numerical experimentation will give insights. Then PDE theory and energy estimates for well-posed PDE will give sufficient conditions for uniqueness. This has been done for bond price when Feller is satisfied by Fei Lu.

This is interesting also because the PDE is based on the Continuous Sensitivity Equation (CSE) approach.
BTW is it not so that CIR has a unique analytical solution for all values of the parameter regime?

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

Posted: August 25th, 2019, 11:04 am
Alan,
Regarding eq. 10.4 of your book, how can it be differentiated WRT r and the other parameters?

AFAIR, we are applying CSE to find a PDE for [$]B_\sigma[$].

BTW for [$]B_r[$] the Feller condition is always satisfied at [$]r = 0[$]. Correct?

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

Posted: August 25th, 2019, 1:51 pm
BTW is it not so that CIR has a unique analytical solution for all values of the parameter regime?
No. As explained on pg. 456 and also on pg 349 of my Vol. II, the CIR pde does *not* have a unique solution when (to use your notation) [$]0 < a < \sigma^2/2[$]. This is where the boundary is classified "regular".

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

Posted: August 25th, 2019, 2:01 pm
Alan,
Regarding eq. 10.4 of your book, how can it be differentiated WRT r and the other parameters?
>> Standard differentiation: "r" appears in 3 places.

BTW for [$]B_r[$] the Feller condition is always satisfied at [$]r = 0[$]. Correct?
>> The Feller condition, applied to the [$]B_r[$] pde, and using your notation, would say that [$]1 + 2 a/\sigma^2 > 1[$]. This would NOT be true if [$]a <0[$]. But, because of the driving  "B" term in that pde, there are *still* the same three parameter regimes as per Table 7.1 (pg 349) for the [$]B_r[$] pde. There is uniqueness (for those pde solutions) only when [$]a \le 0[$] or [$]a \ge \sigma^2/2[$].  As I suggested earlier, the solutions when [$]0 < a <\sigma^2/2[$] are not unique because the driving B solutions are not unique for that parameter range. To say it another way, if a function [$]f(r)[$] is not unique in a parameter range, then (apart from trivial exceptions that don't apply here), [$]f'(r)[$] will not be unique either.

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

Posted: August 25th, 2019, 4:05 pm
BTW is it not so that CIR has a unique analytical solution for all values of the parameter regime?
No. As explained on pg. 456 and also on pg 349 of my Vol. II, the CIR pde does *not* have a unique solution when (to use your notation) [$]0 < a < \sigma^2/2[$]. This is where the boundary is classified "regular".
In my energy estimates (Gronwall's inequality) it was not possible to prove is well-posed because we need to specify [$]B(r =0)[$]. I suspect there is an infinite number of solutions in this 'regular' case?

I think there is not enough information to specify a unique solution.

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

Posted: August 25th, 2019, 4:22 pm
Alan,
Regarding eq. 10.4 of your book, how can it be differentiated WRT r and the other parameters?
>> Standard differentiation: "r" appears in 3 places.

BTW for [$]B_r[$] the Feller condition is always satisfied at [$]r = 0[$]. Correct?
>> The Feller condition, applied to the [$]B_r[$] pde, and using your notation, would say that [$]1 + 2 a/\sigma^2 > 1[$]. This would NOT be true if [$]a <0[$]. But, because of the driving  "B" term in that pde, there are *still* the same three parameter regimes as per Table 7.1 (pg 349) for the [$]B_r[$] pde. There is uniqueness (for those pde solutions) only when [$]a \le 0[$] or [$]a \ge \sigma^2/2[$].  As I suggested earlier, the solutions when [$]0 < a <\sigma^2/2[$] are not unique because the driving B solutions are not unique for that parameter range. To say it another way, if a function [$]f(r)[$] is not unique in a parameter range, then (apart from trivial exceptions that don't apply here), [$]f'(r)[$] will not be unique either.
The Fichera function for  [$]B_r[$] is a constant, namely [$]a[$].

1. a >= 0 no BC (the Feller case)
2. a < 0 we need to provide some BC

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

Posted: August 25th, 2019, 4:31 pm
Alan,
Regarding eq. 10.4 of your book, how can it be differentiated WRT r and the other parameters?
>> Standard differentiation: "r" appears in 3 places.

BTW for [$]B_r[$] the Feller condition is always satisfied at [$]r = 0[$]. Correct?
>> The Feller condition, applied to the [$]B_r[$] pde, and using your notation, would say that [$]1 + 2 a/\sigma^2 > 1[$]. This would NOT be true if [$]a <0[$]. But, because of the driving  "B" term in that pde, there are *still* the same three parameter regimes as per Table 7.1 (pg 349) for the [$]B_r[$] pde. There is uniqueness (for those pde solutions) only when [$]a \le 0[$] or [$]a \ge \sigma^2/2[$].  As I suggested earlier, the solutions when [$]0 < a <\sigma^2/2[$] are not unique because the driving B solutions are not unique for that parameter range. To say it another way, if a function [$]f(r)[$] is not unique in a parameter range, then (apart from trivial exceptions that don't apply here), [$]f'(r)[$] will not be unique either.
The Fichera function for  [$]B_r[$] is a constant, namely [$]a[$].

1. a >= 0 no BC (the Feller case), we then get a coupled PDE involving  [$]{{(B, B_r)}}[$] at [$]r=0[$].
2. a < 0 we need to provide some BC

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

Posted: August 25th, 2019, 6:17 pm
Since I give  a (quasi)-analytic "absorbing" solution, all the various cases are checkable. BTW, when differentiating the latter w.r.t. r (which you asked about before), the identity

[$] M'(a,b,z) = \frac{a}{b} M(a+1,b+1,z)[$]  might be helpful (from Abramowitz & Stegun).

Using that will keep the [$]r[$]-derivative quasi-analytic.

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

Posted: August 25th, 2019, 6:36 pm
Since I give  a (quasi)-analytic "absorbing" solution, all the various cases are checkable. BTW, when differentiating the latter w.r.t. r (which you asked about before), the identity

[$] M'(a,b,z) = \frac{a}{b} M(a+1,b+1,z)[$]  might be helpful (from Abramowitz & Stegun).

Using that will keep the [$]r[$]-derivative quasi-analytic.
Ah yeah, it's all coming back now. We had a discussion on this a few years ago and I have C++ code for it somewhere.

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

Posted: April 12th, 2021, 6:24 pm
Alan,
Regarding eq. 10.4 of your book, how can it be differentiated WRT r and the other parameters?
>> Standard differentiation: "r" appears in 3 places.

BTW for [$]B_r[$] the Feller condition is always satisfied at [$]r = 0[$]. Correct?
>> The Feller condition, applied to the [$]B_r[$] pde, and using your notation, would say that [$]1 + 2 a/\sigma^2 > 1[$]. This would NOT be true if [$]a <0[$]. But, because of the driving  "B" term in that pde, there are *still* the same three parameter regimes as per Table 7.1 (pg 349) for the [$]B_r[$] pde. There is uniqueness (for those pde solutions) only when [$]a \le 0[$] or [$]a \ge \sigma^2/2[$].  As I suggested earlier, the solutions when [$]0 < a <\sigma^2/2[$] are not unique because the driving B solutions are not unique for that parameter range. To say it another way, if a function [$]f(r)[$] is not unique in a parameter range, then (apart from trivial exceptions that don't apply here), [$]f'(r)[$] will not be unique either.
Update: for the CIR ZCB PDE I use a priori energy estimates from 1st principles to "generate" Fichera and Feller. I don't need them.
But if [$]\sigma >= \sqrt{2 a}[$] then the energy inequality has a term in [$]B[$] at [$] r =0[$], so we give a Dirichlet BC?

The PDE for the duration [$]B_r[$] has [$]B[$] on RHS as driving term. But the Fichera for the former is [$]a > 0[$]. Looks like non-uniqueness.

I am trying to relate your p. 349 to my models..

Conjecture: if [$]a > 0[$] and [$]\sigma < \sqrt{2 a}[$] then [$]B_r[$] satisfies a priori estimate?

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

Posted: April 12th, 2021, 7:49 pm
Alan,
Regarding eq. 10.4 of your book, how can it be differentiated WRT r and the other parameters?
>> Standard differentiation: "r" appears in 3 places.

BTW for [$]B_r[$] the Feller condition is always satisfied at [$]r = 0[$]. Correct?
>> The Feller condition, applied to the [$]B_r[$] pde, and using your notation, would say that [$]1 + 2 a/\sigma^2 > 1[$]. This would NOT be true if [$]a <0[$]. But, because of the driving  "B" term in that pde, there are *still* the same three parameter regimes as per Table 7.1 (pg 349) for the [$]B_r[$] pde. There is uniqueness (for those pde solutions) only when [$]a \le 0[$] or [$]a \ge \sigma^2/2[$].  As I suggested earlier, the solutions when [$]0 < a <\sigma^2/2[$] are not unique because the driving B solutions are not unique for that parameter range. To say it another way, if a function [$]f(r)[$] is not unique in a parameter range, then (apart from trivial exceptions that don't apply here), [$]f'(r)[$] will not be unique either.
Update: for the CIR ZCB PDE I use a priori energy estimates from 1st principles to "generate" Fichera and Feller. I don't need them.
But if [$]\sigma >= \sqrt{2 a}[$] then the energy inequality has a term in [$]B[$] at [$] r =0[$], so we give a Dirichlet BC?

The PDE for the duration [$]B_r[$] has [$]B[$] on RHS as driving term. But the Fichera for the former is [$]a > 0[$]. Looks like non-uniqueness.

I am trying to relate your p. 349 to my models..

>> For [$]0 < a < \sigma^2/2[$], the most general solution is given by my 2nd line of (7.35). There [$]f(s)[$] is the flux at the origin, defined at (7.5), and is an arbitrary function. If f=0, you get a reflecting solution; for another choice of f, you get an absorbing solution. I think you have to read the whole chapter 7 pretty carefully through pg. 362 for it to make sense.

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

Posted: May 18th, 2021, 6:44 pm
update: i haven't had time to look at this (been proof-reading..)

But

1) Cox et al 1985 have analytical solutions for zcb and options. Can we differentiate them wrt a parameter to get sensitivities (how to differentiate a non-central chi^2 beast wrt a parameter?)
2) Is Feller condition just to get the PDE correct? Is it needed for 1)?
3) What about Hull White sensitivities? No Feller needed? no mean reversion.

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

Posted: May 19th, 2021, 2:26 pm
1) Cox et al 1985 have analytical solutions for zcb and options. Can we differentiate them wrt a parameter to get sensitivities (how to differentiate a non-central chi^2 beast wrt a parameter?)
>> Yes. Can always get a parameter derivative numerically, although there may be simplifications; lots of relations with Bessel funcs.
2) Is Feller condition just to get the PDE correct? Is it needed for 1)?
It's to pin down the boundary behavior. It's needed for 1) if you want to claim uniqueness of the solution.
3) What about Hull White sensitivities? No Feller needed? no mean reversion.
>> Sure, differentiate. Hull White r ranges over the whole real line, so no boundary issues; no Feller condition.