Skip to content
Fourohtwo

www.brainiac.software/api/v1/portfolio-analytics/correlation-matrix

Pearson and Spearman correlation, optional covariance, rolling windows and Ledoit-Wolf shrinkage covariance from caller series. Docs: https://www.brainiac.software/api/portfolio-analytics/correlation-matrix

BaseAnswering
POSThttps://www.brainiac.software/api/v1/portfolio-analytics/correlation-matrix

Uptime100% of 3 checks in 30 days

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

// npm install fourohtwo
import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://www.brainiac.software/api/v1/portfolio-analytics/correlation-matrix", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"methods":["pearson","spearman","ledoit_wolf"],"missing":"pairwise","rollingWindow":null,"series":{"A":[0.02,-0.01,0.03,-0.04,0.015,0.01,-0.02,0.025,0.005,-0.015,0.03,0.01],"B":[0.025,-0.012,0.035,-0.045,0.018,0.012,-0.021,0.028,0.007,-0.016,0.033,0.013],"C":[0.005,0.002,-0.003,0.004,-0.001,0,0.003,-0.002,0.001,0.002,-0.004,0.001]}}),
});
console.log(await res.json());

Example input

{
  "methods": [
    "pearson",
    "spearman",
    "ledoit_wolf"
  ],
  "missing": "pairwise",
  "rollingWindow": null,
  "series": {
    "A": [
      0.02,
      -0.01,
      0.03,
      -0.04,
      0.015,
      0.01,
      -0.02,
      0.025,
      0.005,
      -0.015,
      0.03,
      0.01
    ],
    "B": [
      0.025,
      -0.012,
      0.035,
      -0.045,
      0.018,
      0.012,
      -0.021,
      0.028,
      0.007,
      -0.016,
      0.033,
      0.013
    ],
    "C": [
      0.005,
      0.002,
      -0.003,
      0.004,
      -0.001,
      0,
      0.003,
      -0.002,
      0.001,
      0.002,
      -0.004,
      0.001
    ]
  }
}