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
Smith-Wilson method #1484
Conversation
yukiiwashita
commented
Feb 22, 2017
•
edited
edited
- 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) { |
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.
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, |
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.
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[] { |
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.
Where are those number coming from? Is it from an external implementation?
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.
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 |
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.
Weights not in method signature.