bayesline.api.equity.ModelConstructionSettings#
- model ModelConstructionSettings#
Defines settings to build a factor risk model.
Fields# Field
Type
Required
Default
No
'USD'str|int|UniverseSettings|NoneNo
NoneNo
TrueNo
factory
tuple[Annotated[float,Le(le=0)] |None,Annotated[float,Ge(ge=0)] |None]No
(-0.1, 0.1)No
factory
No
factory
Literal[‘SqrtCap’, ‘InvIdioVar’, ‘Cap’]No
'SqrtCap'Mapping[str,Literal[‘none’, ‘equal_weights’, ‘mcap_weighted’]]No
factory
Validators# Validator
Mode
Fields
after
- field estimation_universe: str | int | UniverseSettings | None [Optional]#
The universe settings to use for the estimation universe.
- field fx_convert_returns: bool [Optional]#
Whether to convert the asset returns to the currency of the factor model.
- field known_factor_map: Mapping[tuple[str, str], str] [Optional]#
A mapping from tuple of factor groups and factor names (labels) to known series. These factors will have fixed returns derived from the series.
- field return_clip_bounds: tuple[Annotated[float, Le(le=0)] | None, Annotated[float, Ge(ge=0)] | None] [Optional]#
The bounds for the return clipping.
- field thin_category_shrinkage: Mapping[str, Annotated[float, Ge(ge=0)]] [Optional]#
Minimum effective number of assets (n_eff) for categorical factor groups. Factors with n_eff below this threshold get L2 shrinkage toward zero, with strength proportional to (threshold - n_eff). n_eff is the inverse HHI of regression-weight-scaled exposures. Keys are factor group names, values are n_eff thresholds. Interaction groups automatically inherit the threshold from their categorical parent component.
- field thin_category_shrinkage_overrides: Mapping[tuple[str, str], Annotated[float, Ge(ge=0)]] [Optional]#
The shrinkage strength override for the factor risk model. The keys are the tuples of (categorical) factor groups and factor names and the values are the shrinkage penalty overrides.
- field weights: Literal['SqrtCap', 'InvIdioVar', 'Cap'] [Optional]#
The regression weights used for the factor risk model.
- Validated by:
- field zero_sum_constraints: Mapping[str, Literal['none', 'equal_weights', 'mcap_weighted']] [Optional]#
Whether to apply a zero-sum constraint to the categorical exposures. If the category exposures are exhaustive and sum to one, then implicitly a dummy variable trap is present. This can be avoided by creating a constraint on the factor returns. This means the interpretation of the categorical factor returns is ‘in excess of’ the market. If ‘none’, no constraint is applied (for example if we do not have a market factor). If ‘equal_weights’ or ‘mcap_weighted’, then the categorical factor returns are constrained to sum to zero, either market-cap weighted or not. For all categorical factor groups, a value must be provided.