[R-SIG-Finance] GBSVolatility in fOptions

Joshua Ulrich josh.m.ulrich at gmail.com
Wed Nov 2 01:48:11 CET 2011


You have the source code.  Take a look:

GBSVolatility = function(price, TypeFlag = c("c", "p"), S, X, Time, r, b,
tol = .Machine$double.eps, maxiter = 10000)
{
    TypeFlag = TypeFlag[1]
    volatility = uniroot(.fGBSVolatility, interval = c(-10,10), price = price,
        TypeFlag = TypeFlag, S = S, X = X, Time = Time, r = r, b = b,
        tol = tol, maxiter = maxiter)$root
   volatility
}

There you go.  Now you can read ?uniroot to see what it does.
--
Joshua Ulrich  |  FOSS Trading: www.fosstrading.com



On Tue, Nov 1, 2011 at 6:59 PM, financial engineer <fin_engr at hotmail.com> wrote:
>
> hi,
> Can anyone shed some light on which root-finding algorithm the GBSVolatility function uses - is it the Newton method?
> thanks,
> BA
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.
>



More information about the R-SIG-Finance mailing list