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

Support error functions with arguments #2131

Merged

Conversation

eltoder
Copy link
Contributor

@eltoder eltoder commented Jan 7, 2025

Pass curve data (times and values) to GlobalBootstrap's error functions so that they can compute errors based on the curve's shape. For example, one can penalize gradient to make the curve smoother.

@eltoder eltoder force-pushed the feature/global-bootstrap-errors-fn branch from 5c41ac0 to 085536d Compare January 7, 2025 01:39
@coveralls
Copy link

coveralls commented Jan 7, 2025

Coverage Status

coverage: 73.25% (+0.004%) from 73.246%
when pulling 4a5b84f on eltoder:feature/global-bootstrap-errors-fn
into 947cab4 on lballabio:master.

@eltoder eltoder force-pushed the feature/global-bootstrap-errors-fn branch from 085536d to 4df4f0c Compare January 7, 2025 04:44
@@ -39,6 +39,8 @@ namespace QuantLib {
template <class Curve> class GlobalBootstrap {
typedef typename Curve::traits_type Traits; // ZeroYield, Discount, ForwardRate
typedef typename Curve::interpolator_type Interpolator; // Linear, LogLinear, ...
typedef std::function<Array(const std::vector<Time>&, const std::vector<Real>&)>
AdditionalErrors;
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe AdditionalPenalties would be more clear?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. Would you like the member variable renamed as well, or just the type?

Copy link
Owner

Choose a reason for hiding this comment

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

I'd change the whole lot.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. I also rebased this branch to make sure there are no conflicts with my previous PR.

Copy link
Owner

Choose a reason for hiding this comment

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

Thanks!

Pass curve data (times and values) to GlobalBootstrap's error functions
so that they can compute errors based on the curve's shape. For example,
one can penalize gradient to make the curve smoother.
@eltoder eltoder force-pushed the feature/global-bootstrap-errors-fn branch from 4df4f0c to 4a5b84f Compare January 28, 2025 15:47
@lballabio lballabio added this to the Release 1.38 milestone Jan 28, 2025
@lballabio lballabio merged commit 8f1cbbe into lballabio:master Jan 28, 2025
42 checks passed
@eltoder eltoder deleted the feature/global-bootstrap-errors-fn branch January 28, 2025 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants