# Covariance

> This skill should be used when the user asks to "estimate a covariance matrix", "run Ledoit-Wolf shrinkage", "build an EWMA covariance", or validate PSD risk inputs for portfolio construction.

- **Type:** Skill
- **Install:** `agentstack add skill-nutdnuy-self-driving-portfolio-skill-covariance`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [nutdnuy](https://agentstack.voostack.com/s/nutdnuy)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [nutdnuy](https://github.com/nutdnuy)
- **Source:** https://github.com/nutdnuy/self-driving-portfolio-skill/tree/main/skills/covariance

## Install

```sh
agentstack add skill-nutdnuy-self-driving-portfolio-skill-covariance
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# covariance

Covariance estimation for the SAA pipeline.

## Methods

| `method`        | Description |
| --------------- | --- |
| `sample`        | Plain MLE; use only when T ≫ N. |
| `ewma`          | Exponentially-weighted, λ=0.94 (RiskMetrics-style). |
| `ledoit_wolf`   | Linear shrinkage toward a constant-correlation target. **Default.** |

All matrices are returned **annualised** (×252 for daily inputs).

Require at least 60 complete aligned return rows. Symmetrise each estimate and
clip non-positive eigenvalues to a scale-aware floor. Record the original
minimum eigenvalue, repair flag, condition number, aligned sample size, and
missing-data fraction. Treat repair as numerical stabilization, not economic
validation.

## CLI

```bash
python skills/covariance/scripts/build_cov.py \
       --tickers SPY,EFA,EEM,IEF,LQD,TIP,GLD,VNQ,BIL \
       --method ledoit_wolf \
       --as-of 2026-05-08 \
       --out outputs/demo01/covariance.json
```

Run through `pipeline/orchestrator.py` for schema gating and governed output.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [nutdnuy](https://github.com/nutdnuy)
- **Source:** [nutdnuy/self-driving-portfolio-skill](https://github.com/nutdnuy/self-driving-portfolio-skill)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-nutdnuy-self-driving-portfolio-skill-covariance
- Seller: https://agentstack.voostack.com/s/nutdnuy
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
