Retrieval
Pearson correlation API
Returns the Pearson correlation coefficient plus means, covariance and a strength label for two equal-length vectors. Answers 'How correlated are these two vectors?', 'What is the Pearson r between a and b?'.
Price$0.01per request
MethodPOST
Route/v1/retrieval/pearson-correlation
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
pearsoncorrelationcovariancevectorstatisticssimilarityretrievalrag
API URL
Integration docshttps://x402.hexl.dev/v1/retrieval/pearson-correlationExample request
{
"a": [
1,
2,
3,
4
],
"b": [
2,
4,
5,
8
]
}Example response
{
"pearson": 0.98115578,
"meanA": 2.5,
"meanB": 4.75,
"covariance": 2.375,
"n": 4,
"interpretation": "strong",
"formula": "cov(a,b) / (std(a)*std(b))"
}Input schema
{
"type": "object",
"required": [
"a",
"b"
],
"properties": {
"a": {
"type": "array",
"items": {
"type": "number"
}
},
"b": {
"type": "array",
"items": {
"type": "number"
}
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}