Skip to content
cccskills
FreePublished on GitHub

keyed-dynamic-universe

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.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md2.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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

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

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Rigorously and honestly assess a NEW or proposed covariance / correlation / precision estimator, or a new covariance scoring rule, using precise. Use when someone proposes, asks to evaluate, or wants to compare a covariance methodology. Covers implementing it to the contract, conformance, benchmarking against the registry, out-of-sample validation, and statistically defensible inference.

The English summary is being prepared. Showing the original description.

microprediction/precise337Updated Oct 6, 2026

Pick which precise covariance estimator to use for a given dataset. Use when you have data X and are unsure which estimator fits its dimension, conditioning, or tail behavior. Wraps precise.suggest() and covariance_features().

The English summary is being prepared. Showing the original description.

microprediction/precise337Updated Oct 6, 2026

Estimate a covariance / correlation / precision matrix incrementally with precise. Use when data arrives as a stream and you want the matrix updated per observation, or when you want an online (partial_fit) drop-in for sklearn.covariance, which is batch-only.

The English summary is being prepared. Showing the original description.

microprediction/precise337Updated Oct 6, 2026

Online (incremental) covariance, correlation, and precision estimation in Python — the streaming complement to sklearn.covariance. Use when code needs a covariance/correlation matrix updated per observation, recomputes np.cov/np.corrcoef in a rolling loop, must judge or compare covariance estimates, or proposes a new covariance methodology. Points to task-specific skills.

The English summary is being prepared. Showing the original description.

microprediction/precise337Updated Oct 6, 2026

Score and compare covariance estimates with precise's assessor panel. Use when you need to judge an estimate out-of-sample or rank competing estimators — and especially in high dimensions, where the plain held-out likelihood is misleading.

The English summary is being prepared. Showing the original description.

microprediction/precise337Updated Oct 6, 2026

See all skills by microprediction

Report a problem with this skill