Hi Joachim, Somehow I am not able to replicate your data in my workspace. But I would like to suggest you to try the below:
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)) Hope it helps. Regards, Shivam
*Victoria Concordia Crescit*