bayesline.api.equity.CategoricalExposureGroupSettings

bayesline.api.equity.CategoricalExposureGroupSettings#

model CategoricalExposureGroupSettings#

The settings for a categorical exposure group.

Categorical exposures are exposures to a categorical variable, e.g. industry, country, etc. For example, an asset exposure may be to a single industry factor, and we say the exposure is to the industry category factor “Materials”. The exposure itself may be continuous (e.g. not 0.0 or 1.0), and an asset may be exposed to multiple industry factors (but typically not all of them). The distinction with continuous exposures is primarily in the settings that are available.

Fields#

Field

Type

Required

Default

exclude

list[str]

No

factory

exposure_type

Literal[‘categorical’]

No

'categorical'

factor_group

str

No

''

hierarchy

HierarchyLevel | HierarchyGroups

Yes

include

Literal[‘All’] | list[str]

No

'All'

Validators#

Validator

Mode

Fields

check_valid_factor_group

after

factor_group

set_factor_group

before

model

validate_filters

after

model

field exclude: list[str] [Optional]#

Valid industry codes or labels for given hierarchy at any level. If labels are used which may be duplicated, then the code with the lowest level is used.

Validated by:

set_factor_group validate_filters

field exposure_type: Literal['categorical'] [Optional]#
Validated by:

set_factor_group validate_filters

field factor_group: str [Optional]#

By default, the name of the factor group will be the name of the hierarchy. But we can override this by specifying an alias here.

Validated by:

check_valid_factor_group set_factor_group validate_filters

field hierarchy: HierarchyLevel | HierarchyGroups [Required]#

The hierarchy to use for the categorical exposures. This is either aHierarchyLevel or HierarchyGroups object. If a string is passed, the value is converted to a HierarchyLevel of that hierarchy with level=1.

Validated by:

set_factor_group validate_filters

field include: Literal['All'] | list[str] [Optional]#

Valid industry codes or labels for given hierarchy at any level. If labels are used which may be duplicated, then the code with the highest level is used. If ‘All’, all codes are included.

Validated by:

set_factor_group validate_filters

validator check_valid_factor_group(mode=after)#
Validates:

factor_group

validator set_factor_group(mode=before)#
Validates:

entire model

validator validate_filters(mode=after)#
Validates:

entire model