Skip to main content
Version: v5

correlation_matrix

Build a point-in-time correlation matrix across every symbol in the input.

Parameters​

data: Data | DataFrame | Series | dict | list | list[DataFrame] | list[Data] | list[Series] | ndarray
Long-format multi-symbol price data with a symbol column.

index: str
Default: date
Index column name in data.

target: str
Default: close
Column to correlate.

window: int
If set, restrict correlation to the trailing window rows before as_of_date. None uses every available row.

method: str
Default: pearson
Correlation method, by default "pearson".

as_of_date: date | datetime | str
Anchor date for the snapshot. None uses the last available row in the input.


Returns​

results: list[CorrelationMatrixData]

Serializable results.

provider: str

Provider name.

warnings: Optional[list[Warning_]]

List of warnings.

chart: Optional[Chart]

Chart object.

extra: dict[str, Any]

Extra info.


Data​

as_of_date: date | datetime | str
Anchor date used for the snapshot.

symbols: list[str]
Symbols, in matrix order.

matrix: list[list[float]]
Correlation values.