Module net.finmath.lib
Class DiscountCurveFromProductOfCurves
- java.lang.Object
-
- net.finmath.marketdata.model.curves.AbstractCurve
-
- net.finmath.marketdata.model.curves.DiscountCurveFromProductOfCurves
-
- All Implemented Interfaces:
Serializable,Cloneable,ParameterObject,Curve,DiscountCurve
public class DiscountCurveFromProductOfCurves extends AbstractCurve implements Serializable, DiscountCurve
A discount curve derived from other discount curves by multiplying the discount factors.- Version:
- 1.1
- Author:
- Christian Fries
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DiscountCurveFromProductOfCurves(String name, LocalDate referenceDate, String... curveNames)Create a discount curve using one or more curves.DiscountCurveFromProductOfCurves(String name, LocalDate referenceDate, DiscountCurve... curves)Create a discount curve using one or more given curves.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CurveBuildergetCloneBuilder()Returns a curve builder bases on a clone of this curve.doublegetDiscountFactor(double maturity)Returns the discount factor for the corresponding maturity.doublegetDiscountFactor(AnalyticModel model, double maturity)Returns the discount factor for the corresponding maturity.double[]getParameter()Get the current parameter associated with the state of the objects.doublegetValue(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.voidsetParameter(double[] parameter)Set the current parameter and change the state of the objects.-
Methods inherited from class net.finmath.marketdata.model.curves.AbstractCurve
clone, getCloneForParameter, getName, getReferenceDate, getValue, getValues, toString
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.finmath.marketdata.model.curves.Curve
clone, getCloneForParameter, getName, getReferenceDate, getValue
-
-
-
-
Constructor Detail
-
DiscountCurveFromProductOfCurves
public DiscountCurveFromProductOfCurves(String name, LocalDate referenceDate, String... curveNames)
Create a discount curve using one or more curves. The product curve is generated dynamically by looking up the given curveNames in the model passed to the methodgetDiscountFactor(AnalyticModel, double).- Parameters:
name- The name of this curve.referenceDate- The reference date of this curve.curveNames- Argument list or array of curve names.
-
DiscountCurveFromProductOfCurves
public DiscountCurveFromProductOfCurves(String name, LocalDate referenceDate, DiscountCurve... curves)
Create a discount curve using one or more given curves.- Parameters:
name- The name of this curve.referenceDate- The reference date of this curve.curves- Argument list or array of curves.
-
-
Method Detail
-
getDiscountFactor
public double getDiscountFactor(double maturity)
Description copied from interface:DiscountCurveReturns the discount factor for the corresponding maturity. This getter is not optimized for performance.- Specified by:
getDiscountFactorin interfaceDiscountCurve- 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.
-
getDiscountFactor
public double getDiscountFactor(AnalyticModel model, double maturity)
Description copied from interface:DiscountCurveReturns the discount factor for the corresponding maturity. This getter is not optimized for performance.- Specified by:
getDiscountFactorin interfaceDiscountCurve- 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.
-
getValue
public double getValue(AnalyticModel model, double time)
Description 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.
-
getParameter
public double[] getParameter()
Description copied from interface:ParameterObjectGet the current parameter associated with the state of the objects.- Specified by:
getParameterin interfaceParameterObject- Returns:
- The parameter.
-
setParameter
public void setParameter(double[] parameter)
Description copied from interface:ParameterObjectSet the current parameter and change the state of the objects.- Specified by:
setParameterin interfaceParameterObject- Parameters:
parameter- The parameter associated with the new state of the objects.
-
getCloneBuilder
public CurveBuilder getCloneBuilder()
Description 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 interfaceCurve- Returns:
- An object implementing the CurveBuilderInterface where the underlying curve is a clone of this curve.
-
-