Class Curves


  • public final class Curves
    extends java.lang.Object
    Helper for creating common types of curves.
    • Method Detail

      • zeroRates

        public static CurveMetadata zeroRates​(java.lang.String name,
                                              DayCount dayCount)
        Creates curve metadata for a curve providing zero rates.

        The x-values represent year fractions relative to an unspecified base date as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        Returns:
        the curve metadata
      • zeroRates

        public static CurveMetadata zeroRates​(CurveName name,
                                              DayCount dayCount)
        Creates curve metadata for a curve providing zero rates.

        The x-values represent year fractions relative to an unspecified base date as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        Returns:
        the curve metadata
      • zeroRates

        public static CurveMetadata zeroRates​(CurveName name,
                                              DayCount dayCount,
                                              java.util.List<? extends ParameterMetadata> parameterMetadata)
        Creates curve metadata for a curve providing zero rates.

        The x-values represent year fractions relative to an unspecified base date as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        parameterMetadata - the parameter metadata
        Returns:
        the curve metadata
      • forwardRates

        public static CurveMetadata forwardRates​(java.lang.String name,
                                                 DayCount dayCount)
        Creates curve metadata for a curve providing forward rates.

        The x-values represent year fractions relative to an unspecified base date as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        Returns:
        the curve metadata
      • forwardRates

        public static CurveMetadata forwardRates​(CurveName name,
                                                 DayCount dayCount)
        Creates curve metadata for a curve providing forward rates.

        The x-values represent year fractions relative to an unspecified base date as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        Returns:
        the curve metadata
      • forwardRates

        public static CurveMetadata forwardRates​(CurveName name,
                                                 DayCount dayCount,
                                                 java.util.List<? extends ParameterMetadata> parameterMetadata)
        Creates curve metadata for a curve providing forward rates.

        The x-values represent year fractions relative to an unspecified base date as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        parameterMetadata - the parameter metadata
        Returns:
        the curve metadata
      • discountFactors

        public static CurveMetadata discountFactors​(java.lang.String name,
                                                    DayCount dayCount)
        Creates curve metadata for a curve providing discount factors.

        The x-values represent year fractions relative to an unspecified base date as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        Returns:
        the curve metadata
      • discountFactors

        public static CurveMetadata discountFactors​(CurveName name,
                                                    DayCount dayCount)
        Creates curve metadata for a curve providing discount factors.

        The x-values represent year fractions relative to an unspecified base date as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        Returns:
        the curve metadata
      • discountFactors

        public static CurveMetadata discountFactors​(CurveName name,
                                                    DayCount dayCount,
                                                    java.util.List<? extends ParameterMetadata> parameterMetadata)
        Creates curve metadata for a curve providing discount factors.

        The x-values represent year fractions relative to an unspecified base date as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        parameterMetadata - the parameter metadata
        Returns:
        the curve metadata
      • prices

        public static CurveMetadata prices​(java.lang.String name)
        Creates curve metadata for a curve providing monthly prices, typically used in inflation.

        The x-values represent months relative to an unspecified base month.

        Parameters:
        name - the curve name
        Returns:
        the curve metadata
      • prices

        public static CurveMetadata prices​(CurveName name)
        Creates curve metadata for a curve providing monthly prices, typically used in inflation.

        The x-values represent months relative to an unspecified base month.

        Parameters:
        name - the curve name
        Returns:
        the curve metadata
      • prices

        public static CurveMetadata prices​(CurveName name,
                                           java.util.List<? extends ParameterMetadata> parameterMetadata)
        Creates curve metadata for a curve providing monthly prices, typically used in inflation.

        The x-values represent months relative to an unspecified base month.

        Parameters:
        name - the curve name
        parameterMetadata - the parameter metadata
        Returns:
        the curve metadata
      • blackVolatilityByExpiry

        public static CurveMetadata blackVolatilityByExpiry​(java.lang.String name,
                                                            DayCount dayCount)
        Creates curve metadata for a curve providing Black volatility by expiry.

        The x-values represent year fractions relative to an unspecified base date as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        Returns:
        the curve metadata
      • blackVolatilityByExpiry

        public static CurveMetadata blackVolatilityByExpiry​(CurveName name,
                                                            DayCount dayCount)
        Creates curve metadata for a curve providing Black volatility by expiry.

        The x-values represent year fractions relative to an unspecified base date as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        Returns:
        the curve metadata
      • blackVolatilityByExpiry

        public static CurveMetadata blackVolatilityByExpiry​(CurveName name,
                                                            DayCount dayCount,
                                                            java.util.List<? extends ParameterMetadata> parameterMetadata)
        Creates curve metadata for a curve providing Black volatility by expiry.

        The x-values represent year fractions relative to an unspecified base date as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        parameterMetadata - the parameter metadata
        Returns:
        the curve metadata
      • recoveryRates

        public static CurveMetadata recoveryRates​(java.lang.String name,
                                                  DayCount dayCount)
        Creates curve metadata for a curve providing recovery rates.

        The x-values represent year fractions relative to an unspecified base date as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        Returns:
        the curve metadata
      • recoveryRates

        public static CurveMetadata recoveryRates​(CurveName name,
                                                  DayCount dayCount)
        Creates curve metadata for a curve providing recovery rates.

        The x-values represent year fractions relative to an unspecified base date as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        Returns:
        the curve metadata
      • recoveryRates

        public static CurveMetadata recoveryRates​(CurveName name,
                                                  DayCount dayCount,
                                                  java.util.List<? extends ParameterMetadata> parameterMetadata)
        Creates curve metadata for a curve providing recovery rates.

        The x-values represent year fractions relative to an unspecified base date as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        parameterMetadata - the parameter metadata
        Returns:
        the curve metadata
      • sabrParameterByExpiry

        public static CurveMetadata sabrParameterByExpiry​(java.lang.String name,
                                                          DayCount dayCount,
                                                          ValueType yType)
        Creates metadata for a curve providing a SABR parameter.

        The x-values represent time to expiry year fractions as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        yType - the y-value type, which must be one of the four SABR values
        Returns:
        the curve metadata
      • sabrParameterByExpiry

        public static CurveMetadata sabrParameterByExpiry​(CurveName name,
                                                          DayCount dayCount,
                                                          ValueType yType)
        Creates metadata for a curve providing a SABR parameter.

        The x-values represent time to expiry year fractions as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        yType - the y-value type, which must be one of the four SABR values
        Returns:
        the curve metadata
      • sabrParameterByExpiry

        public static CurveMetadata sabrParameterByExpiry​(CurveName name,
                                                          DayCount dayCount,
                                                          ValueType yType,
                                                          java.util.List<? extends ParameterMetadata> parameterMetadata)
        Creates metadata for a curve providing a SABR parameter.

        The x-values represent time to expiry year fractions as defined by the specified day count.

        Parameters:
        name - the curve name
        dayCount - the day count
        yType - the y-value type, which must be one of the four SABR values
        parameterMetadata - the parameter metadata
        Returns:
        the curve metadata