kelly_rank_boxcox
kelly_rank_boxcox(source, window, lambda_=0, name=None, metadata=None)
Rank to positive values, apply Box-Cox, then estimate Kelly.
Parameters
- source : Panel | Graph
- Input numeric
Panelor single-outputGraph. window : int - Positive trailing-window length in rows.
lambda_ : float, default
0 - Box-Cox lambda parameter. Use
0for the logarithmic limit. name : str | None, defaultNone - Optional graph-node name. A generated name is used when omitted.
metadata : Mapping[str, Any] | None, default
None - Optional metadata stored on the graph node.
Returns
- Graph
- Lazy single-output graph. Call
.compute()to materialize aPanel.
Examples
import pandas as pd
from bagelquant_core import Domain, Panel
from bagelquant_core.transformer import kelly_rank_boxcox
domain = Domain(calendar=pd.to_datetime(["2024-01-02", "2024-01-03", "2024-01-04"]), universe=["a", "b"])
source = Panel.from_domain(pd.DataFrame({"a": [1.0, 2.0, 4.0], "b": [2.0, 3.0, 8.0]}, index=domain.sessions), domain)
result = kelly_rank_boxcox(source, window=2).compute().data
print(result)
Notes
Rows represent time and columns represent assets.