[R-SIG-Finance] GBSVolatility not working on vectors?

Joachim Breit jbreit at nexgo.de
Thu Sep 25 16:03:33 CEST 2014


Rejoiced too soon.

It worked with my mini-dataframe but when doing it with the big one I got:

Fehler in uniroot(.fGBSVolatility, interval = c(-10, 10), price = price,  :
   f() values at end points not of opposite sign



Am 25.09.2014 14:32, schrieb Joachim Breit:
> Cool, that works.
> I'm a beginner (since a decade or so :-)
> Did not know Vectorize()
>
> Thank you so much!
>
> Am 25.09.2014 14:17, schrieb Shivam:
>>> dtemp$iva  <- Vectorize(GBSVolatility)(price = dtemp$ask, TypeFlag =
>>> dtemp$cp,
>> S = dtemp$c , X = dtemp$strike, Time = dtemp$ntd / 253.8,
>> r = pmax(dtemp$rb, 0), b = pmax(dtemp$rb, 0))
>
> _______________________________________________
> 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