qis.compute_ewm_matrix_autocorr_df

qis.compute_ewm_matrix_autocorr_df(data, ewm_lambda=0.94, mean_adj_type=MeanAdjType.EWMA, lag=1, aggregation_type='mean', is_normalize=True)[source]

EWM lagged cross moments of a panel as two columns, diagonal and off-diag.

Forward-fills, drops rows with any remaining NaN, removes the mean chosen by mean_adj_type (the point-in-time EWM mean with the same decay by default) and runs compute_ewm_matrix_autocorr() from a zero seed.

Parameters:
  • data (DataFrame) – observations, rows are dates and columns are assets

  • ewm_lambda (float) – EWM decay of the mean and of the moments

  • mean_adj_type (MeanAdjType) – mean removed first; MeanAdjType.INSAMPLE looks ahead

  • lag (int) – lag in rows

  • aggregation_type (str) – 'mean' or 'median'; see compute_ewm_matrix_autocorr()

  • is_normalize (bool) – divide the lagged by the contemporaneous moments elementwise

Returns:

columns diagonal and off-diag on the retained rows, NaN for the first lag

Raises:

TypeError – if data has a single row

Return type:

DataFrame