Skip to content
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

Standardize dividend argument in option models #51

Merged
merged 2 commits into from
May 24, 2021
Merged

Standardize dividend argument in option models #51

merged 2 commits into from
May 24, 2021

Conversation

alembcke
Copy link
Contributor

@alembcke alembcke commented May 19, 2021

This pull request fixes #50.

Motivation/Rational

The argument for dividends across different option pricing models used two names when only one was needed. This pull request updates the files using continuous_dividends to instead use dividend_rates. This makes it easier for end-users to reuse code when using the different option pricing models.

Explanation of Changes

As requested in issue #50, deprecation decorators were used to alert users to the change in argument names. All argument names in the tf_quant_finance/black_scholes/ directory and sub-directories for continuous_dividends were changed to dividend_rates.

Testing

Many of the methods changed start with the variadic argument (*), which caused test to fail as Bazel would not recognize that the deprecated argument continuous_dividends was in the argument list, causing an error. When the variadic argument was removed, tests completed successfully.

@google-cla
Copy link

google-cla bot commented May 19, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label May 19, 2021
@alembcke
Copy link
Contributor Author

@googlebot I signed it!

@google-cla google-cla bot added cla: yes and removed cla: no labels May 19, 2021
Copy link
Contributor

@cyrilchim cyrilchim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the commit, Alex. Could you please also modify Heston option pricer?

Thank you!

@alembcke
Copy link
Contributor Author

alembcke commented May 21, 2021

One more item to consider, I also noticed that the API docs reference continuous_dividends, I assume that I should also update those references, do you agree? If so, I will update those and push another commit.

@cyrilchim
Copy link
Contributor

No worries about the API docs, they are synced via a script on a weekly basis

@tf-quant-finance-robot tf-quant-finance-robot merged commit 8f645f0 into google:master May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consistent argument names for dividends across option pricing models
3 participants