[R-sig-finance] question on GBS

Dirk Eddelbuettel edd at debian.org
Thu Nov 4 20:16:27 CET 2004


On Thu, Nov 04, 2004 at 10:03:20AM -0800, s viswanath wrote:
> hello r experts,
> 
> i am tryingto back out implied volatility from some options and am struggling to get an understanding of 
> tol(erence) and how to set it as shown below.
> 
>  GBSVolatility(price, TypeFlag, S, X, Time, r, b, tol, maxiter)
> 
> Could someone please provide and example of what tolerence means and how to set it?

Implied vol is calculated by one-dimensional numerical optimisation, and
such methods need a convergence criterion -- tol and maxiter are just that.

What you may have overlooked is that these do not need to be set as default
valies are defined in the function definition:

> args(GBSVolatility)
function (price, TypeFlag = c("c", "p"), S, X, Time, r, b, tol = .Machine$double.eps, 
    maxiter = 10000) 
NULL

So you only need to supply the other arguments.  Here is the implied vol. on
a current valuation of IBM @ 90 in Dec:

> GBSVolatility(3.4, "c", 92.20, 90, 44/365, 0.01977, 0.01977-0.0134)
[1] 0.1646709

which happens to be pretty close to where Bloomberg has it: 16.488%

Hope this helps, and *please* remove all the irrelevant quoted material
before you post.

Best, Dirk

-- 
If your hair is standing up, then you are in extreme danger.
      -- http://www.usafa.af.mil/dfp/cockpit-phys/fp1ex3.htm



More information about the R-sig-finance mailing list