Class DiscountOvernightIndexRates

    • Method Detail

      • of

        public static DiscountOvernightIndexRates of​(OvernightIndex index,
                                                     DiscountFactors discountFactors)
        Obtains an instance based on discount factors with no historic fixings.

        The forward curve is specified by an instance of DiscountFactors.

        Parameters:
        index - the Overnight index
        discountFactors - the underlying discount factor forward curve
        Returns:
        the rates instance
      • getValuationDate

        public LocalDate getValuationDate()
        Description copied from interface: MarketDataView
        Gets the valuation date.

        The raw data in this provider is calibrated for this date.

        Specified by:
        getValuationDate in interface MarketDataView
        Returns:
        the valuation date
      • findData

        public <T> Optional<T> findData​(MarketDataName<T> name)
        Description copied from interface: MarketDataView
        Finds the market data with the specified name.

        This is most commonly used to find an underlying curve or surface by name. If the market data cannot be found, empty is returned.

        Specified by:
        findData in interface MarketDataView
        Type Parameters:
        T - the type of the market data value
        Parameters:
        name - the name to find
        Returns:
        the market data value, empty if not found
      • getParameterCount

        public int getParameterCount()
        Description copied from interface: ParameterizedData
        Gets the number of parameters.

        This returns the number of parameters, which can be used to create a loop to access the other methods on this interface.

        Specified by:
        getParameterCount in interface ParameterizedData
        Returns:
        the number of parameters
      • getParameter

        public double getParameter​(int parameterIndex)
        Description copied from interface: ParameterizedData
        Gets the value of the parameter at the specified index.
        Specified by:
        getParameter in interface ParameterizedData
        Parameters:
        parameterIndex - the zero-based index of the parameter to get
        Returns:
        the value of the parameter
      • getParameterMetadata

        public ParameterMetadata getParameterMetadata​(int parameterIndex)
        Description copied from interface: ParameterizedData
        Gets the metadata of the parameter at the specified index.

        If there is no specific parameter metadata, an empty instance will be returned.

        Specified by:
        getParameterMetadata in interface ParameterizedData
        Parameters:
        parameterIndex - the zero-based index of the parameter to get
        Returns:
        the metadata of the parameter
      • findParameterIndex

        public OptionalInt findParameterIndex​(ParameterMetadata metadata)
        Description copied from interface: ParameterizedData
        Finds the parameter index of the specified metadata.

        If the parameter metadata is not matched, an empty optional will be returned.

        Specified by:
        findParameterIndex in interface ParameterizedData
        Parameters:
        metadata - the parameter metadata to find the index of
        Returns:
        the index of the parameter
      • withParameter

        public DiscountOvernightIndexRates withParameter​(int parameterIndex,
                                                         double newValue)
        Description copied from interface: ParameterizedData
        Returns a copy of the data with the value at the specified index altered.

        This instance is immutable and unaffected by this method call.

        Specified by:
        withParameter in interface OvernightIndexRates
        Specified by:
        withParameter in interface ParameterizedData
        Parameters:
        parameterIndex - the zero-based index of the parameter to get
        newValue - the new value for the specified parameter
        Returns:
        a parameterized data instance based on this with the specified parameter altered
      • withPerturbation

        public DiscountOvernightIndexRates withPerturbation​(ParameterPerturbation perturbation)
        Description copied from interface: ParameterizedData
        Returns a perturbed copy of the data.

        The perturbation instance will be invoked once for each parameter in this instance, returning the perturbed value for that parameter. The result of this method is a new instance that is based on those perturbed values.

        This instance is immutable and unaffected by this method call.

        Specified by:
        withPerturbation in interface OvernightIndexRates
        Specified by:
        withPerturbation in interface ParameterizedData
        Parameters:
        perturbation - the perturbation to apply
        Returns:
        a parameterized data instance based on this with the specified perturbation applied
      • rate

        public double rate​(OvernightIndexObservation observation)
        Description copied from interface: OvernightIndexRates
        Gets the historic or forward rate at the specified fixing date.

        The rate of the Overnight index, such as 'EUR-EONIA', varies over time. This method obtains the actual or estimated rate for the fixing date.

        This retrieves the actual rate if the fixing date is before the valuation date, or the estimated rate if the fixing date is after the valuation date. If the fixing date equals the valuation date, then the best available rate is returned. The reference period for the underlying deposit is computed from the index conventions.

        Specified by:
        rate in interface OvernightIndexRates
        Parameters:
        observation - the rate observation, including the fixing date
        Returns:
        the rate of the index, either historic or forward
      • rateIgnoringFixings

        public double rateIgnoringFixings​(OvernightIndexObservation observation)
        Description copied from interface: OvernightIndexRates
        Ignores the time-series of fixings to get the forward rate at the specified fixing date, used in rare and special cases. In most cases callers should use rate(OvernightIndexObservation).

        An instance of OvernightIndexRates is typically based on a forward curve and a historic time-series. The rate(LocalDate) method uses either the curve or time-series, depending on whether the fixing date is before or after the valuation date. This method only queries the forward curve, totally ignoring the time-series, which is needed for rare and special cases only.

        Specified by:
        rateIgnoringFixings in interface OvernightIndexRates
        Parameters:
        observation - the rate observation, including the fixing date
        Returns:
        the rate of the index ignoring the time-series of fixings
      • rateIgnoringFixingsPointSensitivity

        public PointSensitivityBuilder rateIgnoringFixingsPointSensitivity​(OvernightIndexObservation observation)
        Description copied from interface: OvernightIndexRates
        Ignores the time-series of fixings to get the forward rate point sensitivity at the specified fixing date, used in rare and special cases. In most cases callers should use ratePointSensitivity(OvernightIndexObservation).

        An instance of OvernightIndexRates is typically based on a forward curve and a historic time-series. The ratePointSensitivity(LocalDate) method uses either the curve or time-series, depending on whether the fixing date is before or after the valuation date. This method only queries the forward curve, totally ignoring the time-series, which is needed for rare and special cases only.

        Specified by:
        rateIgnoringFixingsPointSensitivity in interface OvernightIndexRates
        Parameters:
        observation - the rate observation, including the fixing date
        Returns:
        the point sensitivity of the rate ignoring the time-series of fixings
      • periodRate

        public double periodRate​(OvernightIndexObservation startDateObservation,
                                 LocalDate endDate)
        Description copied from interface: OvernightIndexRates
        Gets the historic or forward rate at the specified fixing period.

        The start date should be on or after the valuation date. The end date should be after the start date.

        This computes the forward rate in the simple simply compounded convention of the index between two given date. This is used mainly to speed-up computation by computing the rate on a longer period instead of each individual overnight rate. When data related to the overnight index rate are stored based on the fixing date and not the start and end date of the period, the call may return an IllegalArgumentException.

        Specified by:
        periodRate in interface OvernightIndexRates
        Parameters:
        startDateObservation - the rate observation for the start of the period
        endDate - the end or maturity date of the period on which the rate is computed
        Returns:
        the simply compounded rate associated to the period for the index
      • parameterSensitivity

        public CurrencyParameterSensitivities parameterSensitivity​(OvernightRateSensitivity pointSensitivity)
        Description copied from interface: OvernightIndexRates
        Calculates the parameter sensitivity from the point sensitivity.

        This is used to convert a single point sensitivity to parameter sensitivity. The calculation typically involves multiplying the point and unit sensitivities.

        Specified by:
        parameterSensitivity in interface OvernightIndexRates
        Parameters:
        pointSensitivity - the point sensitivity to convert
        Returns:
        the parameter sensitivity
      • withDiscountFactors

        public DiscountOvernightIndexRates withDiscountFactors​(DiscountFactors factors)
        Returns a new instance with different discount factors.
        Parameters:
        factors - the new discount factors
        Returns:
        the new instance
      • getDiscountFactors

        public DiscountFactors getDiscountFactors()
        Gets the underlying discount factor curve.
        Returns:
        the value of the property, not null
      • getFixings

        public LocalDateDoubleTimeSeries getFixings()
        Gets the time-series of fixings, defaulted to an empty time-series. This includes the known historical fixings and may be empty.
        Specified by:
        getFixings in interface OvernightIndexRates
        Returns:
        the value of the property, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object