Skip to content

GBSVolatility in fOptions

5 messages · financial engineer, Joshua Ulrich

#
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:
#
BA,

.fGBSVolatility is the objective function.  You asked about the
root-finding algorithm.  Please see ?uniroot; among other things, it
says:

     The function uses Fortran subroutine 'zeroin' (from Netlib)
     based on algorithms given in the reference below.  They assume a
     continuous function (which then is known to have at least one root
     in the interval).

Best,
--
Joshua Ulrich ?| ?FOSS Trading: www.fosstrading.com
On Tue, Nov 1, 2011 at 8:03 PM, financial engineer <fin_engr at hotmail.com> wrote: