java.lang.Object
net.finmath.marketdata2.model.curves.AbstractCurve
net.finmath.marketdata2.model.curves.CurveInterpolation
- All Implemented Interfaces:
- Serializable,- Cloneable,- ParameterObject,- Curve
- Direct Known Subclasses:
- AbstractForwardCurve,- DiscountCurveInterpolation
This class represents a curveFromInterpolationPoints build from a set of points in 2D.
 It provides different interpolation and extrapolation methods applied to a transformation of the input point,
 examples are
 
For the interpolation methods provided see
- linear interpolation of the input points
- linear interpolation of the log of the input points
- linear interpolation of the log of the input points divided by their respective time
- cubic spline interpolation of the input points (or a function of the input points) (the curveFromInterpolationPoints will be C1).
- Akima interpolation of the input points (or a function of the input points).
- etc.
For the interpolation methods provided see
CurveInterpolation.InterpolationMethod.
 For the extrapolation methods provided see CurveInterpolation.ExtrapolationMethod.
 For the possible interpolation entities see CurveInterpolation.InterpolationEntity.
 To construct the curveFromInterpolationPoints, please use the inner class CurveBuilder (a builder pattern).
 For a demo on how to construct and/or calibrate a curveFromInterpolationPoints see, e.g.
 net.finmath.tests.marketdata.curves.CurveTest.- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
- Serialized Form
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classA builder (following the builder pattern) for CurveFromInterpolationPoints objects.static classPossible extrapolation methods.static classPossible interpolation entities.static classPossible interpolation methods.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCurveInterpolation(String name, LocalDate referenceDate, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)Create a curveFromInterpolationPoints with a given name, reference date and an interpolation method.CurveInterpolation(String name, LocalDate referenceDate, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity, double[] times, RandomVariable[] values)Create a curveFromInterpolationPoints with a given name, reference date and an interpolation method from given points
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddPoint(double time, RandomVariable value, boolean isParameter)Add a point to this curveFromInterpolationPoints.clone()Create a deep copied clone.Returns a curve builder bases on a clone of this curve.getCloneForParameter(RandomVariable[] parameter)Create a clone with a modified parameter.Returns the extrapolation method used by this curveFromInterpolationPoints.Returns the interpolation entity used by this curveFromInterpolationPoints.Returns the interpolation method used by this curveFromInterpolationPoints.Get the current parameter associated with the state of the objects.protected intgetParameterIndex(double time)protected intgetTimeIndex(double time)getValue(double time)Returns the value for the time using the interpolation method associated with this curve.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.voidsetParameter(RandomVariable[] parameter)Set the current parameter and change the state of the objects.toString()Methods inherited from class net.finmath.marketdata2.model.curves.AbstractCurvegetName, getReferenceDate, getValues
- 
Constructor Details- 
CurveInterpolationpublic CurveInterpolation(String name, LocalDate referenceDate, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity, double[] times, RandomVariable[] values)Create a curveFromInterpolationPoints with a given name, reference date and an interpolation method from given points- Parameters:
- name- The name of this curveFromInterpolationPoints.
- referenceDate- The reference date for this curveFromInterpolationPoints, i.e., the date which defined t=0.
- interpolationMethod- The interpolation method used for the curveFromInterpolationPoints.
- extrapolationMethod- The extrapolation method used for the curveFromInterpolationPoints.
- interpolationEntity- The entity interpolated/extrapolated.
- times- A vector of times.
- values- A vector of corresponding values.
 
- 
CurveInterpolationprotected CurveInterpolation(String name, LocalDate referenceDate, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)Create a curveFromInterpolationPoints with a given name, reference date and an interpolation method.- Parameters:
- name- The name of this curveFromInterpolationPoints.
- referenceDate- The reference date for this curveFromInterpolationPoints, i.e., the date which defined t=0.
- interpolationMethod- The interpolation method used for the curveFromInterpolationPoints.
- extrapolationMethod- The extrapolation method used for the curveFromInterpolationPoints.
- interpolationEntity- The entity interpolated/extrapolated.
 
 
- 
- 
Method Details- 
getValueDescription copied from interface:CurveReturns the value for the time using the interpolation method associated with this curve.- Specified by:
- getValuein interface- Curve
- Overrides:
- getValuein class- AbstractCurve
- Parameters:
- time- Time for which the value should be returned.
- Returns:
- The value at the give time.
 
- 
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.
- 
addPointAdd a point to this curveFromInterpolationPoints. The method will throw an exception if the point is already part of the curveFromInterpolationPoints.- Parameters:
- time- The xi in i = f(xi).
- value- The yi in i = f(xi).
- isParameter- If true, then this point is served via- getParameter()and changed via- getCloneForParameter(RandomVariable[]), i.e., it can be calibrated.
 
- 
getInterpolationMethodReturns the interpolation method used by this curveFromInterpolationPoints.- Returns:
- The interpolation method used by this curveFromInterpolationPoints.
 
- 
getExtrapolationMethodReturns the extrapolation method used by this curveFromInterpolationPoints.- Returns:
- The extrapolation method used by this curveFromInterpolationPoints.
 
- 
getInterpolationEntityReturns the interpolation entity used by this curveFromInterpolationPoints.- Returns:
- The interpolation entity used by this curveFromInterpolationPoints.
 
- 
getTimeIndexprotected int getTimeIndex(double time)
- 
getParameterIndexprotected int getParameterIndex(double time)
- 
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.
 
- 
cloneDescription copied from interface:CurveCreate a deep copied clone.- Specified by:
- clonein interface- Curve
- Overrides:
- clonein class- AbstractCurve
- Returns:
- A clone (deep copied).
- Throws:
- CloneNotSupportedException- Thrown, when the curve could not be cloned.
 
- 
getCloneForParameterDescription copied from interface:ParameterObjectCreate a clone with a modified parameter.- Specified by:
- getCloneForParameterin interface- Curve
- Specified by:
- getCloneForParameterin interface- ParameterObject
- Overrides:
- getCloneForParameterin class- AbstractCurve
- Parameters:
- parameter- The new parameter.
- Returns:
- A clone with an otherwise modified parameter.
- Throws:
- CloneNotSupportedException- Thrown, when the curve could not be cloned.
 
- 
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.
 
- 
toString- Overrides:
- toStringin class- AbstractCurve
 
 
-