class_docstr: Represents a batch of Forward Rate Agreements (FRA).
  
  An FRA is a contract for the period [T, T+tau] where the holder exchanges a
  fixed rate (agreed at the start of the contract) against a floating payment
  determined at time T based on the spot Libor rate for term `tau`. The
  cashflows are exchanged at the settlement time T_s, which is either equal to T
  or close to T. The FRA are structured so that the payments are made in T+tau
  dollars (ref [1]).
  
  The ForwardRateAgreement class can be used to create and price multiple FRAs
  simultaneously. However all FRAs within a FRA object must be priced using
  a common reference and discount curve.
  
  #### Example:
  The following example illustrates the construction of a FRA instrument and
  calculating its price.
  
  ```python
  import numpy as np
  import tensorflow as tf
  import tf_quant_finance as tff
  dates = tff.datetime
  
  dtype = np.float64
  notional = 1.
  settlement_date = dates.convert_to_date_tensor([(2021, 2, 8)])
  fixing_date = dates.convert_to_date_tensor([(2021, 2, 8)])
  valuation_date = dates.convert_to_date_tensor([(2020, 2, 8)])
  fixed_rate = 0.02
  rate_term = rate_term = dates.periods.months(3)
  
  fra = tff.experimental.instruments.ForwardRateAgreement(
        notional, settlement_date, fixing_date, fixed_rate,
        rate_term=rate_term, dtype=dtype)
  curve_dates = valuation_date + dates.periods.months([1, 2, 3, 12, 24, 60])
  reference_curve = tff.experimental.instruments.RateCurve(
      curve_dates,
      np.array([0.02, 0.025, 0.0275, 0.03, 0.035, 0.0325], dtype=dtype),
      dtype=dtype)
  market = tff.experimental.instruments.InterestRateMarket(
      reference_curve=reference_curve, discount_curve=reference_curve)
  
  price = fra.price(valuation_date, market)
  # Expected result: 0.00378275
  ```
  
  #### References:
  [1]: Leif B.G. Andersen and Vladimir V. Piterbarg. Interest Rate Modeling,
      Volume I: Foundations and Vanilla Models. Chapter 5. 2010.
class_docstr_tok: ["Represents","a","batch","of","Forward","Rate","Agreements","(","FRA",")",".","An","FRA","is","a","contract","for","the","period","[","T",",","T+tau","]","where","the","holder","exchanges","a","fixed","rate","(","agreed","at","the","start","of","the","contract",")","against","a","floating","payment","determined","at","time","T","based","on","the","spot","Libor","rate","for","term","`","tau","`",".","The","cashflows","are","exchanged","at","the","settlement","time","T_s",",","which","is","either","equal","to","T","or","close","to","T.","The","FRA","are","structured","so","that","the","payments","are","made","in","T+tau","dollars","(","ref","[","1","]",")",".","The","ForwardRateAgreement","class","can","be","used","to","create","and","price","multiple","FRAs","simultaneously",".","However","all","FRAs","within","a","FRA","object","must","be","priced","using","a","common","reference","and","discount","curve",".","#","#","#","#","Example",":","The","following","example","illustrates","the","construction","of","a","FRA","instrument","and","calculating","its","price",".","``","`","python","import","numpy","as","np","import","tensorflow","as","tf","import","tf_quant_finance","as","tff","dates","=","tff.datetime","dtype","=","np.float64","notional","=","1.","settlement_date","=","dates.convert_to_date_tensor","(","[","(","2021",",","2",",","8",")","]",")","fixing_date","=","dates.convert_to_date_tensor","(","[","(","2021",",","2",",","8",")","]",")","valuation_date","=","dates.convert_to_date_tensor","(","[","(","2020",",","2",",","8",")","]",")","fixed_rate","=","0.02","rate_term","=","rate_term","=","dates.periods.months","(","3",")","fra","=","tff.experimental.instruments.ForwardRateAgreement","(","notional",",","settlement_date",",","fixing_date",",","fixed_rate",",","rate_term=rate_term",",","dtype=dtype",")","curve_dates","=","valuation_date","+","dates.periods.months","(","[","1",",","2",",","3",",","12",",","24",",","60","]",")","reference_curve","=","tff.experimental.instruments.RateCurve","(","curve_dates",",","np.array","(","[","0.02",",","0.025",",","0.0275",",","0.03",",","0.035",",","0.0325","]",",","dtype=dtype",")",",","dtype=dtype",")","market","=","tff.experimental.instruments.InterestRateMarket","(","reference_curve=reference_curve",",","discount_curve=reference_curve",")","price","=","fra.price","(","valuation_date",",","market",")","#","Expected","result",":","0.00378275","``","`","#","#","#","#","References",":","[","1","]",":","Leif","B.G",".","Andersen","and","Vladimir","V.","Piterbarg",".","Interest","Rate","Modeling",",","Volume","I",":","Foundations","and","Vanilla","Models",".","Chapter","5",".","2010","."]
docstr: Returns the present value of the instrument on the valuation date.
  
  Args:
    valuation_date: A scalar `DateTensor` specifying the date on which
      valuation is being desired.
    market: A namedtuple of type `InterestRateMarket` which contains the
      necessary information for pricing the FRA instrument.
    model: Reserved for future use.
  
  Returns:
    A Rank 1 `Tensor` of real type containing the modeled price of each FRA
    contract based on the input market data.
docstr_tok: ["Returns","the","present","value","of","the","instrument","on","the","valuation","date",".","Args",":","valuation_date",":","A","scalar","`","DateTensor","`","specifying","the","date","on","which","valuation","is","being","desired",".","market",":","A","namedtuple","of","type","`","InterestRateMarket","`","which","contains","the","necessary","information","for","pricing","the","FRA","instrument",".","model",":","Reserved","for","future","use",".","Returns",":","A","Rank","1","`","Tensor","`","of","real","type","containing","the","modeled","price","of","each","FRA","contract","based","on","the","input","market","data","."]
code: def price(self, valuation_date, market, model=None):
      """Returns the present value of the instrument on the valuation date.
  
      Args:
        valuation_date: A scalar `DateTensor` specifying the date on which
          valuation is being desired.
        market: A namedtuple of type `InterestRateMarket` which contains the
          necessary information for pricing the FRA instrument.
        model: Reserved for future use.
  
      Returns:
        A Rank 1 `Tensor` of real type containing the modeled price of each FRA
        contract based on the input market data.
      """
  
      del model, valuation_date
  
      reference_curve = market.reference_curve
      discount_curve = market.discount_curve
  
      fwd_rate = reference_curve.get_forward_rate(
          self._accrual_start_date,
          self._accrual_end_date,
          self._daycount_fraction,
      )
      discount_at_settlement = discount_curve.get_discount_factor(
          self._settlement_date
      )
  
      return (
          discount_at_settlement
          * self._notional
          * (fwd_rate - self._fixed_rate)
          * self._daycount_fraction
          / (1.0 + self._daycount_fraction * fwd_rate)
      )
  
imports: import tensorflow.compat.v2
  from tf_quant_finance import datetime
  from tf_quant_finance.experimental.instruments import rates_common
label_desc: Use image node_id 2 for calling the ForwardRateAgreement obj's underlying member method code with example usage: obj.price(valuation_date, market, model) and returns: unknown