Correlación (Pearson, Spearman)
stats-correlationMide cómo se mueven juntas dos series de igual longitud: coeficiente de Pearson (lineal), de Spearman (por rangos, menos sensible a valores atípicos) y covarianza. Cuándo: un resultado numérico tiene que ser exacto o reproducible y no estimado. No para: calcular el ajuste por mínimos cuadrados y = pendiente·x + intercepto, con R² y predicciones (stats-regression). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.
EN: Measures how two equal-length series move together: the Pearson coefficient (linear), the Spearman coefficient (rank-based, less sensitive to outliers) and the covariance. When: a numeric result has to be exact or reproducible instead of estimated. Not for: least-squaring fit y = slope·x + intercept with R², standard error, and optional predictions for new x values (stats-regression). [EN completo / full EN: inputSchema.description]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | X values (array of number; required; at least 2 items). | |
| y | Yes | Y values (array of number; required; at least 2 items). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | ||
| pearson | No | ||
| spearman | No | ||
| covariance_sample | No |