Posted by
Luigi Ballabio-2 on
URL: http://quantlib.414.s1.nabble.com/Help-with-fdAmericanOption-tp2452p2456.html
At 03:28 PM 4/8/03 -0700, Wry Boy wrote:
>So, regarding fdAmericanOption, can someone please
>explain the timeSteps and gridPoints variables?
>
>FdAmericanOption(
> Option::Type type,
> double underlying,
> double strike,
> Spread dividendYield,
> Rate riskFreeRate,
> Time residualTime,
> double volatility,
> int timeSteps, // <-- how to use this??
> int gridPoints // <-- how to use this??
>);
>
>I am interested in a pragmatic explanation, not a
>highly mathematical or theorectical one.
timeSteps is just, well, the number of time steps. If the option expires in
one year, 365 time steps mean that you'll be observing it once every day.
If it expires in 10 years, 120 time steps means you'll be observing it once
a month. This is very much alike time discretization on trees.
As for gridPoints; were you building a tree, it would be the number of
nodes at the latest time. In finite differences, you'll have the same
number at each time---which gives you a rectangular grid, as opposed to the
somewhat triangular shape of trees.
Be aware, though, that a bit of theory---not of at Ph.D. level---wouldn't
hurt in order to know what's going on and what the gotchas are. The pricers
in the library are stable enough, but if you want to roll your own, you'll
have to know how to avoid shooting your own foot.
>The other question I have is about optimizing the use
>of the lib to price many options. If I want to price
>thousands of options, for example, holding everything
>constant and varying the underlying price in small
>increments, would I do this by instantiating a new
>option object with each new underlying price? For
>example:
>
>for (double under=x; under<y; under+=0.25) {
>
> fdAmericanOption option(...,under,...);
> ... = option.value()
>}
>
>Is that the _best_ way to rip many values out of the
>lib?
Well, let's call it the current way. We're working on the best way. Or on a
better one, at least.
Bye,
Luigi