Keyed dynamic universe

From microprediction/precise · View interactive version

Keyed dynamic universe is an AI agent skill from the GitHub repository microprediction/precise. Maintain an online covariance over named series whose set changes over time (e.g. assets entering and leaving). Use when observations arrive as dicts keyed by name rather than fixed-length vectors. Wraps precise's keyed / FixedUniverse / DynamicUniverse adapters.

How to use this skill

Skill file

Keyed covariance over a changing universe

In streaming/finance settings observations are dicts keyed by name, and the set of names changes. keyed

decorates any positional estimator to consume keyed dicts and emit keyed output.

pip install precise            # add [pandas] for to_frame()
from precise import keyed, EwaCovariance

est = keyed(EwaCovariance(r=0.05), dynamic=True)     # universe may change over time
est.partial_fit({"BTC": 0.01, "ETH": -0.02})         # river-style: also .update / .learn_one
est.partial_fit({"ETH": 0.00, "SOL": 0.03})          # BTC drops out, SOL enters

est.covariance_["ETH"]["SOL"]                         # dict-of-dicts over the live universe
est.to_frame()                                        # pandas DataFrame  (needs [pandas])

Fixed vs dynamic

Use when the set of names is stable and you just want dict ergonomics.

longevity eviction and assembles a pairwise matrix. Use when names genuinely enter and leave.

Notes

from the estimate-online-covariance skill works inside it (LedoitWolfCovariance, HuberCovariance,

…).

changes.

the score-covariance-estimate skill.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.