qis.compute_excess_returns

qis.compute_excess_returns(returns, rates_data)[source]

Subtract the cash return accrued over each return period.

The cash return of the period (t-1, t] is the annual rate known at the return date t-1, the latest rates_data quote dated on or before it, times the ACT/365 fraction (d_t - d_{t-1}) / 365. The lag is one period of the return grid whatever the calendar of the rate series, and the first return date accrues no cash.

Parameters:
  • returns (Series | DataFrame) – Simple return time series on a DatetimeIndex

  • rates_data (Series) – Annual cash rate on its own calendar, in decimals

Returns:

Excess returns on the return index. A period that starts before the first rate quote has a missing excess return

Return type:

Series | DataFrame