# The option values are different from two r package - foptions,rquantlib

The results are very different.I know the code from quantlib and the result of quantlib seem right(close to market price). Is there anyone know why the value from fOptions is so large or fOptions used different approach? Thank you

  library(fOptions)
library(RQuantLib)

TypeFlag<-"c"
S<-530.32
X<-550
Time<-283/365
r<-0.000703
b<-0.05
sigma<-0.2442

fOptions.BAW<-BAWAmericanApproxOption(TypeFlag, S, X, Time, r, b, sigma,
title = NULL, description = NULL)
quantlib.BAW<-AmericanOption("call", S, X,
b, r, Time, sigma,

modelName<-c("fOptions.BAW","quantlib.BAW")
result <-cbind(modelName,
c(fOptions.BAW@price,quantlib.BAW[1]\$value))
colnames(result)<-c("Model","Value")


-
The source code for both is available. Have you looked at it? –  Joshua Ulrich Jun 13 at 12:51
I already read the quantlib version (it can be found at github). I try to find the foptions source, but it wrote by fortran (which I don't understand). am i right or could you send me the link about foptions source code. Much obliged –  galaxyan Jun 13 at 14:34
Yes, it's in Fortran. You could compare the current version with archived versions of fOptions on CRAN. Maybe one of the older versions had a pure-R implementation. –  Joshua Ulrich Jun 13 at 15:06
@JoshuaUlrich thank you. –  galaxyan Jun 13 at 15:14