Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upModified code to allow for stripping curves in Discount Curve that ha… #31
Conversation
…vefixed rate coupon frequency other than annual, fixed day count convetions other than Thirty360, and floating frequency reset other than 6 months. These are critical for adding basis curve impact for discounting.
|
Dirk, I left the original rate helper and created a new definition for the curve stripper as the Bermudan option module expects the original version and I did not see a reason to mod the swaption code at this time. Terry |
| @@ -59,6 +59,11 @@ DiscountCurve(params, tsQuotes, times) | |||
| that the largest time plus \code{dt} does not exceed the longest | |||
| maturity of the instruments used for calibration (no extrapolation). | |||
| } | |||
| \item{cpnParams}{A list specifying the \code{dayCounter} the day count convention for the | |||
| fixed leg (default is Thirty360), and \code{freq}, fixed coupon frequecny (defualt is Annua). | |||
eddelbuettel
Mar 18, 2016
Owner
Annual, not Annua.
Annual, not Annua.
|
That looks good at a first (uncaffeniated) glance. Sadly a lot of changes appear to just be whitespace which makes it a little noisy -- maybe we still have tabs in the files from way back when. There is also rquantlib-tl.Rproj which simply does not belong. I can clean that up, but if you could just 'git rm' it I'd appreciate it. Also, leaving indentation of existing files rather than changing it is considered polite. I prefer 4 spaces just like QuantLib. See here and I also follow the R style (described in one of the manuals). ChangeLog and NEWS entries would also be nice. I can add those. But the bigger issue is: it is a clean extension which passes unit tests. Nice! I'll look more closely when I have a moment. |
|
Thanks! One thing you should be made aware of is the fact the unit test do not exercise (or exorcise) the fixed income routines. The "tests" directory has a master script Rquantlib.R and a matching output that I checked against, but while that script has a non-flat term structure, it isn't utilized. I checked old released version versus new version with the term structure in the file. To use the term structure in the file with the enclosed params you also need to set the evaluation date properly with setEvalutaionDate or the interpolation method will fail. I'll set the spacing in my various RStudio's I'm using to develop (centos,osx,ubuntu and windows) |
|
Look in inst/unitTests/ for the testing framework. It uses RUnit. I can walk you through. Thanks for switching to 4 spaces. I think if you used the existing Rproj file it may work too... |
|
I removed the project file and fixed the typo and pushed, do I execute From: Dirk Eddelbuettel notifications@github.com Look in inst/unitTests/ for the testing framework. It uses RUnit. I can walk Thanks for switching to 4 spaces. I think if you used the existing Rproj � |
|
No, GitHub is smarter than that. The page at #31 lists this discussion and also the fact that there are now two commits. |
|
Ok, I'll merge and post-process, restablished standard indentation and what not. |
Modified code to allow for stripping curves in Discount Curve that ha…
ad2b783
into
eddelbuettel:master
|
Hm, why where the commits made by a Mark at a domain The file ChangeLog needs a name and email. I will put yours in for now. Should that be changed? |
|
not sure why his domain shows up, he worked on another project with me last year and we share some repositories on github. yes, use my name and email and I will look into and fix that going forward. Sent from my iPhone
|
| @@ -166,15 +169,17 @@ QuantLib::DateGeneration::Rule getDateGenerationRule(const double n); | |||
| boost::shared_ptr<QuantLib::YieldTermStructure> buildTermStructure(Rcpp::List params, Rcpp::List); | |||
| QuantLib::Schedule getSchedule(Rcpp::List rparam); | |||
| boost::shared_ptr<QuantLib::FixedRateBond> getFixedRateBond(Rcpp::List bondparam, std::vector<double> ratesVec, Rcpp::List scheduleparam); | |||
| boost::shared_ptr<QuantLib::IborIndex> getIborIndex(Rcpp::List index, const QuantLib::Date today); | |||
| //boost::shared_ptr<QuantLib::IborIndex> getIborIndex(Rcpp::List index, const QuantLib::Date today);////****** | |||
| /*boost::shared_ptr<QuantLib::IborIndex> getIborIndex(std:string type);////******/ | |||
eddelbuettel
Mar 19, 2016
Owner
What are you trying to say here with //****** ? To be revisited?
It is a real pain we don't have clean diff's. I am restoring whitespace to what it was so the diff between the next and the previous diff will be more meaningful.
What are you trying to say here with //****** ? To be revisited?
It is a real pain we don't have clean diff's. I am restoring whitespace to what it was so the diff between the next and the previous diff will be more meaningful.
|
It will be an issue related to your github setup / account id etc. You may want to look into that going forward. Almost done cleaning. Was a bit more painful than it needed to be, but now (at last ;-) I see your changes more clearly and they are nice and clean. We will get coding and indentation style etc sorted out. |
no code changes, small fixes to Rd file
|
I pushed a new branch which I will probably merge into master shortly too. If you set my repository up as a remote 'parentrepo' (eg via something like
then
will sync your fork. Right now you'd have to merge with the branch that has my changes. |
…vefixed rate coupon frequency other than annual, fixed day count convetions other than Thirty360, and floating frequency reset other than 6 months. These are critical for adding basis curve impact for discounting.