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

Smith-Wilson method #1484

Merged
merged 3 commits into from Feb 24, 2017
Merged

Smith-Wilson method #1484

merged 3 commits into from Feb 24, 2017

Conversation

yukiiwashita
Copy link
Contributor

@yukiiwashita yukiiwashita commented Feb 22, 2017

  • Implemented Smith-Wilson formula
  • The formula is used via ParameterizedFunctionalCurve
  • Created an interface CurveDefinition for the existing interface, NodalCurveDefinition, and added a new implementation ParameterizedFunctionalCurveDefinition
  • Calibration example in CalibrationDiscountingSmithWilsonTest.

for (CurveNode node : defn.getNodes()) {
result.add(node.initialGuess(marketData, valueType));
for (CurveDefinition defn : curveDefinitions) {
if (defn instanceof ParameterizedFunctionalCurveDefinition) {
Copy link
Contributor

Choose a reason for hiding this comment

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

A method initialGuess(MarketData marketData) should probably be created in CurveDefinition. For the ParameterizedFunctionalCurveDefinition it will the one already implemented; for the other it will return the array resulting from the loop on the nodes. The cast will not be necessary anymore.

* <p>
* The curve is controlled by {@code omega}, {@code alpha} and {@code weights}:
* {@code omega} is related to the ultimate forward rate (UFR) by {@code omega = log(1 + UFR)},
* the {@code alpha} parameter determines the rate of convergence to the UFR,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why a difference between the alpha and the omega treatment?

-0.380409008626438, 0.228249649568978, -0.160902407241201);
DoubleArray nodes = DoubleArray.of(3d, 5d, 7d, 10d, 15d, 20d, 30d);
double alpha = 0.162009;
double[] dfExp = new double[] {
Copy link
Contributor

Choose a reason for hiding this comment

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

Where are those number coming from? Is it from an external implementation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added comment "Source: EIOPA - European Insurance and Occupational Pensions Authority".

* @param x the x value
* @param alpha the alpha parameter
* @param nodes the nodes
* @param weights the weights
Copy link
Contributor

Choose a reason for hiding this comment

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

Weights not in method signature.

@marc-henrard marc-henrard merged commit fc9332d into master Feb 24, 2017
@yukiiwashita yukiiwashita deleted the topic/smith-wilson branch February 27, 2017 11:54
@jodastephen jodastephen added this to the v1.2 milestone Mar 8, 2017
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.

None yet

4 participants