quantlab.factor.config.BenchmarkBetaConfig#

class quantlab.factor.config.BenchmarkBetaConfig(*, warmup_bars=252, dataset, file_path=None, factor_names=None, kwargs=None, resample_freq=None, resample_how=None, name=None, benchmark, lookback_bars=252, min_bars=120, price_column='adjClose')[source]#

Bases: BaseFactorConfig

Config of quantlab.factor.predefined.benchmark_beta.BenchmarkBeta.

dataset holds the symbols’ prices and benchmark a market dataset with exactly one symbol, such as an index ETF; both are component fields, so to_dict() nests their configs. warmup_bars is at least lookback_bars, so the first requested bar has a full window; its default is the default window.

Examples

With stocks a price dataset and vt a single-symbol one:

>>> cfg = BenchmarkBetaConfig(dataset=stocks, benchmark=vt)
>>> cfg.warmup_bars, cfg.lookback_bars, cfg.min_bars, cfg.price_column
(252, 252, 120, 'adjClose')
benchmark#

The single-symbol market dataset the symbols’ returns are regressed on.

lookback_bars = 252#

One-bar returns in each window, the bar’s own included.

min_bars = 120#

Fewest returns a window needs, with both the symbol’s and the benchmark’s present; a window with fewer gives NaN.

price_column = 'adjClose'#

The price variable, in both datasets, the returns are computed from.

warmup_bars = 252#

Bars read before the requested start; at least lookback_bars.