public class CurveInterpolation extends AbstractCurve implements Serializable, Cloneable
CurveInterpolation.InterpolationMethod.
For the extrapolation methods provided see CurveInterpolation.ExtrapolationMethod.
For the possible interpolation entities see CurveInterpolation.InterpolationEntity.
To construct the curve, please use the inner class CurveBuilder (a builder pattern).
For a demo on how to construct and/or calibrate a curve see, e.g.
net.finmath.tests.marketdata.curves.CurveTest.| Modifier and Type | Class and Description |
|---|---|
static class |
CurveInterpolation.Builder
A builder (following the builder pattern) for CurveFromInterpolationPoints objects.
|
static class |
CurveInterpolation.ExtrapolationMethod
Possible extrapolation methods.
|
static class |
CurveInterpolation.InterpolationEntity
Possible interpolation entities.
|
static class |
CurveInterpolation.InterpolationMethod
Possible interpolation methods.
|
static class |
CurveInterpolation.Point
Representation of a 2D curve point including the boolean property if the point is fixed or calibrateable.
|
| Modifier | Constructor and Description |
|---|---|
protected |
CurveInterpolation(String name,
LocalDate referenceDate,
CurveInterpolation.InterpolationMethod interpolationMethod,
CurveInterpolation.ExtrapolationMethod extrapolationMethod,
CurveInterpolation.InterpolationEntity interpolationEntity)
Create a curve 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,
double[] values)
Create a curve with a given name, reference date and an interpolation method from given points
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addPoint(double time,
double value,
boolean isParameter)
Add a point to this curve.
|
CurveInterpolation |
clone()
Create a deep copied clone.
|
CurveBuilder |
getCloneBuilder()
Returns a curve builder bases on a clone of this curve.
|
Curve |
getCloneForParameter(double[] parameter)
Create a clone with a modified parameter.
|
CurveInterpolation.ExtrapolationMethod |
getExtrapolationMethod()
Returns the extrapolation method used by this curve.
|
CurveInterpolation.InterpolationEntity |
getInterpolationEntity()
Returns the interpolation entity used by this curve.
|
CurveInterpolation.InterpolationMethod |
getInterpolationMethod()
Returns the interpolation method used by this curve.
|
double[] |
getParameter()
Get the current parameter associated with the state of the objects.
|
protected int |
getParameterIndex(double time) |
List<CurveInterpolation.Point> |
getPoints()
Returns the interpolation points.
|
protected int |
getTimeIndex(double time) |
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.
|
double |
getValue(double time)
Returns the value for the time using the interpolation method associated with this curve.
|
void |
setParameter(double[] parameter)
Set the current parameter and change the state of the objects.
|
String |
toString() |
getName, getReferenceDate, getValuespublic CurveInterpolation(String name, LocalDate referenceDate, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity, double[] times, double[] values)
name - The name of this curve.referenceDate - The reference date for this curve, i.e., the date which defined t=0.interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.times - A vector of times.values - A vector of corresponding values.protected CurveInterpolation(String name, LocalDate referenceDate, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)
name - The name of this curve.referenceDate - The reference date for this curve, i.e., the date which defined t=0.interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.public double getValue(double time)
CurvegetValue in interface CurvegetValue in class AbstractCurvetime - Time for which the value should be returned.public double getValue(AnalyticModel model, double time)
Curveprotected void addPoint(double time,
double value,
boolean isParameter)
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(double[]), i.e., it can be calibrated.public CurveInterpolation.InterpolationMethod getInterpolationMethod()
public CurveInterpolation.ExtrapolationMethod getExtrapolationMethod()
public CurveInterpolation.InterpolationEntity getInterpolationEntity()
public List<CurveInterpolation.Point> getPoints()
protected int getTimeIndex(double time)
protected int getParameterIndex(double time)
public double[] getParameter()
ParameterObjectgetParameter in interface ParameterObjectpublic void setParameter(double[] parameter)
ParameterObjectsetParameter in interface ParameterObjectparameter - The parameter associated with the new state of the objects.public CurveInterpolation clone() throws CloneNotSupportedException
Curveclone in interface Curveclone in class AbstractCurveCloneNotSupportedException - Thrown, when the curve could not be cloned.public Curve getCloneForParameter(double[] parameter) throws CloneNotSupportedException
ParameterObjectgetCloneForParameter in interface ParameterObjectgetCloneForParameter in interface CurvegetCloneForParameter in class AbstractCurveparameter - The new parameter.CloneNotSupportedException - Thrown, when the curve could not be cloned.public CurveBuilder getCloneBuilder() throws CloneNotSupportedException
CurvegetCloneBuilder in interface CurveCloneNotSupportedException - Thrown, when this curve could not be cloned.public String toString()
toString in class AbstractCurveCopyright © 2019. All rights reserved.