class_docstr: Prices forwards for odd dates which are not quoted using linear interpolation,
  eg. if we have forward points for 1W and 1M, and spot date but we want to price a 3W forward, or any arbitrary horizon
  date that lies in that interval
  
  Also calculates the implied deposit rate from FX spot, FX forward points and deposit rate.
class_docstr_tok: ["Prices","forwards","for","odd","dates","which","are","not","quoted","using","linear","interpolation",",","eg",".","if","we","have","forward","points","for","1W","and","1M",",","and","spot","date","but","we","want","to","price","a","3W","forward",",","or","any","arbitrary","horizon","date","that","lies","in","that","interval","Also","calculates","the","implied","deposit","rate","from","FX","spot",",","FX","forward","points","and","deposit","rate","."]
docstr: Calculates implied deposit rates for a particular currency from spot, forward points and deposit rate
  for the other currency. Uses the theory of covered interest rate parity.
  
  See BIS publication from 2016, Covered interest parity lost: understanding the cross-currency basis downloadable from
  https://www.bis.org/publ/qtrpdf/r_qt1609e.pdf for an explanation
  
  Eg. using EURUSD spot, EURUSD 1W forward points and USDON deposit rate, we can calculate the implied deposit
  for EUR 1W
  
  Parameters
  ----------
  cross : str
      Currency pair
  
  implied_currency : str
      Currency for which we want to imply deposit
  
  market_df : DataFrame
      With FX spot rate, FX forward points and deposit rates
  
  fx_forwards_tenor : str (list)
      Tenors of forwards where we want to imply deposit
  
  depo_tenor : str
      Deposit rate to use (default - ON)
  
  Returns
  -------
  DataFrame
docstr_tok: ["Calculates","implied","deposit","rates","for","a","particular","currency","from","spot",",","forward","points","and","deposit","rate","for","the","other","currency",".","Uses","the","theory","of","covered","interest","rate","parity",".","See","BIS","publication","from","2016",",","Covered","interest","parity","lost",":","understanding","the","cross-currency","basis","downloadable","from","https",":","\/\/www.bis.org\/publ\/qtrpdf\/r_qt1609e.pdf","for","an","explanation","Eg",".","using","EURUSD","spot",",","EURUSD","1W","forward","points","and","USDON","deposit","rate",",","we","can","calculate","the","implied","deposit","for","EUR","1W","Parameters","--","--","--","--","--","cross",":","str","Currency","pair","implied_currency",":","str","Currency","for","which","we","want","to","imply","deposit","market_df",":","DataFrame","With","FX","spot","rate",",","FX","forward","points","and","deposit","rates","fx_forwards_tenor",":","str","(","list",")","Tenors","of","forwards","where","we","want","to","imply","deposit","depo_tenor",":","str","Deposit","rate","to","use","(","default","-","ON",")","Returns","--","--","--","-","DataFrame"]
code: def calculate_implied_depo(
      self,
      cross,
      implied_currency,
      market_df=None,
      quoted_delivery_df=None,
      fx_forwards_tenor=market_constants.fx_forwards_trading_tenor,
      depo_tenor=None,
  ):
      """Calculates implied deposit rates for a particular currency from spot, forward points and deposit rate
      for the other currency. Uses the theory of covered interest rate parity.
  
      See BIS publication from 2016, Covered interest parity lost: understanding the cross-currency basis downloadable from
      https://www.bis.org/publ/qtrpdf/r_qt1609e.pdf for an explanation
  
      Eg. using EURUSD spot, EURUSD 1W forward points and USDON deposit rate, we can calculate the implied deposit
      for EUR 1W
  
      Parameters
      ----------
      cross : str
          Currency pair
  
      implied_currency : str
          Currency for which we want to imply deposit
  
      market_df : DataFrame
          With FX spot rate, FX forward points and deposit rates
  
      fx_forwards_tenor : str (list)
          Tenors of forwards where we want to imply deposit
  
      depo_tenor : str
          Deposit rate to use (default - ON)
  
      Returns
      -------
      DataFrame
      """
  
      if not (isinstance(fx_forwards_tenor, list)):
          fx_forwards_tenor = [fx_forwards_tenor]
  
      if market_df is None:
          market_df = self._market_df
      if quoted_delivery_df is None:
          quoted_delivery_df = self._quoted_delivery_df
      if depo_tenor is None:
          depo_tenor = fx_forwards_tenor
  
      if not (isinstance(depo_tenor, list)):
          depo_tenor = [depo_tenor] * len(fx_forwards_tenor)
  
      cal = cross
  
      # Get the spot date (different currency pairs have different conventions for this!)
      spot_date = self._calendar.get_spot_date_from_horizon_date(
          market_df.index, cal
      )
  
      (
          quoted_delivery_df,
          quoted_delivery_days_arr,
          forwards_points_arr,
          divisor,
      ) = self._setup_forwards_calculation(
          cross,
          spot_date,
          market_df,
          quoted_delivery_df,
          fx_forwards_tenor,
      )
  
      spot_arr = market_df[cross + ".close"].values
  
      outright_forwards_arr = (
          np.vstack([spot_arr] * len(fx_forwards_tenor)).T
          + forwards_points_arr
      )
  
      base_conv = self.get_day_count_conv(cross[0:3])
      terms_conv = self.get_day_count_conv(cross[3:6])
  
      # Infer base currency
      if implied_currency == cross[0:3]:
          original_currency = cross[3:6]
  
          depo_arr = (
              market_df[
                  [original_currency + d + ".close" for d in depo_tenor]
              ].values
              / 100.0
          )
  
          implied_depo_arr = _infer_base_currency_depo_numba(
              spot_arr,
              outright_forwards_arr,
              depo_arr,
              quoted_delivery_days_arr,
              base_conv,
              terms_conv,
              len(fx_forwards_tenor),
          )
  
          # for i in range(len(implied_depo_arr)):
          #     for j, tenor in enumerate(fx_forwards_tenor):
          #         implied_depo_arr[i, j] = (((1 + depo_arr[i,j] * (quoted_delivery_days_arr[i, j] / terms_conv))
          #                                    / (outright_forwards_arr[i,j] / spot_arr[i])) - 1) \
          #                                  / (quoted_delivery_days_arr[i, j] / base_conv)
  
      # Infer terms currency
      if implied_currency == cross[3:6]:
          original_currency = cross[0:3]
  
          depo_arr = (
              market_df[
                  [original_currency + d + ".close" for d in depo_tenor]
              ].values
              / 100.0
          )
  
          implied_depo_arr = _infer_terms_currency_depo_numba(
              spot_arr,
              outright_forwards_arr,
              depo_arr,
              quoted_delivery_days_arr,
              base_conv,
              terms_conv,
              len(fx_forwards_tenor),
          )
  
          # for i in range(len(implied_depo_arr)):
          #     for j, tenor in enumerate(fx_forwards_tenor):
          #         implied_depo_arr[i,j] = ((outright_forwards_arr[i,j] / spot_arr[i]) *
          #                                  (1 + depo_arr[i,j] * (quoted_delivery_days_arr[i,j] / base_conv)) - 1) \
          #                                 / (quoted_delivery_days_arr[i,j] / terms_conv)
  
      return pd.DataFrame(
          index=market_df.index,
          columns=[
              implied_currency + x + "-implied-depo.close"
              for x in fx_forwards_tenor
          ],
          data=implied_depo_arr * 100.0,
      )
  
file_path: finmarketpy/finmarketpy/curve/rates/fxforwardspricer.py
imports: import numpy
  import pandas
  from numba import guvectorize
  from findatapy.timeseries import Calendar
  from finmarketpy.util.marketconstants import MarketConstants
  from finmarketpy.curve.abstractpricer import AbstractPricer
label_desc: Use image node_id 7 for calling the FXForwardsPricer obj's underlying member method code with example usage: obj.calculate_implied_depo(cross, implied_currency, market_df, quoted_delivery_df, fx_forwards_tenor, depo_tenor) and returns: pd