public class DiscountCurveFromForwardCurve extends AbstractCurve implements Serializable, DiscountCurve
Note that a special interpolation is performed for in-between points.
Hence, creating a ForwardCurveFromDiscountCurve
and from it
a DiscountCurveFromForwardCurve will not recover the original curve
since interpolation points may be lost.
Constructor and Description |
---|
DiscountCurveFromForwardCurve(ForwardCurve forwardCurve)
Create a discount curve using a given forward curve.
|
DiscountCurveFromForwardCurve(ForwardCurve forwardCurve,
double periodLengthTimeScaling)
Create a discount curve using a given forward curve.
|
DiscountCurveFromForwardCurve(String forwardCurveName)
Create a discount curve using a given forward curve.
|
DiscountCurveFromForwardCurve(String forwardCurveName,
double periodLengthTimeScaling)
Create a discount curve using a given forward curve.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
CurveBuilder |
getCloneBuilder()
Returns a curve builder bases on a clone of this curve.
|
double |
getDiscountFactor(AnalyticModel model,
double maturity)
Returns the discount factor for the corresponding maturity.
|
double |
getDiscountFactor(double maturity)
Returns the discount factor for the corresponding maturity.
|
double[] |
getParameter()
Get the current parameter associated with the state of the objects.
|
double |
getValue(AnalyticModel model,
double time)
Returns the value for the time using the interpolation method associated with this curve
within a given context, i.e., a model.
|
int |
hashCode() |
void |
setParameter(double[] parameter)
Set the current parameter and change the state of the objects.
|
clone, getCloneForParameter, getName, getReferenceDate, getValue, getValues, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
clone, getCloneForParameter, getName, getReferenceDate, getValue
public DiscountCurveFromForwardCurve(String forwardCurveName, double periodLengthTimeScaling)
forwardCurveName
- The name of the forward curve used for calculation of the discount factors.periodLengthTimeScaling
- A scaling factor applied to d, adjusting for the internal double time to the period length daycount fraction (note that this may only be an approximate solution to capture daycount effects).public DiscountCurveFromForwardCurve(ForwardCurve forwardCurve, double periodLengthTimeScaling)
forwardCurve
- The forward curve used for calculation of the discount factors.periodLengthTimeScaling
- A scaling factor applied to d, adjusting for the internal double time to the period length daycount fraction (note that this may only be an approximate solution to capture daycount effects).public DiscountCurveFromForwardCurve(String forwardCurveName)
forwardCurveName
- The name of the forward curve used for calculation of the discount factors.public DiscountCurveFromForwardCurve(ForwardCurve forwardCurve)
forwardCurve
- The forward curve used for calculation of the discount factors.public double getDiscountFactor(double maturity)
DiscountCurve
getDiscountFactor
in interface DiscountCurve
maturity
- The maturity for which the discount factor is requested.public double getDiscountFactor(AnalyticModel model, double maturity)
DiscountCurve
getDiscountFactor
in interface DiscountCurve
model
- An analytic model providing a context. Some curves do not need this (can be null).maturity
- The maturity for which the discount factor is requested.public double getValue(AnalyticModel model, double time)
Curve
public double[] getParameter()
ParameterObject
getParameter
in interface ParameterObject
public void setParameter(double[] parameter)
ParameterObject
setParameter
in interface ParameterObject
parameter
- The parameter associated with the new state of the objects.public CurveBuilder getCloneBuilder() throws CloneNotSupportedException
Curve
getCloneBuilder
in interface Curve
CloneNotSupportedException
- Thrown, when this curve could not be cloned.Copyright © 2019. All rights reserved.