stats_polynomial-regression
Fit polynomial regression models of specified degree, returning coefficients, R², fitted values, and residuals.
Instructions
Polynomial regression of degree n with goodness-of-fit metrics.
Use when fitting a polynomial of degree n to data. Provide x, y arrays, and degree. Returns: coefficients, R², fitted values, and residuals.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | Independent variable array | |
| y | Yes | Dependent variable array | |
| degree | No | Polynomial degree (1=linear, 2=quadratic, etc.) |