Documentation of 'net.finmath.marketdata.model.curves.Curve' Java class
Curve
net.finmath.marketdata.model.curves

Class Curve

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, ParameterObjectInterface, CurveInterface
    Direct Known Subclasses:
    AbstractForwardCurve, DiscountCurve


    public class Curve
    extends AbstractCurve
    implements java.io.Serializable, java.lang.Cloneable
    This class represents a curve 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
    • 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 curve will be C1).
    • Akima interpolation of the input points (or a function of the input points).
    • etc.

    For the interpolation methods provided see 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.
    See Also:
    Serialized Form
    • Constructor Detail

      • Curve

        public Curve(java.lang.String name,
                     java.util.Calendar 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
        Parameters:
        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.
    • Method Detail

      • getValue

        public double getValue(double time)
        Description copied from interface: CurveInterface
        Returns the value for the time using the interpolation method associated with this curve.
        Specified by:
        getValue in interface CurveInterface
        Overrides:
        getValue in class AbstractCurve
        Parameters:
        time - Time for which the value should be returned.
        Returns:
        The value at the give time.
      • getValue

        public double getValue(AnalyticModelInterface model,
                               double time)
        Description copied from interface: CurveInterface
        Returns 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.
        Specified by:
        getValue in interface CurveInterface
        Parameters:
        model - An analytic model providing a context.
        time - Time for which the value should be returned.
        Returns:
        The value at the give time.
      • getInterpolationMethod

        public Curve.InterpolationMethod getInterpolationMethod()
        Returns the interpolation method used by this curve.
        Returns:
        The interpolation method used by this curve.
      • getExtrapolationMethod

        public Curve.ExtrapolationMethod getExtrapolationMethod()
        Returns the extrapolation method used by this curve.
        Returns:
        The extrapolation method used by this curve.
      • getInterpolationEntity

        public Curve.InterpolationEntity getInterpolationEntity()
        Returns the interpolation entity used by this curve.
        Returns:
        The interpolation entity used by this curve.
      • setParameter

        public void setParameter(double[] parameter)
        Description copied from interface: ParameterObjectInterface
        Set the current parameter and change the state of the objects.
        Specified by:
        setParameter in interface ParameterObjectInterface
        Parameters:
        parameter - The parameter associated with the new state of the objects.
      • clone

        public Curve clone()
                    throws java.lang.CloneNotSupportedException
        Description copied from interface: CurveInterface
        Create a deep copied clone.
        Specified by:
        clone in interface CurveInterface
        Overrides:
        clone in class AbstractCurve
        Returns:
        A clone (deep copied).
        Throws:
        java.lang.CloneNotSupportedException - Thrown, when the curve could not be cloned.
      • getCloneBuilder

        public CurveBuilderInterface getCloneBuilder()
                                              throws java.lang.CloneNotSupportedException
        Description copied from interface: CurveInterface
        Returns 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:
        getCloneBuilder in interface CurveInterface
        Returns:
        An object implementing the CurveBuilderInterface where the underlying curve is a clone of this curve.
        Throws:
        java.lang.CloneNotSupportedException - Thrown, when this curve could not be cloned.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.