Take the 2-minute tour ×
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It's 100% free, no registration required.

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,
                                 timeSteps=150, gridPoints=149, engine="BaroneAdesiWhaley")

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

enter image description here

share|improve this question
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.