Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

What is the optimal linear regression (w and w/o y-intercept) for a quadratic curve w.r.t. mean square error.

Mathematically speaking:

Given,

$$y = x^2$$

for

$$x = [-a,a]$$.

What is the best approximation for straight line equations of the form.

$$y = \alpha x$$

and

$$y = \alpha x + \beta$$.

cftool in MATLAB can solve it numerically, but I had rather have a closed form analytical solution if it exists.

share|improve this question
    
Since $y=\alpha x$ is a subset of $y=\alpha x+\beta$ (set $\beta=0$), you would naturally choose this unless you had a good reason to specify that the line must pass through the origin. –  Daryl Mar 9 '13 at 9:43
    
I need it to pass through the origin –  aiao Mar 9 '13 at 9:44
    
I don't have the time to verify, but because your actual function is even $(x^2)$ and the approximation is the odd function $y=\alpha x+\beta$, you should always find that $\alpha=0$. I cannot verify that claim at the moment however. –  Daryl Mar 9 '13 at 9:50

2 Answers 2

up vote 2 down vote accepted

How do you measure error? Do you want to do a least squares fit? Then you have to minimize

$$\int_{-a}^a(x^2-(\alpha x+\beta))^2dx$$

which can easily be done by solving the below system for $\alpha$ and $\beta$

$$\frac{\partial}{\partial \alpha}\int_{-a}^a(x^2-(\alpha x+\beta))^2dx=0$$ $$\frac{\partial}{\partial \beta}\int_{-a}^a(x^2-(\alpha x+\beta))^2dx=0.$$

share|improve this answer
    
lower limit of integral should be $-a$ :) –  Aang Mar 9 '13 at 10:26
    
Of course, ;-) otherwise the answer is REALLY easy. –  Fixed Point Mar 9 '13 at 10:45

It would be the line $y=\alpha x$ such that $$\int_{-a}^a\big|x^2-\alpha x\big|dx$$ is minimum

share|improve this answer

Your Answer

 
discard

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.