sector_correlation
Compute correlation matrix between sectors of your portfolio to assess diversification and concentration risk. Each sector becomes a weighted return series built from its members.
Instructions
Compute the correlation matrix between sectors of a portfolio you supply.
Use this to answer how diversified a book actually is — "are my sectors moving together", "where is the concentration risk". Each sector becomes a single weighted return series built from its members, and the tool correlates those series against each other.
Every holding needs a sector label; holdings without one are ignored. Weights are
used to size members within their sector and default to equal weighting. As with
every tool here, you supply the portfolio — nothing is looked up.
A correlation can legitimately come back null: if a sector's members offset each other exactly, its series has no variance and correlation against it is undefined rather than zero.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| holdings | Yes | ||
| lookback_days | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | Yes | ||
| start | Yes | ||
| matrix | Yes | Correlation of each sector's weighted return series against every other. | |
| sectors | Yes | ||
| observations | Yes |