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

