bayesline.api.equity.AssetForecastLossReportSettings#
- pydantic model bayesline.api.equity.AssetForecastLossReportSettings#
Defines settings to build a forecast loss report.
Show JSON schema
{ "title": "AssetForecastLossReportSettings", "description": "Defines settings to build a forecast loss report.", "type": "object", "properties": { "type": { "const": "Forecast Loss report", "default": "Forecast Loss report", "title": "Type", "type": "string" }, "measures": { "description": "The measures to include in the report.", "items": { "anyOf": [ { "$ref": "#/$defs/PassThroughFactor2DMeasureSettings" }, { "$ref": "#/$defs/HoldingsMeasureSettings" }, { "$ref": "#/$defs/ExposureMeasureSettings" }, { "$ref": "#/$defs/XSigmaRhoMeasureSettings" }, { "$ref": "#/$defs/TimeSeriesXSigmaRhoMeasureSettings" }, { "$ref": "#/$defs/TimeSeriesBetaMeasureSettings" }, { "$ref": "#/$defs/HVaRMeasureSettings" }, { "$ref": "#/$defs/AVaRMeasureSettings" }, { "$ref": "#/$defs/TimeSeriesVolatilityMeasureSettings" }, { "$ref": "#/$defs/CumsumMeasureSettings" }, { "$ref": "#/$defs/DrawdownMeasureSettings" }, { "$ref": "#/$defs/MovingAverageMeasureSettings" }, { "$ref": "#/$defs/FactorMovingAverageMeasureSettings" }, { "$ref": "#/$defs/MovingAverageRSquaredMeasureSettings" }, { "$ref": "#/$defs/VolForecastMeasureSettings" }, { "$ref": "#/$defs/FactorVolForecastMeasureSettings" }, { "$ref": "#/$defs/FactorCovarianceMeasureSettings" }, { "$ref": "#/$defs/IdiosyncraticReturnMeasureSettings" }, { "$ref": "#/$defs/IdiosyncraticVolatilityMeasureSettings" }, { "$ref": "#/$defs/FactorIdioMeasureSettings" }, { "$ref": "#/$defs/ForecastBacktestMeasureSettings" }, { "$ref": "#/$defs/BrinsonAttributionMeasureSettings" }, { "$ref": "#/$defs/FactorAttributionMeasureSettings" }, { "$ref": "#/$defs/PortfolioStressTestMeasureSettings" }, { "$ref": "#/$defs/AssetStressTestMeasureSettings" }, { "$ref": "#/$defs/AssetHoldingsMeasureSettings" } ] }, "title": "Measures", "type": "array" }, "horizons": { "default": [ 1, 5, 21 ], "description": "The forecast horizons to use.", "items": { "type": "integer" }, "title": "Horizons", "type": "array" }, "halflife_factor_vol": { "default": 42, "description": "The half-life for the factor volatility.", "title": "Halflife Factor Vol", "type": "integer" }, "halflife_factor_adj": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "The half-life for the factor adjustment. If None, no adjustment is applied.", "title": "Halflife Factor Adj" }, "halflife_factor_cor": { "default": 126, "description": "The half-life for the factor correlation.", "title": "Halflife Factor Cor", "type": "integer" }, "halflife_idio_vol": { "default": 42, "description": "The half-life for the idiosyncratic volatility.", "title": "Halflife Idio Vol", "type": "integer" }, "shrink_factor_cor_method": { "anyOf": [ { "enum": [ "LIS", "QIS", "GIS" ], "type": "string" }, { "type": "null" } ], "default": null, "description": "The method to use for the shrinkage of the factor correlation. If None, don't shrink.", "title": "Shrink Factor Cor Method" }, "shrink_factor_cor_length": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": 1008, "description": "If a shrinkage method is provided, the length of the shrinkage for the factor correlation.", "title": "Shrink Factor Cor Length" }, "shrink_factor_cor_standardized": { "default": false, "description": "If True, the correlation matrix is combined with an estimate based on the standardized returns. The halflife_factor_adj is used for the weights.", "title": "Shrink Factor Cor Standardized", "type": "boolean" }, "overlap_factor_vol": { "default": 0, "description": "The overlap for the factor volatility.", "title": "Overlap Factor Vol", "type": "integer" }, "overlap_factor_vol_halflife_override": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "The halflife override for the factor volatility for lagged returns.", "title": "Overlap Factor Vol Halflife Override" }, "overlap_factor_cor": { "default": 0, "description": "The overlap for the factor correlation.", "title": "Overlap Factor Cor", "type": "integer" }, "overlap_idio_vol": { "default": 0, "description": "The overlap for the idiosyncratic volatility.", "title": "Overlap Idio Vol", "type": "integer" }, "overlap_idio_vol_halflife_override": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "The halflife override for the idiosyncratic volatility for lagged returns.", "title": "Overlap Idio Vol Halflife Override" }, "shrink_idio_vol": { "default": 0.0, "description": "The shrinkage factor for the idiosyncratic volatility.", "title": "Shrink Idio Vol", "type": "number" } }, "$defs": { "AVaRMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "Analytical VaR", "default": "Analytical VaR", "title": "Type", "type": "string" }, "alpha": { "default": [ 0.1, 0.05 ], "items": { "type": "number" }, "title": "Alpha", "type": "array" } }, "title": "AVaRMeasureSettings", "type": "object" }, "AssetHoldingsMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "AssetHoldings", "default": "AssetHoldings", "title": "Type", "type": "string" } }, "title": "AssetHoldingsMeasureSettings", "type": "object" }, "AssetStressTestMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "AssetStressTest", "default": "AssetStressTest", "title": "Type", "type": "string" }, "shock_size": { "default": 1.0, "description": "The size of the shock to apply in standard deviations.", "title": "Shock Size", "type": "number" } }, "title": "AssetStressTestMeasureSettings", "type": "object" }, "BrinsonAttributionMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "BrinsonAttribution", "default": "BrinsonAttribution", "title": "Type", "type": "string" }, "rescale_bench": { "default": true, "description": "Rescale the benchmark holdings to sum to the sum of the holdings.", "title": "Rescale Bench", "type": "boolean" }, "normalize_holdings": { "default": true, "description": "Make holdings sum to one.", "title": "Normalize Holdings", "type": "boolean" }, "multiperiod_aggregation": { "default": "none", "enum": [ "none", "optimized" ], "title": "Multiperiod Aggregation", "type": "string" }, "return_aggregation_type": { "default": "geometric", "enum": [ "arithmetic", "geometric" ], "title": "Return Aggregation Type", "type": "string" } }, "title": "BrinsonAttributionMeasureSettings", "type": "object" }, "CumsumMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "Cumsum", "default": "Cumsum", "title": "Type", "type": "string" } }, "title": "CumsumMeasureSettings", "type": "object" }, "DrawdownMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "Drawdown", "default": "Drawdown", "title": "Type", "type": "string" }, "window": { "default": "6mo", "description": "The size of the rolling window", "title": "Window", "type": "string" } }, "title": "DrawdownMeasureSettings", "type": "object" }, "ExposureMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "Exposure", "default": "Exposure", "title": "Type", "type": "string" }, "rescale_bench": { "default": true, "description": "Rescale the benchmark holdings to sum to the sum of the holdings.", "title": "Rescale Bench", "type": "boolean" }, "normalize_holdings": { "default": true, "description": "Make holdings sum to one.", "title": "Normalize Holdings", "type": "boolean" } }, "title": "ExposureMeasureSettings", "type": "object" }, "FactorAttributionMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "FactorAttribution", "default": "FactorAttribution", "title": "Type", "type": "string" }, "rescale_bench": { "default": true, "description": "Rescale the benchmark holdings to sum to the sum of the holdings.", "title": "Rescale Bench", "type": "boolean" }, "normalize_holdings": { "default": true, "description": "Make holdings sum to one.", "title": "Normalize Holdings", "type": "boolean" }, "multiperiod_aggregation": { "default": "none", "enum": [ "none", "optimized" ], "title": "Multiperiod Aggregation", "type": "string" }, "return_aggregation_type": { "default": "geometric", "enum": [ "arithmetic", "geometric" ], "title": "Return Aggregation Type", "type": "string" } }, "title": "FactorAttributionMeasureSettings", "type": "object" }, "FactorCovarianceMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "FactorCovariance", "default": "FactorCovariance", "title": "Type", "type": "string" } }, "title": "FactorCovarianceMeasureSettings", "type": "object" }, "FactorIdioMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "FactorIdio", "default": "FactorIdio", "title": "Type", "type": "string" } }, "title": "FactorIdioMeasureSettings", "type": "object" }, "FactorMovingAverageMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "FactorMovingAverage", "default": "FactorMovingAverage", "title": "Type", "type": "string" }, "window": { "default": "6mo", "description": "The size of the rolling window", "title": "Window", "type": "string" }, "var": { "default": "p", "description": "The variable to average", "enum": [ "abs_t", "p", "p1", "p5" ], "title": "Var", "type": "string" } }, "title": "FactorMovingAverageMeasureSettings", "type": "object" }, "FactorVolForecastMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "FactorVolForecast", "default": "FactorVolForecast", "title": "Type", "type": "string" }, "window": { "default": "6mo", "description": "The size of the rolling window", "title": "Window", "type": "string" }, "metric": { "default": "qlike", "description": "The metric to use", "enum": [ "qlike", "mse", "mae", "bias" ], "title": "Metric", "type": "string" }, "ddof": { "default": 1, "description": "The degrees of freedom to use for the stability", "title": "Ddof", "type": "integer" } }, "title": "FactorVolForecastMeasureSettings", "type": "object" }, "ForecastBacktestMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "ForecastBacktest", "default": "ForecastBacktest", "title": "Type", "type": "string" }, "window": { "default": "6mo", "description": "The size of the rolling window", "title": "Window", "type": "string" }, "ddof": { "default": 1, "description": "The degrees of freedom to use for the stability", "title": "Ddof", "type": "integer" } }, "title": "ForecastBacktestMeasureSettings", "type": "object" }, "HVaRMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "Historical VaR", "default": "Historical VaR", "title": "Type", "type": "string" }, "alpha": { "default": [ 0.1, 0.05 ], "items": { "type": "number" }, "title": "Alpha", "type": "array" } }, "title": "HVaRMeasureSettings", "type": "object" }, "HoldingsMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "Holdings", "default": "Holdings", "title": "Type", "type": "string" } }, "title": "HoldingsMeasureSettings", "type": "object" }, "IdiosyncraticReturnMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "IdiosyncraticReturn", "default": "IdiosyncraticReturn", "title": "Type", "type": "string" } }, "title": "IdiosyncraticReturnMeasureSettings", "type": "object" }, "IdiosyncraticVolatilityMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "IdiosyncraticVolatility", "default": "IdiosyncraticVolatility", "title": "Type", "type": "string" } }, "title": "IdiosyncraticVolatilityMeasureSettings", "type": "object" }, "MovingAverageMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "MovingAverage", "default": "MovingAverage", "title": "Type", "type": "string" }, "window": { "default": "6mo", "description": "The size of the rolling window", "title": "Window", "type": "string" }, "var": { "default": "r2", "description": "The variable to average", "enum": [ "r2", "sigma2", "sigma" ], "title": "Var", "type": "string" } }, "title": "MovingAverageMeasureSettings", "type": "object" }, "MovingAverageRSquaredMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "MovingAverageRSquared", "default": "MovingAverageRSquared", "title": "Type", "type": "string" }, "rescale_bench": { "default": true, "description": "Rescale the benchmark holdings to sum to the sum of the holdings.", "title": "Rescale Bench", "type": "boolean" }, "normalize_holdings": { "default": true, "description": "Make holdings sum to one.", "title": "Normalize Holdings", "type": "boolean" }, "window": { "default": "6mo", "description": "The size of the rolling window", "title": "Window", "type": "string" } }, "title": "MovingAverageRSquaredMeasureSettings", "type": "object" }, "PassThroughFactor2DMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "PassThroughFactor2D", "default": "PassThroughFactor2D", "title": "Type", "type": "string" }, "name": { "default": "PassThroughFactor2D", "description": "The name of the measure.", "title": "Name", "type": "string" } }, "title": "PassThroughFactor2DMeasureSettings", "type": "object" }, "PortfolioStressTestMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "PortfolioStressTest", "default": "PortfolioStressTest", "title": "Type", "type": "string" }, "shock_size": { "default": 0.1, "description": "The size of the shock to apply.", "title": "Shock Size", "type": "number" } }, "title": "PortfolioStressTestMeasureSettings", "type": "object" }, "TimeSeriesBetaMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "TimeSeriesBeta", "default": "TimeSeriesBeta", "title": "Type", "type": "string" }, "rescale_bench": { "default": true, "description": "Rescale the benchmark holdings to sum to the sum of the holdings.", "title": "Rescale Bench", "type": "boolean" } }, "title": "TimeSeriesBetaMeasureSettings", "type": "object" }, "TimeSeriesVolatilityMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "TimeSeriesVolatility", "default": "TimeSeriesVolatility", "title": "Type", "type": "string" }, "window": { "default": "6mo", "description": "The size of the rolling window", "title": "Window", "type": "string" }, "ddof": { "default": 1, "description": "The degrees of freedom to use for the volality", "title": "Ddof", "type": "integer" } }, "title": "TimeSeriesVolatilityMeasureSettings", "type": "object" }, "TimeSeriesXSigmaRhoMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "TimeSeriesXSigmaRho", "default": "TimeSeriesXSigmaRho", "title": "Type", "type": "string" }, "rescale_bench": { "default": true, "description": "Rescale the benchmark holdings to sum to the sum of the holdings.", "title": "Rescale Bench", "type": "boolean" }, "normalize_holdings": { "default": true, "description": "Make holdings sum to one.", "title": "Normalize Holdings", "type": "boolean" }, "analytics_space": { "default": "absolute", "description": "Compute the anlytics in `absolute` space, `active` space, or compute the analytics only on the `benchmark`.", "enum": [ "absolute", "active", "benchmark" ], "title": "Analytics Space", "type": "string" }, "backfill_holdings": { "default": false, "description": "Backfill the latest holdings, accounting for listing/delisting.", "title": "Backfill Holdings", "type": "boolean" } }, "title": "TimeSeriesXSigmaRhoMeasureSettings", "type": "object" }, "VolForecastMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "VolForecast", "default": "VolForecast", "title": "Type", "type": "string" }, "window": { "default": "6mo", "description": "The size of the rolling window", "title": "Window", "type": "string" }, "metric": { "default": "qlike", "description": "The metric to use", "enum": [ "qlike", "mse", "mae", "bias" ], "title": "Metric", "type": "string" }, "ddof": { "default": 1, "description": "The degrees of freedom to use for the stability", "title": "Ddof", "type": "integer" } }, "title": "VolForecastMeasureSettings", "type": "object" }, "XSigmaRhoMeasureSettings": { "additionalProperties": false, "properties": { "type": { "const": "XSigmaRho", "default": "XSigmaRho", "title": "Type", "type": "string" }, "rescale_bench": { "default": true, "description": "Rescale the benchmark holdings to sum to the sum of the holdings.", "title": "Rescale Bench", "type": "boolean" }, "normalize_holdings": { "default": true, "description": "Make holdings sum to one.", "title": "Normalize Holdings", "type": "boolean" }, "analytics_space": { "default": "absolute", "description": "Compute the analytics in `absolute` space, `active` space, or compute the analytics only on the `benchmark`.", "enum": [ "absolute", "active", "benchmark" ], "title": "Analytics Space", "type": "string" } }, "title": "XSigmaRhoMeasureSettings", "type": "object" } }, "additionalProperties": false }
- Config:
frozen: bool = True
extra: str = forbid
- Fields:
halflife_factor_adj (int | None)
halflife_factor_cor (int)
halflife_factor_vol (int)
halflife_idio_vol (int)
horizons (list[int])
measures (list[bayesline.api._src.equity.report_settings.PassThroughFactor2DMeasureSettings | bayesline.api._src.equity.report_settings.HoldingsMeasureSettings | bayesline.api._src.equity.report_settings.ExposureMeasureSettings | bayesline.api._src.equity.report_settings.XSigmaRhoMeasureSettings | bayesline.api._src.equity.report_settings.TimeSeriesXSigmaRhoMeasureSettings | bayesline.api._src.equity.report_settings.TimeSeriesBetaMeasureSettings | bayesline.api._src.equity.report_settings.HVaRMeasureSettings | bayesline.api._src.equity.report_settings.AVaRMeasureSettings | bayesline.api._src.equity.report_settings.TimeSeriesVolatilityMeasureSettings | bayesline.api._src.equity.report_settings.CumsumMeasureSettings | bayesline.api._src.equity.report_settings.DrawdownMeasureSettings | bayesline.api._src.equity.report_settings.MovingAverageMeasureSettings | bayesline.api._src.equity.report_settings.FactorMovingAverageMeasureSettings | bayesline.api._src.equity.report_settings.MovingAverageRSquaredMeasureSettings | bayesline.api._src.equity.report_settings.VolForecastMeasureSettings | bayesline.api._src.equity.report_settings.FactorVolForecastMeasureSettings | bayesline.api._src.equity.report_settings.FactorCovarianceMeasureSettings | bayesline.api._src.equity.report_settings.IdiosyncraticReturnMeasureSettings | bayesline.api._src.equity.report_settings.IdiosyncraticVolatilityMeasureSettings | bayesline.api._src.equity.report_settings.FactorIdioMeasureSettings | bayesline.api._src.equity.report_settings.ForecastBacktestMeasureSettings | bayesline.api._src.equity.report_settings.BrinsonAttributionMeasureSettings | bayesline.api._src.equity.report_settings.FactorAttributionMeasureSettings | bayesline.api._src.equity.report_settings.PortfolioStressTestMeasureSettings | bayesline.api._src.equity.report_settings.AssetStressTestMeasureSettings | bayesline.api._src.equity.report_settings.AssetHoldingsMeasureSettings])
overlap_factor_cor (int)
overlap_factor_vol (int)
overlap_factor_vol_halflife_override (int | None)
overlap_idio_vol (int)
overlap_idio_vol_halflife_override (int | None)
shrink_factor_cor_length (int | None)
shrink_factor_cor_method (Literal['LIS', 'QIS', 'GIS'] | None)
shrink_factor_cor_standardized (bool)
shrink_idio_vol (float)
type (Literal['Forecast Loss report'])
-
field measures:
list
[Union
[PassThroughFactor2DMeasureSettings
,HoldingsMeasureSettings
,ExposureMeasureSettings
,XSigmaRhoMeasureSettings
,TimeSeriesXSigmaRhoMeasureSettings
,TimeSeriesBetaMeasureSettings
,HVaRMeasureSettings
,AVaRMeasureSettings
,TimeSeriesVolatilityMeasureSettings
,CumsumMeasureSettings
,DrawdownMeasureSettings
,MovingAverageMeasureSettings
,FactorMovingAverageMeasureSettings
,MovingAverageRSquaredMeasureSettings
,VolForecastMeasureSettings
,FactorVolForecastMeasureSettings
,FactorCovarianceMeasureSettings
,IdiosyncraticReturnMeasureSettings
,IdiosyncraticVolatilityMeasureSettings
,FactorIdioMeasureSettings
,ForecastBacktestMeasureSettings
,BrinsonAttributionMeasureSettings
,FactorAttributionMeasureSettings
,PortfolioStressTestMeasureSettings
,AssetStressTestMeasureSettings
,AssetHoldingsMeasureSettings
]] [Optional]# The measures to include in the report.
-
field halflife_factor_adj:
int
|None
= None# The half-life for the factor adjustment. If None, no adjustment is applied.
-
field shrink_factor_cor_method:
Optional
[Literal
['LIS'
,'QIS'
,'GIS'
]] = None# The method to use for the shrinkage of the factor correlation. If None, don’t shrink.
-
field shrink_factor_cor_length:
int
|None
= 1008# If a shrinkage method is provided, the length of the shrinkage for the factor correlation.
-
field shrink_factor_cor_standardized:
bool
= False# If True, the correlation matrix is combined with an estimate based on the standardized returns. The halflife_factor_adj is used for the weights.
-
field overlap_factor_vol_halflife_override:
int
|None
= None# The halflife override for the factor volatility for lagged returns.