Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know the specific equations for the three parameters in a least-squares quadratic regression? I'm looking for something like $\beta_1=,\beta_2=,\beta_3=$ for each of $y=\beta_1+\beta_2x+\beta_3x^2$. To be clear, the right side of each of these equations should be evaluateable, using the data, to find the parameter. I was able to find the equations for linear regression on line, but google hasn't turned anything up for this.

Thanks in advance

share|cite|improve this question
It is more likely to be numerically efficient and less prone to round-off error if you solve the appropriate linear system, rather than search for explicit formulae for the coefficients. – Daryl Dec 31 '12 at 12:45
as a note - there is a stats-specific SE too, you can try there as well – jaska Jan 20 at 3:19
up vote 2 down vote accepted

For $y =\beta_1 +\beta_2 x +\beta_3 x^2$, let's define $$x_1 = x$$ and $$x_2= x^2.$$ Now we can use the equations of multiple linear regression: $$S_{11}= \sum_{n=1}^N x_1^2- \frac{(\sum_{n=1}^N x_1)^2}{N}$$ $$S_{12}= \sum_{n=1}^N x_1x_2- \frac{(\sum_{n=1}^N x_1\sum_{n=1}^N x_2)}{N}$$ $$S_{22}= \sum_{n=1}^N x_2^2- \frac{(\sum_{n=1}^N x_2)^2}{N}$$ $$S_{y1}= \sum_{n=1}^N y x_1- \frac{(\sum_{n=1}^N y\sum_{n=1}^N x_1)}{N}$$ $$S_{y2}= \sum_{n=1}^N y x_2- \frac{(\sum_{n=1}^N y\sum_{n=1}^N x_2)}{N}$$ $$\overline{x}_1 = \frac{(\sum_{n=1}^N x_1)}{N}$$ $$\overline{x}_2 = \frac{(\sum_{n=1}^N x_2)}{N}$$ $$\overline{y} = \frac{(\sum_{n=1}^N y)}{N}$$ $$\beta_2=\frac{S_{y1}S_{22}-S_{y2}S_{12}}{S_{22}S_{11}-S_{12}^2}$$ $$\beta_3=\frac{S_{y2}S_{11}-S_{y1}S_{12}}{S_{22}S_{11}-S_{12}^2}$$ $$\beta_1=\overline{y}-\beta_2\overline{x}_1-\beta_3\overline{x}_2$$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.