Module net.finmath.lib
Class DiscountCurveFromForwardCurve
java.lang.Object
net.finmath.marketdata2.model.curves.AbstractCurve
net.finmath.marketdata2.model.curves.DiscountCurveFromForwardCurve
- All Implemented Interfaces:
- Serializable,- Cloneable,- ParameterObject,- Curve,- DiscountCurveInterface
public class DiscountCurveFromForwardCurve
extends AbstractCurve
implements Serializable, DiscountCurveInterface
A discount curve derived from a given forward curve.
 The discount factors df(t) are defined at t = k * d
 for integers k via
 df(t+d) = df(t) / (1 + f(t) * d) and
 for t = k * d and 0 < r < d
 via df(t+r) = df(t) / (1 + f(t) * r)
 where d is a given the payment offset and f(t) is the forward curve.
 
 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.
 
 
- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
- Serialized Form
- 
Constructor SummaryConstructorsConstructorDescriptionDiscountCurveFromForwardCurve(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.DiscountCurveFromForwardCurve(ForwardCurveInterface forwardCurve)Create a discount curve using a given forward curve.DiscountCurveFromForwardCurve(ForwardCurveInterface forwardCurve, double periodLengthTimeScaling)Create a discount curve using a given forward curve.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns a curve builder bases on a clone of this curve.getDiscountFactor(double maturity)Returns the discount factor for the corresponding maturity.getDiscountFactor(AnalyticModel model, double maturity)Returns the discount factor for the corresponding maturity.Get the current parameter associated with the state of the objects.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.inthashCode()voidsetParameter(RandomVariable[] parameter)Set the current parameter and change the state of the objects.Methods inherited from class net.finmath.marketdata2.model.curves.AbstractCurveclone, getCloneForParameter, getName, getReferenceDate, getValue, getValues, toStringMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.finmath.marketdata2.model.curves.Curveclone, getCloneForParameter, getName, getReferenceDate, getValue
- 
Constructor Details- 
DiscountCurveFromForwardCurveCreate a discount curve using a given forward curve. The discount factors df(t) are defined at t = k * d for integers k via df(t+d) = df(t) / (1 + f(t) * d) and for t = k * d and 0 < r < d via df(t+r) = df(t) / (1 + f(t) * r) where d is a given the payment offset and f(t) is the forward curve.- Parameters:
- 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).
 
- 
DiscountCurveFromForwardCurvepublic DiscountCurveFromForwardCurve(ForwardCurveInterface forwardCurve, double periodLengthTimeScaling)Create a discount curve using a given forward curve. The discount factors df(t) are defined at t = k * d for integers k via df(t+d) = df(t) / (1 + f(t) * d) and for t = k * d and 0 < r < d via df(t+r) = df(t) / (1 + f(t) * r) where d is a given the payment offset and f(t) is the forward curve.- Parameters:
- 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).
 
- 
DiscountCurveFromForwardCurveCreate a discount curve using a given forward curve. The discount factors df(t) are defined at t = k * d for integers k via df(t+d) = df(t) / (1 + f(t) * d) and for t = k * d and 0 < r < d via df(t+r) = df(t) / (1 + f(t) * r) where d is a given the payment offset and f(t) is the forward curve.- Parameters:
- forwardCurveName- The name of the forward curve used for calculation of the discount factors.
 
- 
DiscountCurveFromForwardCurveCreate a discount curve using a given forward curve. The discount factors df(t) are defined at t = k * d for integers k via df(t+d) = df(t) / (1 + f(t) * d) and for t = k * d and 0 < r < d via df(t+r) = df(t) / (1 + f(t) * r) where d is a given the payment offset and f(t) is the forward curve.- Parameters:
- forwardCurve- The forward curve used for calculation of the discount factors.
 
 
- 
- 
Method Details- 
getDiscountFactorDescription copied from interface:DiscountCurveInterfaceReturns the discount factor for the corresponding maturity. This getter is not optimized for performance.- Specified by:
- getDiscountFactorin interface- DiscountCurveInterface
- Parameters:
- maturity- The maturity for which the discount factor is requested.
- Returns:
- The discount factor (i.e., price of the zero coupon bond with given maturity and notional 1.
 
- 
getDiscountFactorDescription copied from interface:DiscountCurveInterfaceReturns the discount factor for the corresponding maturity. This getter is not optimized for performance.- Specified by:
- getDiscountFactorin interface- DiscountCurveInterface
- Parameters:
- 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.
- Returns:
- The discount factor (i.e., price of the zero coupon bond with given maturity and notional 1.
 
- 
getValueDescription copied from interface:CurveReturns the value for the time using the interpolation method associated with this curve within a given context, i.e., a model. The model (context) is needed only if the curve relies on another curve. Examples are a forward curve which relies on a discount curve or a discount curve which is defined via a spread over another curve.
- 
getParameterDescription copied from interface:ParameterObjectGet the current parameter associated with the state of the objects.- Specified by:
- getParameterin interface- ParameterObject
- Returns:
- The parameter.
 
- 
setParameterDescription copied from interface:ParameterObjectSet the current parameter and change the state of the objects.- Specified by:
- setParameterin interface- ParameterObject
- Parameters:
- parameter- The parameter associated with the new state of the objects.
 
- 
getCloneBuilderDescription copied from interface:CurveReturns a curve builder bases on a clone of this curve. Using that curve builder you may create a new curve from this curve by adding points or changing properties. Note: The clone has the same name than this one.- Specified by:
- getCloneBuilderin interface- Curve
- Returns:
- An object implementing the CurveBuilderInterface where the underlying curve is a clone of this curve.
- Throws:
- CloneNotSupportedException- Thrown, when this curve could not be cloned.
 
- 
hashCodepublic int hashCode()
- 
equals
 
-