How microprediction/allocation works
allocation is a Python library for online portfolio construction, exposing batch-style estimators and keyed streaming counterparts for changing asset universes. The main workflow accepts return observations, estimates covariance, computes portfolio weights, and updates those weights as new data arrives. Major method families include baselines and convex allocators, Schur/HRP bridges, and Thurstone ability tilts. The graph follows documented behavior and sampled source references; unsampled estimator internals and optional integrations are represented only where the README supports them.
Main entry points: base.py Portfolio weights · thurstone.py Thurstone portfolio · keyed.py Keyed streaming · bridge.py Schur bridges
Components 16
Estimator API
- Batch estimators
allocation/base.py - Covariance estimates
allocation/moments.py - Portfolio weights
allocation/base.py
Allocation Methods
- Baselines and ERC
allocation/baselines.py - Convex allocators
allocation/convex.py - Schur and HRP
allocation/schur.py - Schur bridges
allocation/bridge.py - Thurstone portfolio
allocation/thurstone.py
Streaming Universe
- Keyed streaming
allocation/keyed.py - Universe mapping
allocation/universe.py
Method Internals
- Ability calibration
allocation/_thurstone/calibrate.py - Correlation preparation
allocation/_thurstone/covariance.py - Race transport
allocation/_thurstone/transport.py - Fiedler seriation
allocation/_schur/seriation.py - Schur conditioning
allocation/_schur/bridge.py
Other components
- Portfolio user
Connections 20
- Portfolio user → Batch estimators: fits returns
- Batch estimators → Covariance estimates: updates covariance
allocation/base.py - Batch estimators → Portfolio weights: produces weights
allocation/base.py - Portfolio user → Keyed streaming: streams observations
- Keyed streaming → Universe mapping: handles changing IDs
- Keyed streaming → Fiedler seriation: orders assets
allocation/keyed.py - Keyed streaming → Covariance estimates: updates covariance
allocation/keyed.py - Baselines and ERC → Portfolio weights: allocates weights
allocation/baselines.py - Convex allocators → Portfolio weights: optimizes weights
allocation/convex.py - Schur and HRP → Fiedler seriation: uses Fiedler order
- Schur and HRP → Portfolio weights: allocates weights
- Schur bridges → Schur conditioning: uses conditioning
allocation/bridge.py - Schur bridges → Fiedler seriation: partitions assets
allocation/bridge.py - Schur bridges → Portfolio weights: bridges portfolios
allocation/bridge.py - Thurstone portfolio → Ability calibration: calibrates abilities
allocation/thurstone.py - Thurstone portfolio → Correlation preparation: prepares correlation
allocation/thurstone.py - Thurstone portfolio → Race transport: transports race
allocation/thurstone.py - Thurstone portfolio → Portfolio weights: returns win weights
allocation/thurstone.py - Ability calibration → Correlation preparation: uses correlation tools
allocation/_thurstone/calibrate.py - Race transport → Correlation preparation: uses matrix utilities
allocation/_thurstone/transport.py