[R-SIG-Finance] [SPAM] - Implied Volatility, Column operation - Email found in subject
David Reiner
David.Reiner at xrtrading.com
Thu Nov 4 14:28:28 CET 2010
Right, the function is not vectorized. See ?Vectorize
HTH,
David L. Reiner
XR Trading LLC
-----Original Message-----
From: r-sig-finance-bounces at stat.math.ethz.ch [mailto:r-sig-finance-bounces at stat.math.ethz.ch] On Behalf Of Rohit Taklikar
Sent: Thursday, November 04, 2010 3:10 AM
To: r-sig-finance at stat.math.ethz.ch
Subject: [SPAM] - [R-SIG-Finance] Implied Volatility, Column operation - Email found in subject
Hi,
I have raw options data in an array and i am trying to calculate implied
volatility in a new column for all rows at once -
> sres$CALL_IV =
GBSVolatility(sres$CALL_PRICE,"c",sres$UNDERLYING_PRICE,sres$STRIKE,sres$TIME2EXP,0,0)
where, CALL_IV, CALL_PRICE, UNDERLYING_PRICE etc. are columns of "sres"
I am getting an errors and warnings for this:
======
Error in uniroot(.fGBSVolatility, interval = c(-10, 10), price = price, :
invalid function value in 'zeroin'
In addition: Warning messages:
1: In if (is.na(f.lower)) stop("f.lower = f(lower) is NA") :
the condition has length > 1 and only the first element will be used
2: In if (is.na(f.upper)) stop("f.upper = f(upper) is NA") :
the condition has length > 1 and only the first element will be used
3: In if (f.lower * f.upper > 0) stop("f() values at end points not of
opposite sign") :
the condition has length > 1 and only the first element will be used
======
However this works when i run a for loop it works. Does it mean column
operation is not supported by fOptions functions?
Any idea how to do this efficiently?
Regards,
[[alternative HTML version deleted]]
_______________________________________________
R-SIG-Finance at stat.math.ethz.ch 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.
This e-mail and any materials attached hereto, including, without limitation, all content hereof and thereof (collectively, "XR Content") are confidential and proprietary to XR Trading, LLC ("XR") and/or its affiliates, and are protected by intellectual property laws. Without the prior written consent of XR, the XR Content may not (i) be disclosed to any third party or (ii) be reproduced or otherwise used by anyone other than current employees of XR or its affiliates, on behalf of XR or its affiliates.
THE XR CONTENT IS PROVIDED AS IS, WITHOUT REPRESENTATIONS OR WARRANTIES OF ANY KIND. TO THE MAXIMUM EXTENT PERMISSIBLE UNDER APPLICABLE LAW, XR HEREBY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS AND IMPLIED, RELATING TO THE XR CONTENT, AND NEITHER XR NOR ANY OF ITS AFFILIATES SHALL IN ANY EVENT BE LIABLE FOR ANY DAMAGES OF ANY NATURE WHATSOEVER, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, CONSEQUENTIAL, SPECIAL AND PUNITIVE DAMAGES, LOSS OF PROFITS AND TRADING LOSSES, RESULTING FROM ANY PERSON'S USE OR RELIANCE UPON, OR INABILITY TO USE, ANY XR CONTENT, EVEN IF XR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR IF SUCH DAMAGES WERE FORESEEABLE.
More information about the R-SIG-Finance
mailing list