rolling_daily_beta

eap_pl.rolling_daily_beta(monthly, months, minimum, label)

Estimate stock betas from daily returns over a rolling calendar window.

Parameters

Name Type Description Default
monthly pl.DataFrame | pl.LazyFrame Sorted stock-month sums from add_anchors(), including the sums for stock excess return retrf and market return mkt_5. required
months int Number of calendar months in the window, including the current month. required
minimum int Minimum number of daily observations required in the window. required
label str Name of the output beta column. required

Returns

Name Type Description
polars.DataFrame | polars.LazyFrame permno, month, and the beta estimate. The estimate is null when the observation count is below minimum or the market variance is zero.