From noreply at r-forge.r-project.org Thu Jan 16 02:38:56 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 16 Jan 2014 02:38:56 +0100 (CET) Subject: [Rquantlib-commits] r335 - pkg/RQuantLib/src Message-ID: <20140116013856.DF294186776@r-forge.r-project.org> Author: edd Date: 2014-01-16 02:38:56 +0100 (Thu, 16 Jan 2014) New Revision: 335 Modified: pkg/RQuantLib/src/utils.cpp Log: make the epoch-offset between QL and R an internal const here, rather than accessing it from R's Date class Modified: pkg/RQuantLib/src/utils.cpp =================================================================== --- pkg/RQuantLib/src/utils.cpp 2013-06-05 02:51:26 UTC (rev 334) +++ pkg/RQuantLib/src/utils.cpp 2014-01-16 01:38:56 UTC (rev 335) @@ -295,9 +295,11 @@ // return(d.getJDN() - RcppDate::Jan1970Offset + RcppDate::QLtoJan1970Offset); // } +static const unsigned int QLtoJan1970Offset = 25569; // Offset between R / Unix epoch + // R and Rcpp::Date use the same 'days since epoch' representation; QL uses Excel style int dateFromR(const Rcpp::Date &d) { - return(d.getDate() + Rcpp::Date::QLtoJan1970Offset); + return(d.getDate() + QLtoJan1970Offset); } QuantLib::DayCounter getDayCounter(const double n){ From noreply at r-forge.r-project.org Thu Jan 16 02:39:21 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 16 Jan 2014 02:39:21 +0100 (CET) Subject: [Rquantlib-commits] r336 - pkg/RQuantLib/man Message-ID: <20140116013921.5B2721800B4@r-forge.r-project.org> Author: edd Date: 2014-01-16 02:39:21 +0100 (Thu, 16 Jan 2014) New Revision: 336 Modified: pkg/RQuantLib/man/AsianOption.Rd pkg/RQuantLib/man/BinaryOption.Rd pkg/RQuantLib/man/BondUtilities.Rd pkg/RQuantLib/man/Calendars.Rd pkg/RQuantLib/man/EuropeanOptionArrays.Rd pkg/RQuantLib/man/FixedRateBond.Rd pkg/RQuantLib/man/ImpliedVolatility.Rd Log: indent manual pages to less that 90 columns Modified: pkg/RQuantLib/man/AsianOption.Rd =================================================================== --- pkg/RQuantLib/man/AsianOption.Rd 2014-01-16 01:38:56 UTC (rev 335) +++ pkg/RQuantLib/man/AsianOption.Rd 2014-01-16 01:39:21 UTC (rev 336) @@ -64,7 +64,8 @@ stabilises its own API.} \examples{ # simple call with some explicit parameters, and slightly increased vol: -AsianOption("geometric", "put", underlying=80, strike=85, div=-0.03, riskFree=0.05, maturity=0.25, vol=0.2) +AsianOption("geometric", "put", underlying=80, strike=85, div=-0.03, + riskFree=0.05, maturity=0.25, vol=0.2) } \keyword{misc} Modified: pkg/RQuantLib/man/BinaryOption.Rd =================================================================== --- pkg/RQuantLib/man/BinaryOption.Rd 2014-01-16 01:38:56 UTC (rev 335) +++ pkg/RQuantLib/man/BinaryOption.Rd 2014-01-16 01:39:21 UTC (rev 336) @@ -59,7 +59,8 @@ \seealso{\code{\link{AmericanOption}},\code{\link{EuropeanOption}}} \examples{ -BinaryOption(binType="asset", type="call", excType="european", underlying=100, strike=100, dividendYield=0.02, +BinaryOption(binType="asset", type="call", excType="european", + underlying=100, strike=100, dividendYield=0.02, riskFreeRate=0.03, maturity=0.5, volatility=0.4, cashPayoff=10) } \keyword{misc} Modified: pkg/RQuantLib/man/BondUtilities.Rd =================================================================== --- pkg/RQuantLib/man/BondUtilities.Rd 2014-01-16 01:38:56 UTC (rev 335) +++ pkg/RQuantLib/man/BondUtilities.Rd 2014-01-16 01:39:21 UTC (rev 336) @@ -13,11 +13,16 @@ documented here mostly to provide a means to look up some of the possible values---the user is not expected to call these functions directly..} \usage{ -matchBDC(bdc = c("Following", "ModifiedFollowing", "Preceding", "ModifiedPreceding", "Unadjusted")) +matchBDC(bdc = c("Following", "ModifiedFollowing", "Preceding", + "ModifiedPreceding", "Unadjusted")) matchCompounding(cp = c("Simple", "Compounded", "Continuous", "SimpleThenCompounded")) -matchDayCounter(daycounter = c("Actual360", "ActualFixed", "ActualActual", "Business252", "OneDayCounter", "SimpleDayCounter", "Thirty360")) -matchDateGen(dg = c("Backward", "Forward", "Zero", "ThirdWednesday", "Twentieth", "TwentiethIMM")) -matchFrequency(freq = c("NoFrequency","Once", "Annual", "Semiannual", "EveryFourthMonth", "Quarterly", "Bimonthly", "EveryFourthWeek", "Biweekly", "Weekly", "Daily")) +matchDayCounter(daycounter = c("Actual360", "ActualFixed", "ActualActual", "Business252", + "OneDayCounter", "SimpleDayCounter", "Thirty360")) +matchDateGen(dg = c("Backward", "Forward", "Zero", "ThirdWednesday", + "Twentieth", "TwentiethIMM")) +matchFrequency(freq = c("NoFrequency","Once", "Annual", "Semiannual", + "EveryFourthMonth", "Quarterly", "Bimonthly", + "EveryFourthWeek", "Biweekly", "Weekly", "Daily")) matchParams(params) } \arguments{ Modified: pkg/RQuantLib/man/Calendars.Rd =================================================================== --- pkg/RQuantLib/man/Calendars.Rd 2014-01-16 01:38:56 UTC (rev 335) +++ pkg/RQuantLib/man/Calendars.Rd 2014-01-16 01:39:21 UTC (rev 336) @@ -78,7 +78,8 @@ isEndOfMonth(calendar="TARGET", dates=Sys.Date()) getEndOfMonth(calendar="TARGET", dates=Sys.Date()) endOfMonth(calendar="TARGET", dates=Sys.Date()) -getHolidayList(calendar="TARGET", from=Sys.Date(), to = Sys.Date() + 5, includeWeekends = 0) +getHolidayList(calendar="TARGET", from=Sys.Date(), to = Sys.Date() + 5, + includeWeekends = 0) holidayList(calendar="TARGET", from=Sys.Date(), to = Sys.Date() + 5, includeWeekends = 0) adjust(calendar="TARGET", dates=Sys.Date(), bdc = 0) Modified: pkg/RQuantLib/man/EuropeanOptionArrays.Rd =================================================================== --- pkg/RQuantLib/man/EuropeanOptionArrays.Rd 2014-01-16 01:38:56 UTC (rev 335) +++ pkg/RQuantLib/man/EuropeanOptionArrays.Rd 2014-01-16 01:39:21 UTC (rev 336) @@ -12,8 +12,10 @@ corresponds to an evaluation under the given set of parameters. } \usage{ -EuropeanOptionArrays(type, underlying, strike, dividendYield, riskFreeRate, maturity, volatility) -oldEuropeanOptionArrays(type, underlying, strike, dividendYield, riskFreeRate, maturity, volatility) +EuropeanOptionArrays(type, underlying, strike, dividendYield, + riskFreeRate, maturity, volatility) +oldEuropeanOptionArrays(type, underlying, strike, dividendYield, + riskFreeRate, maturity, volatility) plotOptionSurface(EOres, ylabel="", xlabel="", zlabel="", fov=60) } \arguments{ Modified: pkg/RQuantLib/man/FixedRateBond.Rd =================================================================== --- pkg/RQuantLib/man/FixedRateBond.Rd 2014-01-16 01:38:56 UTC (rev 335) +++ pkg/RQuantLib/man/FixedRateBond.Rd 2014-01-16 01:39:21 UTC (rev 336) @@ -205,9 +205,12 @@ FixedRateBond(bond, coupon.rate, discountCurve, dateparams) -FixedRateBondPriceByYield(,0.0307, 100000, as.Date("2004-11-30"), as.Date("2008-11-30"), 3, , c(0.02875), , , , ,as.Date("2004-11-30")) +FixedRateBondPriceByYield(,0.0307, 100000, as.Date("2004-11-30"), + as.Date("2008-11-30"), 3, , c(0.02875), + , , , ,as.Date("2004-11-30")) -FixedRateBondYield(,90, 100000, as.Date("2004-11-30"), as.Date("2008-11-30"), 3, , c(0.02875), , , , ,as.Date("2004-11-30")) +FixedRateBondYield(,90, 100000, as.Date("2004-11-30"), as.Date("2008-11-30"), + 3, , c(0.02875), , , , ,as.Date("2004-11-30")) } \keyword{misc} Modified: pkg/RQuantLib/man/ImpliedVolatility.Rd =================================================================== --- pkg/RQuantLib/man/ImpliedVolatility.Rd 2014-01-16 01:38:56 UTC (rev 335) +++ pkg/RQuantLib/man/ImpliedVolatility.Rd 2014-01-16 01:39:21 UTC (rev 336) @@ -39,7 +39,8 @@ \code{\link{BinaryOption}}} \examples{ -impVol<-EuropeanOptionImpliedVolatility("call", value=11.10, strike=100, volatility=0.4, 100, 0.01, 0.03, 0.5) +impVol<-EuropeanOptionImpliedVolatility("call", value=11.10, strike=100, + volatility=0.4, 100, 0.01, 0.03, 0.5) print(impVol) summary(impVol) } From noreply at r-forge.r-project.org Thu Jan 16 02:39:48 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 16 Jan 2014 02:39:48 +0100 (CET) Subject: [Rquantlib-commits] r337 - pkg/RQuantLib/R Message-ID: <20140116013948.2E76B1800B4@r-forge.r-project.org> Author: edd Date: 2014-01-16 02:39:47 +0100 (Thu, 16 Jan 2014) New Revision: 337 Modified: pkg/RQuantLib/R/inline.R Log: use '::' instead of ':::' as Rcpp::LdFlags() is now exported Modified: pkg/RQuantLib/R/inline.R =================================================================== --- pkg/RQuantLib/R/inline.R 2014-01-16 01:39:21 UTC (rev 336) +++ pkg/RQuantLib/R/inline.R 2014-01-16 01:39:47 UTC (rev 337) @@ -29,7 +29,7 @@ boostlib <- Sys.getenv("BOOSTLIB") rarch <- Sys.getenv("R_ARCH") qlcflags <- sprintf("-I%s -I. -I\"%s\"", qlroot, boostlib) - qllibs <- sprintf("%s -L%s/lib%s -lQuantLib", Rcpp:::LdFlags(), rarch) + qllibs <- sprintf("%s -L%s/lib%s -lQuantLib", Rcpp::LdFlags(), rarch) } else { qlcflags <- system( "quantlib-config --cflags", intern = TRUE) qllibs <- system( "quantlib-config --libs", intern = TRUE) From noreply at r-forge.r-project.org Thu Jan 16 02:40:26 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 16 Jan 2014 02:40:26 +0100 (CET) Subject: [Rquantlib-commits] r338 - pkg/RQuantLib Message-ID: <20140116014026.8D210185371@r-forge.r-project.org> Author: edd Date: 2014-01-16 02:40:26 +0100 (Thu, 16 Jan 2014) New Revision: 338 Modified: pkg/RQuantLib/DESCRIPTION Log: updated Depends and Imports relationships to Rcpp and methods Modified: pkg/RQuantLib/DESCRIPTION =================================================================== --- pkg/RQuantLib/DESCRIPTION 2014-01-16 01:39:47 UTC (rev 337) +++ pkg/RQuantLib/DESCRIPTION 2014-01-16 01:40:26 UTC (rev 338) @@ -24,7 +24,7 @@ Note that while RQuantLib's code is licensed under the GPL (v2 or later), QuantLib itself is released under a somewhat less restrictive Open Source license (see QuantLib-License.txt). -Depends: R (>= 2.10.0), Rcpp (>= 0.8.7), methods +Depends: R (>= 2.10.0) Suggests: rgl, zoo, RUnit Imports: methods, Rcpp LinkingTo: Rcpp From noreply at r-forge.r-project.org Thu Jan 16 02:40:45 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 16 Jan 2014 02:40:45 +0100 (CET) Subject: [Rquantlib-commits] r339 - pkg/RQuantLib Message-ID: <20140116014045.CF574185371@r-forge.r-project.org> Author: edd Date: 2014-01-16 02:40:45 +0100 (Thu, 16 Jan 2014) New Revision: 339 Modified: pkg/RQuantLib/ChangeLog Log: document changes Modified: pkg/RQuantLib/ChangeLog =================================================================== --- pkg/RQuantLib/ChangeLog 2014-01-16 01:40:26 UTC (rev 338) +++ pkg/RQuantLib/ChangeLog 2014-01-16 01:40:45 UTC (rev 339) @@ -1,3 +1,22 @@ +2014-01-15 Dirk Eddelbuettel + + * DESCRIPTION: Release 0.3.11 (??) + + * src/utils.cpp: Make the epoch-offset between QL and R an internal + const here, rather than accessing it from R's Date class + + * DESCRIPTION: Update Depends and Imports relationships + + * R/inline.R: Call Rcpp::LdFlags() now that it is exported + + * man/AsianOption.Rd: Indent to less that 90 columns + * man/BinaryOption.Rd: Idem + * man/BondUtilities.Rd: Idem + * man/Calendars.Rd: Idem + * man/EuropeanOptionArrays.Rd: Idem + * man/FixedRateBond.Rd: Idem + * man/ImpliedVolatility.Rd: Idem + 2013-05-26 Dirk Eddelbuettel * R/inline.R: Adding a plugin for use by Rcpp attribute or inline From noreply at r-forge.r-project.org Thu Jan 16 04:43:23 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 16 Jan 2014 04:43:23 +0100 (CET) Subject: [Rquantlib-commits] r340 - in pkg/RQuantLib: . R Message-ID: <20140116034323.B3EB11852AE@r-forge.r-project.org> Author: edd Date: 2014-01-16 04:43:18 +0100 (Thu, 16 Jan 2014) New Revision: 340 Modified: pkg/RQuantLib/ChangeLog pkg/RQuantLib/R/inline.R pkg/RQuantLib/R/mod.R Log: one more '::' instead of ':::' for calling from Rcpp, and not instantiate basic modules for now Modified: pkg/RQuantLib/ChangeLog =================================================================== --- pkg/RQuantLib/ChangeLog 2014-01-16 01:40:45 UTC (rev 339) +++ pkg/RQuantLib/ChangeLog 2014-01-16 03:43:18 UTC (rev 340) @@ -8,6 +8,7 @@ * DESCRIPTION: Update Depends and Imports relationships * R/inline.R: Call Rcpp::LdFlags() now that it is exported + * R/inline.R: Idem for Rcpp::Rcpp.plugin.maker() * man/AsianOption.Rd: Indent to less that 90 columns * man/BinaryOption.Rd: Idem @@ -17,6 +18,8 @@ * man/FixedRateBond.Rd: Idem * man/ImpliedVolatility.Rd: Idem + * R/mod.R: Do not attempt to load modules for now + 2013-05-26 Dirk Eddelbuettel * R/inline.R: Adding a plugin for use by Rcpp attribute or inline Modified: pkg/RQuantLib/R/inline.R =================================================================== --- pkg/RQuantLib/R/inline.R 2014-01-16 01:40:45 UTC (rev 339) +++ pkg/RQuantLib/R/inline.R 2014-01-16 03:43:18 UTC (rev 340) @@ -48,10 +48,9 @@ } inlineCxxPlugin <- function(...) { - plugin <- - Rcpp:::Rcpp.plugin.maker(include.before = "#include ", - libs = sprintf("%s $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)", LdFlags(FALSE)), - package = "RQuantLib", Makevars = NULL, Makevars.win = NULL) + plugin <- Rcpp::Rcpp.plugin.maker(include.before = "#include ", + libs = sprintf("%s $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)", LdFlags(FALSE)), + package = "RQuantLib", Makevars = NULL, Makevars.win = NULL) settings <- plugin() settings$env$PKG_CPPFLAGS <- CFlags(FALSE) settings Modified: pkg/RQuantLib/R/mod.R =================================================================== --- pkg/RQuantLib/R/mod.R 2014-01-16 01:40:45 UTC (rev 339) +++ pkg/RQuantLib/R/mod.R 2014-01-16 03:43:18 UTC (rev 340) @@ -1,3 +1,3 @@ -loadModule("BondsMod", TRUE) -loadModule("BlackMod", TRUE) +#loadModule("BondsMod", TRUE) +#loadModule("BlackMod", TRUE)