Design a site like this with WordPress.com
Get started

Time Series Analytics

  1. Semi-log graph of equity curve
  2. Exposure over time
  3. Half year rolling return, annualized
    • Useful to see what annualized would look like in a shorter time firm
    • AnnualizedReturn = (EndValue/StartValue)^YearDays/ActualDays-1
    • Python:
      • def ann_ret(ts):
        • return np.power((ts[-1]/ts[0]), (year_length/len(ts)))-1
  4. Maximum Drawdown
    • Python:
      • def dd(ts):
        • return np.min(ts/np.maximum.accumulate(ts)) – 1
  5. Recalculate time series vs benchmarks with same starting point
    • Python:
      • def rebased(ts):
        • return ts / ts[0]
  • Key python reminders:
    • Remove all N/A calculations:
      • df.dropna(inplace=True)
    • Reset figures when needed:
      • fig.clear(True)
    • Start returns at 0:
      • df.iloc[0].[loc[‘underlying_return’] = 0
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: