Skip to content

Include all coefficients in ExponentialSplinesFitting when kappa is fixed - #3056

Merged
lballabio merged 2 commits into
lballabio:masterfrom
RAJ-A58:fix/exponential-splines-fixed-kappa
Nov 13, 2026
Merged

lballabio merged 2 commits into
lballabio:masterfrom
RAJ-A58:fix/exponential-splines-fixed-kappa

Conversation

@RAJ-A58

@RAJ-A58 RAJ-A58 commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #3046.

Summary of Changes

When fixedKappa is specified in ExponentialSplinesFitting, the parameter array x contains only the spline coefficients and does not include $\kappa$ at the end.

In ExponentialSplinesFitting::discountFunction(), size() returns the number of optimization parameters in x. Stopping the loop at N - 1 inadvertently dropped the last coefficient in both the unconstrained and constrained cases.

  • Evaluates all N coefficients in discountFunction() when fixedKappa is set.
  • Added regression test testExponentialSplinesFixedKappa in test-suite/fittedbonddiscountcurve.cpp covering constrained and unconstrained variants and verifying sensitivity to the last coefficient.

…ixed

When fixedKappa is specified, the parameter array x only contains the spline coefficients and not kappa. In discountFunction(), size() returns the number of parameters in x, so looping up to N - 1 was dropping the last coefficient.

Fixes lballabio#3046.
Comment thread test-suite/fittedbonddiscountcurve.cpp Resolved
@lballabio
lballabio enabled auto-merge November 13, 2026 17:25
@lballabio lballabio changed the title Include all coefficients in ExponentialSplinesFitting when kappa is fixed Include all coefficients in ExponentialSplinesFitting when kappa is fixed Nov 13, 2026
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 80.019% (+0.3%) from 79.744% — RAJ-A58:fix/exponential-splines-fixed-kappa into lballabio:master

@lballabio
lballabio merged commit 89cb435 into lballabio:master Nov 13, 2026
46 checks passed
@RAJ-A58
RAJ-A58 deleted the fix/exponential-splines-fixed-kappa branch November 13, 2026 19:09
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.

ExponentialSplinesFitting ignores the last coefficient when kappa is fixed

3 participants