-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modified bermudan option module to allow for swaptions other than 1 y… #34
Conversation
…ear option into 5 year swap. Modified documentation regarding new startDate and maturity inputs required for bermudan function call. Modified discountcurve by merging the floating and fixed paramters into a single list "legparams".
The bermudanswaption() function has the start date and maturity hard coded as 1 year and 1+5 years. I modded the code to allow for general option expirations and swap maturities. I also did not like the klunky way fix/float parameters are set in discount curve from my last pull request and merged them into a single structure and merged them into a single list "legparams" |
Thanks for the submission! Do you see that this shows merge conflicts? Do you want to sort this out at your end -- presumably by syncing with the state of master in RQuantLib, resolving conflicts and the committing? Would make for a cleaner process... |
@@ -20,13 +20,13 @@ | |||
## along with RQuantLib. If not, see <http://www.gnu.org/licenses/>. | |||
|
|||
DiscountCurve <- function(params, tsQuotes, times=seq(0,10,.1), | |||
fixParams=list(dayCounter="Thirty360",freq="Annual"),floatFreq=as.integer(6)) { | |||
legparams=list(dayCounter="Thirty360",freq="Annual",floatFreq="Semiannual")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I like that.
Sure. I forked your master and pulled to my machine, modded, and pushed, so not sure what I did wrong there. Will sort it.
|
Looks nice otherwise. I can merge by hand too -- which gets your commits in -- but that would not, I think, get the pull request in as such. |
…ith a default to 1 year swaption expiration tenor from trade date and 5 year maturity from start date using US calendar. Warning message is provided.
Do you want help getting it merged? I can do the manual steps outlined at the link here. |
If you could it would be a big help. I'm traveling with my family trying to have a holiday, it would be a big help. |
Here is goes -- you seem to not have been current. I'll try to sort this out, at least in this branch.
|
I am not really comfortable with this. Blocks seem to be missing, eg this from https://github.com/eddelbuettel/rquantlib/blob/master/src/discount.cpp#L96-L100 Including a closing brace. I don't like this. Maybe a better approach would be to take the weekend off, and not rush this. I suggest that maybe you hold on to this PR to keep track of the changes you, but otherwise start with a clean checkout of master of my repo eg let's try to start from a clean sheet with commit 11583dc which is the most recent one. |
Also once again all indentation is off. It cannot be so difficult to just load the RStudio project file to obtain four space indentation. This makes the comparison MUCH harder than it needs. |
With the section I found as missing inserted, it builds and passes regression tests.
So our procedures are not yet that well oiled. |
I agree, take the weekend off. Nit sure what happened as I forked the main and pulled into RStudio to mod. I was careful to make changes only to lines I was targeting and avoided any global re-indentation. Tabs were set to 4. The changes were straightforward and I think I could do them again in an hour, so I propose I do a clean pull, mod it, and push again and see what we get. |
If you look at RQuantLib now and notice the two branches, you can probably launch a 'Compare' similar to a pull request. That is what your next pull request should look: minimal and contained changes. We will get there. It may take some practice. I would also like you submit issue tickets before making breaking changes such as the leg timing. Some things are better discussed prior to making changes. |
Thank you. |
Ok, so I think I figured this out. I forked the main repository but pulled the code from the main repository to my linux box (headless, so no github app). I just did a pull request from the master to my master on my machine (which is what I should have done instead of fork), so now I will pull this down to my machine to code. |
You seem confused. This has nothing to do with whether you use an app by github or not. We use a repo here. If you "fork at GitHub" (say in the webclient) you create a remote copy of my repo in your GitHub account at github. At that point you desktop and laptop have identical status; you would just clone to either. I regularly work on at least three different computers for some repo (home, laptop, work) and it is totally seamless. Please try a few of the existing git / github / ... tutorials. And/or play at Bitbucket or Gitlab (which allow you to have private repos so you can commit at will without anybody seeing it). |
…ear option into 5 year swap. Modified documentation regarding new startDate and maturity inputs required for bermudan function call. Modified discountcurve by merging the floating and fixed paramters into a single list "legparams".