Barrier Options

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

Barrier Options

Neil P Firth
Hi,

I've checked in some classes into Instruments, MonteCarlo, and
PricingEngines to price Barrier Options. I have wrapped the existing
analytic Pricer inside a PricingEngine, and done a MonteCarlo
PricingEngine. There are two PathPricers, one is a naive biased pricer and
the other uses the Brownian Bridge correction, as in:

"Simulating Path-Dependent Options: A New Approach"
  - M. El Babsiri and G. Noel
     Journal of Derivatives; Winter 1998; 6, 2

and

"Going to Extremes: Correcting Simulation Bias in Exotic Option Valuation"
  - D.R. Beaglehole, P.H. Dybvig and G. Zhou
     Financial Analysts Journal; Jan/Feb 1997; 53, 1

The current design is not the best, as the algorithm needs an independent
sample from a uniform [0,1] distribution, so this should probably come
from the same generator as the PathGenerator via some Template mechanism.
Currently it is nastily hard coded - beware!

I have an example class that I could check in. What is the overall idea
for the examples? We could end up with a great deal of Example code if we
include Examples for every type of option, TermStructure, SV, Jumps, etc.
What do people think?

Cheers,
Neil

---------------------------------------------------
  Neil Firth
  Brasenose College Oxford OX1 4AJ United Kingdom
  Office: 01865 280616
  [hidden email]
  http://www.maths.ox.ac.uk/~firth
---------------------------------------------------


Reply | Threaded
Open this post in threaded view
|

Re: Barrier Options

Luigi Ballabio-2
At 12:44 PM 9/23/03, Neil P Firth wrote:
>I've checked in some classes into Instruments, MonteCarlo, and
>PricingEngines to price Barrier Options.

<description snipped>

Hmm. Here go my hopes of releasing a mostly bug-fix release in the near
future... no, just kidding. It looks like a nice contribution. I'm
particularly intrigued by the biased path pricer---it's the first of the sort.


>I have an example class that I could check in.

An example CLASS? Java programming raises its ugly head... :)

>What is the overall idea for the examples? We could end up with a great
>deal of Example code if we include Examples for every type of option,
>TermStructure, SV, Jumps, etc.
>What do people think?

I'd rather turn the example into a test. If the papers you used give any
data, check that you can reproduce them (within an accuracy, of course.)
And yes, I would certainly have a test for every type of option.

As for examples, they started as half-witted tests before we had any real
one, and some QuantLib founder I won't name on this list still uses them to
insert any code he wants to test, because it's too much work for him to
clone a new Visual Studio project---which incidentally, is the reason why
the European Option example spits out a number of ugly, unformatted figures
about quanto and forward options :)
Anyway, we can keep them in order to showcase some feature, but I would
discourage an extensive coverage of the library through examples---the
development time would be better spent on writing tests.

Later,
         Luigi