# Portfolio Stats: Correlation, Beta, R-Squared & Alpha

> Portfolio Stats: Correlation, Beta, R-Squared & Alpha is a paid API for AI agents from portfolio-stats.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-30).

Computes correlation, beta, R-squared, covariance, and annualized alpha of one asset return or price series against a benchmark series.

## Facts

- Endpoint: GET https://portfolio-stats.x402tookit.com/correlation-beta?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/portfolio-stats-correlation-beta-r-squared-alpha-e9085f56
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Z8Vtx3jhPyYN_UEL6rdsd

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability portfolio-stats-correlation-beta-r-squared-alpha-e9085f56
```

Example prompt: Can you calculate the correlation, beta, and annualized alpha of this asset return series [0.01, -0.02, 0.03, 0.015, -0.005] against this benchmark series [0.008, -0.015, 0.025, 0.01, -0.003], treating them as decimal returns with 252 periods per year?

## When to prefer this

Choose this endpoint when you need a comprehensive set of linear regression statistics (correlation, beta, R-squared, alpha) between two return or price series in a single call. Prefer it over volatility-only or Sharpe-only endpoints when benchmark-relative analysis is the goal. Ideal for portfolio attribution, factor exposure measurement, or strategy evaluation against a market index.

## Known failure modes

- Series length mismatch between 'a' and 'b' — returns error or null statistics
- Fewer than ~5 observations triggers lowSample flag and unreliable estimates
- Invalid JSON formatting of the series arrays causes parse errors
- Zero-variance benchmark causes division-by-zero for beta/R-squared
- Mismatched 'kind' or 'unit' parameters relative to actual data produce misleading results
- Payment failure (x402) blocks the request before computation

## How this service works

Correlation, beta, R-squared and alpha of one return or price series against another you supply. Not advice.

## Output

Returns a JSON object containing: correlation coefficient, beta, R-squared, alpha per period, annualized simple alpha percentage, covariance, per-period volatility for both series, number of observations, and flags for low sample size or degraded quality. Also includes a summary string, disclaimer, and educational-only notice.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "a",
      "b"
     ],
     "properties": {
      "a": {
       "type": "string",
       "description": "Asset series, oldest first, JSON like [0.01,-0.02,0.03] or 0.01,-0.02,0.03"
      },
      "b": {
       "type": "string",
       "description": "Benchmark series, same length as a"
      },
      "kind": {
       "type": "string",
       "description": "returns (default) or prices: what a and b contain"
      },
      "unit": {
       "type": "string",
       "description": "decimal (default) or percent; applies when kind is returns"
      },
      "periodsPerYear": {
       "type": "integer",
       "description": "Periods per year for annualising alpha (default 252)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "beta": {
       "type": [
        "null",
        "number"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "rSquared": {
       "type": [
        "null",
        "number"
       ]
      },
      "inputKind": {
       "type": [
        "null",
        "string"
       ]
      },
      "lowSample": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "covariance": {
       "type": [
        "null",
        "number"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecke
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/portfolio-stats-correlation-beta-r-squared-alpha-e9085f56/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from portfolio-stats.x402tookit.com](https://www.zero.xyz/host/portfolio-stats.x402tookit.com/llms.txt)
