{"uid":"cap_R5ec-E018cS73qL1gU9hK","slug":"agent402-tools-pearson-correlation-319de8fa","name":"agent402.tools Pearson Correlation","description":"Pearson correlation coefficient between two equal-length numeric series. Returns r (the correlation, -1 to 1), r² (variance explained), n (sample size). Use this to ask things like: is a stock's daily return correlated with a macro indicator? Are two FRED series moving together?","url":"https://agent402.tools/api/correlation","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"x":{"type":"array","description":"First numeric series"},"y":{"type":"array","description":"Second numeric series (same length as x)"}}},"responseSchema":{"type":"json","example":{"n":5,"r":1,"rSquared":1,"interpretation":"perfect positive linear relationship"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_FxBax20cRunHP7ucFxLsH","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes the Pearson correlation coefficient (r), coefficient of determination (r²), and sample size (n) between two equal-length numeric arrays.","exampleAgentPrompt":"Can you calculate the Pearson correlation between these two series — x: [1.2, 2.5, 3.1, 4.8, 5.0] and y: [2.4, 4.9, 6.0, 9.7, 10.1] — and tell me the r value, r², and sample size?","exampleUseCases":null,"resultDescription":"Returns a JSON object with three fields: r (Pearson correlation coefficient, ranging -1 to 1), r² (proportion of variance in y explained by x), and n (number of data points used in the calculation).","failureModes":["Arrays x and y have different lengths — returns error","Non-numeric values in either array — returns error","Empty arrays provided — returns error or undefined result","Single-element arrays (n=1) — correlation undefined","All values in one series are constant (zero variance) — division by zero, returns error or NaN"],"whenToPreferThis":"Use this endpoint when you need a fast, cheap ($0.001 USDC) computation of Pearson correlation between two numeric series without setting up a local statistics library. Ideal for AI agents that need on-the-fly correlation checks in workflows involving financial data, scientific measurements, or any paired numeric datasets.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:14:07.213Z","isFirstParty":false}