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.
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.$$