gs_quant.timeseries.econometrics.excess_returns_ — gs_quant 0.1 documentation

# gs_quant.timeseries.econometrics.excess_returns_

`excess_returns_`(price_series, currency=<RiskFreeRateCurrency.USD: 'USD'>)

  Calculate excess returns

  Parameters

    - price_series (`Series`) – price series

    - currency (`RiskFreeRateCurrency`) – currency for risk-free rate, defaults to USD

  Return type

    `Series`

  Returns

    excess returns

  Usage

  Given a price series P and risk-free rate R, excess returns E are defined as:

  \(E_t = E_{t-1} + P_t - P_{t-1} * (1 + R * (D_t - D_{t-1}) / 360)\)

  The Actual/360 day count convention is used.

  Examples

  Get excess returns from a price series.

      >>> er = excess_returns(generate_series(100), USD)