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,
diagonalandoff-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 runscompute_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.INSAMPLElooks aheadlag (int) – lag in rows
aggregation_type (str) –
'mean'or'median'; seecompute_ewm_matrix_autocorr()is_normalize (bool) – divide the lagged by the contemporaneous moments elementwise
- Returns:
columns
diagonalandoff-diagon the retained rows, NaN for the firstlag- Raises:
TypeError – if
datahas a single row- Return type: