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

Wilson Nascimento De Freitas wfreitas at bvmf.com.br
Wed Oct 1 20:24:48 CEST 2014


Hi,

I ran that code with a data.frame of ~ 20K records.

https://gist.github.com/wilsonfreitas/9835012

Note that theo_price might be a wrapper of GBSOption (or any other function).

wf

-----Mensagem original-----
De: r-sig-finance-bounces at r-project.org [mailto:r-sig-finance-bounces at r-project.org] Em nome de Joachim Breit
Enviada em: quinta-feira, 25 de setembro de 2014 11:04
Para: r-sig-finance at r-project.org
Assunto: Re: [R-SIG-Finance] GBSVolatility not working on vectors?

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.
>

_______________________________________________
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.
'
________________________________

Esta mensagem pode conter informação confidencial e/ou privilegiada. Se você não for o destinatário ou a pessoa autorizada a receber esta mensagem, não deverá utilizar, copiar, alterar, divulgar a informação nela contida ou tomar qualquer ação baseada nessas informações. Se você recebeu esta mensagem por engano, por favor avise imediatamente o remetente, respondendo o e-mail e em seguida apague-o. Agradecemos sua cooperação.

This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, change, take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.
'


More information about the R-SIG-Finance mailing list