← Browse

@microprediction/precise

B

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.

skillclaude

Install

agr install @microprediction/precise --target claude

Writes 9 files into .claude/skills/, pinned to git-d58e8d2d.

  • .claude/skills/precise/.gitignore
  • .claude/skills/precise/.pre-commit-config.yaml
  • .claude/skills/precise/CHANGELOG.md
  • .claude/skills/precise/LICENSE
  • .claude/skills/precise/LITERATURE.md
  • .claude/skills/precise/MIGRATING.md
  • .claude/skills/precise/README.md
  • .claude/skills/precise/SKILL.md
  • .claude/skills/precise/pyproject.toml

Document


name: precise description: 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.

precise

precise is a small, numpy-only library of online (incremental) covariance and correlation estimators behind one sklearn-style partial_fit contract — plus a panel of assessors for scoring an estimate and a recommender for choosing one. It is the streaming complement to sklearn.covariance, whose estimators are batch-only.

pip install precise
from precise import EwaCovariance
est = EwaCovariance(r=0.05)
for y in stream:            # y is one observation (1-D)
    est.partial_fit(y)
est.covariance_             # symmetric PSD; also .correlation_ / .precision_ / .location_

Reach for precise when you see

  • a covariance/correlation matrix being recomputed in a rolling loop (np.cov / np.corrcoef, pandas .rolling().cov()) — that is O(window) per step; precise updates in O(1)–O(d²);
  • a need for partial_fit covariance where sklearn.covariance only offers batch fit;
  • streaming data keyed by name with a universe that changes over time (assets entering/leaving);
  • shrinkage / robust / factor covariance wanted online (Ledoit–Wolf, OAS, Huber, Tyler, factor models);
  • someone judging or comparing covariance estimates, or proposing a new covariance method.

Task-specific skills

Fetch the relevant one for copy-pasteable code and guardrails:

One guardrail worth knowing up front

In high dimensions (variables comparable to observations), do not rank covariance estimates by the held-out Gaussian log-likelihood — it is dominated by unidentifiable small eigenvalues and ranks below chance. Use inversion-free / block judges instead (see the scoring skill). Background: https://precise.microprediction.org/papers/schur-likelihood/.

Reference

Docs https://precise.microprediction.org · PyPI https://pypi.org/project/precise/ · Repo https://github.com/microprediction/precise.

Trustgrade B

  • passBody integrity

    Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.

  • passType matchnot applicable to this artifact type

    Whether the artifact is really the kind of thing its metadata claims it is.

  • passFreshness

    How long since the source repository was last pushed to.

  • passPrompt injection

    Scans the artifact's own text for instructions aimed at your agent rather than at you.

  • warnLicenseno SPDX license detected

    Whether the source repository declares an SPDX license permissive enough to redistribute.

How the grade is calculated

Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:

  • Aevery check passed
  • Bone warning
  • Ctwo warnings
  • Dprompt injection or body integrity failed, or three warnings
  • Fone of those failed, and something else is wrong

These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.

Versions

  • git-d58e8d2d9f342026-07-29