Skip to content
Back to skills

Keyed Dynamic Universe

ASecurity

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.

  • 334 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 1, 2026
developmentpythongobash

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned September 1, 2026

npx -y skills add microprediction/precise --skill keyed-dynamic-universe --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Keyed Dynamic Universe?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Keyed Dynamic Universe
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/microprediction-keyed-dynamic-universe/badge)](https://www.skillsdirectory.com/skills/microprediction-keyed-dynamic-universe)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: keyed-dynamic-universe
description: 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.
---

# 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.

```bash
pip install precise            # add [pandas] for to_frame()
```

```python
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

- `keyed(est)` / `dynamic=False` → **FixedUniverse**: one wrapped estimator; missing keys are imputed.
  Use when the set of names is stable and you just want dict ergonomics.
- `keyed(est, dynamic=True)` → **DynamicUniverse**: tracks multiple live key-sets with staleness /
  longevity eviction and assembles a pairwise matrix. Use when names genuinely enter and leave.

## Notes

- The adapter adds **no covariance math of its own** — it wraps the positional estimator, so any estimator
  from the **estimate-online-covariance** skill works inside it (`LedoitWolfCovariance`, `HuberCovariance`,
  …).
- The assembled matrix is projected to the nearest PSD; expect small adjustments when the live universe
  changes.
- To score/compare keyed estimators, extract the dense `covariance_` (e.g. via `to_frame().values`) and use
  the **score-covariance-estimate** skill.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.