Setting boundary conditions that you don't know
was followed by activated discussions on Wilmott's book forum.
Alan suggested to do similar calculations for more difficult examples than the one I used there, and this is exactly what I did.
Again, we work on the Vasicek model
but now sigma = 0.5 (that is 50 percent absolute volatility for the short rate), which is completely unrealistic for interest rates in the main currencies. The reversion speed should be b=0.5, and the parameter a either a=0 or a=1 (the second case means a mean reversion level of 200 percent). The bond values V for the 10 year zero coupon bonds with face amounts 1 can be calculated analytically (e.g., following Shreve). Assuming the random walks (in both cases) to start at r = 0, they are
sigma = 0.5, b=0.5, a=0: V = 33.56
and
sigma= 0.5, b=0.5, a=1: V = 3.68 E-06.
Of course, as the volatility is much higher than in the past blog, the calculation domain has to be chosen larger. Here are the results for the first case:
For the artificial boundary conditions V = 1, set at r = - 4 and at r = 4, we obtain (with a mesh size of 0.002) a bond value of 33.35. Again, we used upwinding for stabilization, which was quite successful, as indicated by the smooth curve.
The discrepancy between the analytic value and the numerical value stems from the mesh size (20 basis points), not from the boundary conditions.
In the second case (mean reverting to 200 percent), we obtain for two different Dirichlet boundary conditions to be set at r = -2 and at r = 6
Dirichlet boundary conditions V=0 |
Dirichlet boundary conditions V=1 |
In both cases, the numerical value for the bond was 3.48E-06 for a mesh size of 0.01 (1 percent).
The difference of the values for the two Dirichlet conditions can be seen (as a matter of fact, can not be seen) here:
No visible difference between the two Dirichlet boundary values outside the boundary layers |
My conclusions are:
1) Upwinding works excellently, also for weird cases
2) Boundary conditions do not influence the instrument value as long as set reasonably far away from the reversion level.
3) Mesh size does influence the value due to numerical errors.