numeraire.WeightsOutput#

class numeraire.WeightsOutput(weights: DataFrame, realized: DataFrame, method: str, config_hash: str, data_vintage: str, run_id: str, capability: str = 'to_weights', meta: dict[str, ~typing.Any]=<factory>)[source]#

Bases: object

OOS output for a to_weights method: realized weights aligned with realized returns.

weights and realized are both (date x asset) indexed by the prediction dates, where realized.loc[t] is the return over (t, t+h] (so strategy_returns is the realized, no-look-ahead P&L of holding weights.loc[t] over that period).

__init__(weights: DataFrame, realized: DataFrame, method: str, config_hash: str, data_vintage: str, run_id: str, capability: str = 'to_weights', meta: dict[str, ~typing.Any]=<factory>) None#

Methods

__init__(weights, realized, method, ...)

strategy_returns()

Realized portfolio return per date: sum_a weights[a] * realized[a].

Attributes

capability

universe

Compact universe label (n=<#assets> for panels, the name for a single asset).

weights

realized

method

config_hash

data_vintage

run_id

meta

property universe: str#

Compact universe label (n=<#assets> for panels, the name for a single asset).

strategy_returns() Series[source]#

Realized portfolio return per date: sum_a weights[a] * realized[a].