bayesline.api.equity.InlineUploadedExposureGroupSettings#

pydantic model bayesline.api.equity.InlineUploadedExposureGroupSettings#

Exposure group settings for exposures taken directly from an uploaded dataset.

Reads one factor group of an uploaded exposures dataset at report time, without requiring a risk dataset rebuild. Assets in the upload that are not part of the risk dataset are dropped with a warning when the report is built.

Uploaded exposures are stored as 16 bit floats, so the exposures used here are the 16 bit round trip of the uploaded values.

Show JSON schema
{
   "title": "InlineUploadedExposureGroupSettings",
   "description": "Exposure group settings for exposures taken directly from an uploaded dataset.\n\nReads one factor group of an uploaded exposures dataset at report time, without\nrequiring a risk dataset rebuild. Assets in the upload that are not part of the\nrisk dataset are dropped with a warning when the report is built.\n\nUploaded exposures are stored as 16 bit floats, so the exposures used here are\nthe 16 bit round trip of the uploaded values.",
   "type": "object",
   "properties": {
      "exposure_type": {
         "const": "inline_uploaded",
         "default": "inline_uploaded",
         "title": "Exposure Type",
         "type": "string"
      },
      "exposure_source": {
         "description": "The name of the uploaded exposures dataset.",
         "minLength": 1,
         "pattern": "^(?:[^/\\s]+/)?[A-Za-z][A-Za-z0-9_-]*$",
         "title": "Exposure Source",
         "type": "string"
      },
      "factor_group": {
         "description": "The factor group in the uploaded dataset to take exposures from.",
         "minLength": 1,
         "pattern": "^[A-Za-z][A-Za-z0-9_-]*$",
         "title": "Factor Group",
         "type": "string"
      },
      "include": {
         "anyOf": [
            {
               "const": "All",
               "type": "string"
            },
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            }
         ],
         "default": "All",
         "description": "Factor names to include from the uploaded dataset. 'All' includes all.",
         "title": "Include"
      },
      "exclude": {
         "description": "Factor names to exclude from the uploaded dataset.",
         "items": {
            "type": "string"
         },
         "title": "Exclude",
         "type": "array"
      },
      "forward_fill": {
         "default": false,
         "description": "Whether to forward-fill the exposures along time, gated by the priced-day mask (no fill on days the asset is not in the modeling universe). Applied before gaussianizing and filling missing values.",
         "title": "Forward Fill",
         "type": "boolean"
      },
      "gaussianize": {
         "default": false,
         "description": "Whether to gaussianize the exposures.",
         "title": "Gaussianize",
         "type": "boolean"
      },
      "gaussianize_maintain_zeros": {
         "default": false,
         "description": "Whether to maintain zeros when gaussianizing the exposures. This only takes effect during gaussianization, so it requires ``gaussianize``.",
         "title": "Gaussianize Maintain Zeros",
         "type": "boolean"
      },
      "fill_miss": {
         "default": false,
         "description": "Whether to fill in missing exposures.",
         "title": "Fill Miss",
         "type": "boolean"
      },
      "standardize_method": {
         "default": "none",
         "description": "The method to use for standardizing the exposures. If 'none', no standardization is applied. If 'equal_weighted', then the exposures are standardized with the mean and standard deviation of the estimation universe.",
         "enum": [
            "none",
            "equal_weighted"
         ],
         "examples": [
            "none",
            "equal_weighted"
         ],
         "title": "Standardize Method",
         "type": "string"
      },
      "net_of": {
         "description": "Factor groups this group's exposures are taken net of (weighted-orthogonalized against) under the exposure settings' orthogonalization_weights, e.g. a style block net of ['market', 'industry']. See orthogonalization_weights for what moves in a consuming model and the covariance caveat.",
         "examples": [
            [
               "market",
               "industry"
            ]
         ],
         "items": {
            "type": "string"
         },
         "title": "Net Of",
         "type": "array"
      }
   },
   "additionalProperties": false,
   "required": [
      "exposure_source",
      "factor_group"
   ]
}

Config:
  • frozen: bool = True

  • extra: str = forbid

Fields:
  • exclude (list[str])

  • exposure_source (str)

  • exposure_type (Literal['inline_uploaded'])

  • factor_group (str)

  • fill_miss (bool)

  • forward_fill (bool)

  • gaussianize (bool)

  • gaussianize_maintain_zeros (bool)

  • include (Literal['All'] | list[str])

  • net_of (list[str])

  • standardize_method (Literal['none', 'equal_weighted'])

Validators:
  • _validate_gaussianize_maintain_zeros » all fields

field exposure_type: Literal['inline_uploaded'] = 'inline_uploaded'#
Validated by:
  • _validate_gaussianize_maintain_zeros

field exposure_source: SafeSourceStr [Required]#

The name of the uploaded exposures dataset.

Constraints:
  • strip_whitespace = True

  • min_length = 1

  • pattern = ^(?:[^/s]+/)?[A-Za-z][A-Za-z0-9_-]*$

Validated by:
  • _validate_gaussianize_maintain_zeros

field factor_group: SafeStr [Required]#

The factor group in the uploaded dataset to take exposures from.

Constraints:
  • strip_whitespace = True

  • min_length = 1

  • pattern = ^[A-Za-z][A-Za-z0-9_-]*$

Validated by:
  • _validate_gaussianize_maintain_zeros

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

Factor names to include from the uploaded dataset. ‘All’ includes all.

Validated by:
  • _validate_gaussianize_maintain_zeros

field exclude: list[str] [Optional]#

Factor names to exclude from the uploaded dataset.

Validated by:
  • _validate_gaussianize_maintain_zeros

field forward_fill: bool = False#

Whether to forward-fill the exposures along time, gated by the priced-day mask (no fill on days the asset is not in the modeling universe). Applied before gaussianizing and filling missing values.

Validated by:
  • _validate_gaussianize_maintain_zeros

field gaussianize: bool = False#

Whether to gaussianize the exposures.

Validated by:
  • _validate_gaussianize_maintain_zeros

field gaussianize_maintain_zeros: bool = False#

Whether to maintain zeros when gaussianizing the exposures. This only takes effect during gaussianization, so it requires gaussianize.

Validated by:
  • _validate_gaussianize_maintain_zeros

field fill_miss: bool = False#

Whether to fill in missing exposures.

Validated by:
  • _validate_gaussianize_maintain_zeros

field standardize_method: Literal['none', 'equal_weighted'] = 'none'#

The method to use for standardizing the exposures. If ‘none’, no standardization is applied. If ‘equal_weighted’, then the exposures are standardized with the mean and standard deviation of the estimation universe.

Validated by:
  • _validate_gaussianize_maintain_zeros

field net_of: list[str] [Optional]#

Factor groups this group’s exposures are taken net of (weighted-orthogonalized against) under the exposure settings’ orthogonalization_weights, e.g. a style block net of [‘market’, ‘industry’]. See orthogonalization_weights for what moves in a consuming model and the covariance caveat.

Validated by:
  • _validate_gaussianize_maintain_zeros

property hierarchies: list[Annotated[HierarchyLevel | HierarchyGroups, FieldInfo(annotation=NoneType, required=True, discriminator='hierarchy_type'), BeforeValidator(func=_hierarchy_name_to_hierarchy_level, json_schema_input_type=PydanticUndefined)]]#

The list of hierarchies for the exposure group.

Returns#

list[HierarchyType]

Empty list; inline uploaded exposures have no hierarchies.

effective_exposure_group_factors(menu: ExposureSettingsMenu) list[str]#

Get the effective factors.

Parameters#

menuExposureSettingsMenu

The menu to get the total factors from (unused).

Returns#

list[str]

Empty list; factors are resolved at report time from uploaded data.

normalize_group_settings(menu: ExposureSettingsMenu, universe_filter_dict: Mapping[str, CategoricalFilterSettings] | None) InlineUploadedExposureGroupSettings#

Normalize the exposure group settings.

Parameters#

menuExposureSettingsMenu

The menu to get the total factors from (unused).

universe_filter_dictMapping[str, CategoricalFilterSettings] | None

The universe filter dictionary (unused).

Returns#

InlineUploadedExposureGroupSettings

Self, unchanged; inline uploaded groups do not need normalization.