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

Given a set of points, I'm looking to find the best possible line (within reason) to fit to these points. These points won't be from real data, so they could form any sort of curve or line. So, I would like to find the regression with multiple different types of lines, and see which one matches best. For example, I would like to do regression for linear, polynomial, exponential, logarithmic, etc. If possible, I would love to have polar or radial regression (if those even exist).

I have googled for all these different types, and I have found no results for many of them. How much of this is possible? For the ones that are possible, please point me to some links online about how to do them. Thanks!

**EDIT: the purpose of this will be to provide a general tool for finding a good model for ANY shape, not just gathered data. So There are really no constraints, I would just like to find the one with the closest possible correlation.

share|cite|improve this question
"Within reason" is vague at least until one knows what your purpose is, and possibly something about how the data are generated. "Best possible" is also vague if one doesn't know the purpose. Certainly ordinary least squares regression with predictors that are polynomials or other non-affine functions can all come under the heading of "linear regression". But there is also nonlinear regression, and there are things like generalized linear models. – Michael Hardy Dec 20 '12 at 2:03
@MichaelHardy I have edited the question, hopefully it is clearer now. Sorry if it isn't; I'm not sure how else to explain it. Thanks. By within reason, I just meant I am not seeking any amazing accuracy, just a "pretty good" general purpose fit that makes sense to the human eye as fitting the points. – Vishnu Dec 20 '12 at 2:15
If you have only one $y$ value for each $x$ value, then you can always find a polynomial that fits perfectly. But that is in many contexts unreasonable: it may be that all deviations from a straight line are due to noise. – Michael Hardy Dec 20 '12 at 4:25

Your Answer


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

Browse other questions tagged or ask your own question.