Class Curves


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

      • zeroRates

        public static CurveMetadata zeroRates​(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,
                                              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​(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,
                                                 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​(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,
                                                    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​(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,
                                           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​(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,
                                                            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
      • normalVolatilityByExpiry

        public static CurveMetadata normalVolatilityByExpiry​(String name,
                                                             DayCount dayCount)
        Creates curve metadata for a curve providing normal 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
      • normalVolatilityByExpiry

        public static CurveMetadata normalVolatilityByExpiry​(CurveName name,
                                                             DayCount dayCount)
        Creates curve metadata for a curve providing normal 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
      • normalVolatilityByExpiry

        public static CurveMetadata normalVolatilityByExpiry​(CurveName name,
                                                             DayCount dayCount,
                                                             List<? extends ParameterMetadata> parameterMetadata)
        Creates curve metadata for a curve providing normal 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​(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,
                                                  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​(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,
                                                          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
      • correlationByExpiry

        public static CurveMetadata correlationByExpiry​(String name,
                                                        DayCount dayCount)
        Creates curve metadata for a curve providing correlation 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
      • correlationByExpiry

        public static CurveMetadata correlationByExpiry​(CurveName name,
                                                        DayCount dayCount)
        Creates curve metadata for a curve providing correlation 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
      • correlationByExpiry

        public static CurveMetadata correlationByExpiry​(CurveName name,
                                                        DayCount dayCount,
                                                        List<? extends ParameterMetadata> parameterMetadata)
        Creates curve metadata for a curve providing correlation 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