[Rquantlib-commits] r268 - in pkg/RQuantLib: inst src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jul 6 03:49:24 CEST 2010


Author: edd
Date: 2010-07-06 03:49:23 +0200 (Tue, 06 Jul 2010)
New Revision: 268

Modified:
   pkg/RQuantLib/inst/ChangeLog
   pkg/RQuantLib/src/asian.cpp
Log:
make it NaN when we don't have greeks
add to Khanh's work to changelog


Modified: pkg/RQuantLib/inst/ChangeLog
===================================================================
--- pkg/RQuantLib/inst/ChangeLog	2010-07-06 01:20:36 UTC (rev 267)
+++ pkg/RQuantLib/inst/ChangeLog	2010-07-06 01:49:23 UTC (rev 268)
@@ -1,3 +1,9 @@
+2010-07-05  Khanh Nguyen  <knguyen at cs.umb.edu>
+
+	* src/asian.cpp: Added arithmetic average case
+	* R/asian.R: Idem
+	* man/asian.Rd: Idem
+
 2010-06-23  Dirk Eddelbuettel  <edd at debian.org>
 
 	* src/*: Converted remainder of code to new Rcpp API
@@ -7,7 +13,7 @@
 	* R/calendar.R: New helper function setCalendarContext()
 	setting calendar, fixingDays and settleDate
 	* src/calendar.cpp: Implementation, setting RQLContext
-	* R/setCalendarContext.Rd: Documentation
+	* man/setCalendarContext.Rd: Documentation
 
 	* src/bermudan.cpp: take calendar info from RQLContext
 	* src/discount.cpp: idem

Modified: pkg/RQuantLib/src/asian.cpp
===================================================================
--- pkg/RQuantLib/src/asian.cpp	2010-07-06 01:20:36 UTC (rev 267)
+++ pkg/RQuantLib/src/asian.cpp	2010-07-06 01:49:23 UTC (rev 268)
@@ -42,9 +42,6 @@
 
         Option::Type optionType = getOptionType(type);
 
-    
-        
-
         //from test-suite/asionoptions.cpp
         DayCounter dc = Actual360();
         Date today = Date::todaysDate();
@@ -121,12 +118,12 @@
                                                 payoff, exercise);
             option.setPricingEngine(engine);
             rl = Rcpp::List::create(Rcpp::Named("value") = option.NPV(),
-                                    Rcpp::Named("delta") = 0,
-                                    Rcpp::Named("gamma") = 0,
-                                    Rcpp::Named("vega") = 0,
-                                    Rcpp::Named("theta") = 0 ,
-                                    Rcpp::Named("rho") = 0,
-                                    Rcpp::Named("divRho") = 0,
+                                    Rcpp::Named("delta") = R_NaN,
+                                    Rcpp::Named("gamma") = R_NaN,
+                                    Rcpp::Named("vega") = R_NaN,
+                                    Rcpp::Named("theta") = R_NaN,
+                                    Rcpp::Named("rho") = R_NaN,
+                                    Rcpp::Named("divRho") = R_NaN,
                                     Rcpp::Named("parameters") = optionParameters);
         } else {
             throw std::range_error("Unknown average type " + type);



More information about the Rquantlib-commits mailing list