public class Curve extends AbstractCurve implements Serializable, Cloneable
Curve.InterpolationMethod.
For the extrapolation methods provided see Curve.ExtrapolationMethod.
For the possible interpolation entities see Curve.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 |
Curve.CurveBuilder
A builder (following the builder pattern) for Curve objects.
|
static class |
Curve.ExtrapolationMethod
Possible extrapolation methods.
|
static class |
Curve.InterpolationEntity
Possible interpolation entities.
|
static class |
Curve.InterpolationMethod
Possible interpolation methods.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Curve(String name,
LocalDate referenceDate,
Curve.InterpolationMethod interpolationMethod,
Curve.ExtrapolationMethod extrapolationMethod,
Curve.InterpolationEntity interpolationEntity)
Create a curve with a given name, reference date and an interpolation method.
|
|
Curve(String name,
LocalDate referenceDate,
Curve.InterpolationMethod interpolationMethod,
Curve.ExtrapolationMethod extrapolationMethod,
Curve.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.
|
Curve |
clone()
Create a deep copied clone.
|
CurveBuilderInterface |
getCloneBuilder()
Returns a curve builder bases on a clone of this curve.
|
CurveInterface |
getCloneForParameter(double[] parameter)
Create a clone with a modified parameter.
|
Curve.ExtrapolationMethod |
getExtrapolationMethod()
Returns the extrapolation method used by this curve.
|
Curve.InterpolationEntity |
getInterpolationEntity()
Returns the interpolation entity used by this curve.
|
Curve.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) |
protected int |
getTimeIndex(double time) |
double |
getValue(AnalyticModelInterface 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 Curve(String name, LocalDate referenceDate, Curve.InterpolationMethod interpolationMethod, Curve.ExtrapolationMethod extrapolationMethod, Curve.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 Curve(String name, LocalDate referenceDate, Curve.InterpolationMethod interpolationMethod, Curve.ExtrapolationMethod extrapolationMethod, Curve.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)
CurveInterfacegetValue in interface CurveInterfacegetValue in class AbstractCurvetime - Time for which the value should be returned.public double getValue(AnalyticModelInterface model, double time)
CurveInterfacegetValue in interface CurveInterfacemodel - An analytic model providing a context.time - Time for which the value should be returned.protected 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 Curve.InterpolationMethod getInterpolationMethod()
public Curve.ExtrapolationMethod getExtrapolationMethod()
public Curve.InterpolationEntity getInterpolationEntity()
protected int getTimeIndex(double time)
protected int getParameterIndex(double time)
public double[] getParameter()
ParameterObjectInterfacegetParameter in interface ParameterObjectInterfacepublic void setParameter(double[] parameter)
ParameterObjectInterfacesetParameter in interface ParameterObjectInterfaceparameter - The parameter associated with the new state of the objects.public Curve clone() throws CloneNotSupportedException
CurveInterfaceclone in interface CurveInterfaceclone in class AbstractCurveCloneNotSupportedException - Thrown, when the curve could not be cloned.public CurveInterface getCloneForParameter(double[] parameter) throws CloneNotSupportedException
ParameterObjectInterfacegetCloneForParameter in interface ParameterObjectInterfacegetCloneForParameter in interface CurveInterfacegetCloneForParameter in class AbstractCurveparameter - The new parameter.CloneNotSupportedException - Thrown, when the curve could not be cloned.public CurveBuilderInterface getCloneBuilder() throws CloneNotSupportedException
CurveInterfacegetCloneBuilder in interface CurveInterfaceCloneNotSupportedException - Thrown, when this curve could not be cloned.public String toString()
toString in class AbstractCurveCopyright © 2017. All rights reserved.