FDM Boundary Conditions in QuantLib

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

FDM Boundary Conditions in QuantLib

Haoyun XU
Dear all,

I wonder what are the boundary conditions used by QuantLib FDM pricing engines (e.g., FdBlackScholesBarrierEngine). I understand this may be scheme-dependent. If that's the case, you can use ImplicitEuler as an example. 

Assume we have N price grids at each time step, representing stock prices ranging from Smin to Smax (both inclusive). When we discretize the PDE, we have N-2 equations (1 for each inner grid). To make it complete, we need boundary conditions at Smin & Smax for each time step.

We could do this in a product-specific way. For example, we can specify simple Dirichlet boundary conditions for vanilla European options as below:
  • Vanilla Call
    • V(Smin, t) = 0
    • V(Smax, t) = S - K exp (-r * (T - t))
  • Vanilla Put
    • V(Smin, t) = K * exp (-r * (T - t))
    • V(Smax, t) = 0
Alternatively we may impose some "generic" boundary conditions, as suggested by Wilmott. See Wilmott on QF (2nd edition) Vol 3 Chapter 77.10.

Or maybe there are other techniques to handle it, which I are not aware of.

I tried to trace the code myself, but got lost in the method ImplicitEulerScheme::step().

Could someone help on this?


Best wishes,
Henry

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: FDM Boundary Conditions in QuantLib

Ralph Schreyer-3
Hi,

if the boundary conditions specified in the corresponding engine are empty, generic boundary conditions are chosen, i.e. the second derivative vanishes. And for the vanilla this is good enough, see ql/pricingengines/vanilla/fdblackscholesvanillaengine.cpp

For the example you mentioned (the barrier engine), Dirichlet boundary conditions are specified, see ql/pricingengines/barrier/fdblackscholesbarrierengine.cpp


Cheers
Ralph


2014-04-23 10:05 GMT+02:00 Haoyun XU <[hidden email]>:
Dear all,

I wonder what are the boundary conditions used by QuantLib FDM pricing engines (e.g., FdBlackScholesBarrierEngine). I understand this may be scheme-dependent. If that's the case, you can use ImplicitEuler as an example. 

Assume we have N price grids at each time step, representing stock prices ranging from Smin to Smax (both inclusive). When we discretize the PDE, we have N-2 equations (1 for each inner grid). To make it complete, we need boundary conditions at Smin & Smax for each time step.

We could do this in a product-specific way. For example, we can specify simple Dirichlet boundary conditions for vanilla European options as below:
  • Vanilla Call
    • V(Smin, t) = 0
    • V(Smax, t) = S - K exp (-r * (T - t))
  • Vanilla Put
    • V(Smin, t) = K * exp (-r * (T - t))
    • V(Smax, t) = 0
Alternatively we may impose some "generic" boundary conditions, as suggested by Wilmott. See Wilmott on QF (2nd edition) Vol 3 Chapter 77.10.

Or maybe there are other techniques to handle it, which I are not aware of.

I tried to trace the code myself, but got lost in the method ImplicitEulerScheme::step().

Could someone help on this?


Best wishes,
Henry

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users