[R] RQuantlib
Joe Byers
joe-byers at utulsa.edu
Tue May 23 03:08:44 CEST 2006
RQuantlib Experrs
I am trying to perform some analysis on a dataset of options.
I got RQuantlib to work using a for loop over my data.frame. I tried
the sapply, lapply, and other apply functions to no avial.
My first error occurs with the following
x<-sapply(X=atm.work,FUN=EuropeanOption, underlying =
atm.work$For_Price, strike = atm.work$K,
dividendYield = atm.work$BEY, riskFreeRate = atm.work$BEY,
maturity = atm.work$t_exp,
volatility = atm.work$sigma)
Note, the type= is not specified. The function picks up my date column
in the data.frame as the type= column.
> x<-sapply(X=atm.work,FUN=EuropeanOption,underlying =
atm.work$For_Price, strike = atm.work$K,
+ dividendYield = atm.work$BEY, riskFreeRate = atm.work$BEY, maturity =
atm.work$t_exp,
+ volatility = atm.work$sigma)
Error in EuropeanOption.default(X[[2]], ...) :
Unexpected option type 2Jan97, aborting
When I include a column named type with "put" in all rows I get the
following error
x<-sapply(X=atm.work,FUN=EuropeanOption, underlying =
atm.work$For_Price, strike = atm.work$K,
+ dividendYield = atm.work$BEY, riskFreeRate = atm.work$BEY, maturity =
atm.work$t_exp,
+ volatility = atm.work$sigma, type=atm.work$type)
Error in FUN(X[[1]], ...) : unused argument(s) ( ...)
Using type="put" or type=rep(1,nrows,"put") all get this unused argument
error.
I check the function call to see what happens with I do not include the
correct number of parameters. I received
error messages detailing the call order of European parms.
Thank you
Joe
More information about the R-help
mailing list