MathOverflow is a question and answer site for professional mathematicians. 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

I'm programming an n-dimensional polynomial fitting function. It uses the basic concept of least squares and a design matrix.

For example, a quadratic fit on 2d data:

This is a row in the design Matrix:

$X={({1, x, x^2})}$

And this is the matrix formula I'm using:


This is nothing special or complicated.

I'm at the point however where I'd like to introduce confidence intervals. How do I compute the confidence intervals from this regression technique?

share|cite|improve this question

closed as off-topic by Ricardo Andrade, Stefan Kohl, quid, Chris Godsil, Yemon Choi Nov 9 '14 at 20:30

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "MathOverflow is for mathematicians to ask each other questions about their research. See Math.StackExchange to ask general questions in mathematics." – Ricardo Andrade, Yemon Choi
  • "This question does not appear to be about research level mathematics within the scope defined in the help center." – Stefan Kohl, Community, Chris Godsil
If this question can be reworded to fit the rules in the help center, please edit the question.

Normal equations, huh? If you're going to stick with that approach, please please hook up a condition estimator as a sanity check; this is the approach most sensitive to roundoff error. QR decomposition is often a better choice. As an aside, the variances of the parameters are usually obtained from the diagonal entries of the variance-covariance matrix $\left(\mathbf{X}^T\mathbf{X}\right)^{-1}$ ; I would suppose any expression for the CIs would involve these as well. – J. M. Sep 7 '10 at 9:11

A simple place to start: Look at the residues when you subtract out your putative function from your data set. A perfect fit (for a very small dataset, or a very perfectly quadratic dataset) will have residues of zero and a correlation coefficient that you can calculate. A bad but "middling" best-fit will have residues equally distributed in the positive and negative $y$-axis. A bad quadratic fit will skew positive on one side and negative on the other side, or positive in the middle and negative on the ends or vice versa. A better fit will have smaller residues.

share|cite|improve this answer

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