qis.compute_asset_returns_dict

qis.compute_asset_returns_dict(prices, returns_freqs, drop_first=False, is_first_zero=True, is_log_returns=False, ffill_nans=True)[source]

Compute returns for assets grouped by frequency.

Parameters:
  • prices (DataFrame) – Price DataFrame with asset columns

  • returns_freqs (str | Series) – Series mapping asset tickers to return frequencies

  • drop_first (bool) – Drop first return observation

  • is_first_zero (bool) – Set first non-NaN return to zero

  • is_log_returns (bool) – Use log returns

  • ffill_nans (bool) – Forward-fill prices when resampling to a different frequency. False keeps missing sampled prices; input already on the requested grid keeps its missing observations regardless of this option, as in to_returns

Returns:

Dictionary with frequency keys and return DataFrames as values

Return type:

Dict[str, DataFrame]