# Linear regression model is linear in inputs or linear in terms of its optimization function that is minimized to learn the weights?

In various literature i have seen both being claimed and now i am confused which one is true ?

The one that says linear in terms of weights claims that one can simply add higher order terms for the inputs and still learn non linear models while optimization problem remains linear in terms of weights.

There are other that claim it is linear in terms of inputs.

Can someone clarify on this ?

Following is what is given in Elements of Statistical Learning : Recall that linearity is defined as following. Function $f$ is linear if

$$f(\alpha x+\beta y)=\alpha f(x)+\beta f(y),$$

where $f$, $\alpha,\beta$ and $x,y$ are such that this equation makes sense.

The linear regression model is defined as

$$y_i=\sum_{i=1}^p\alpha_i x_i+\varepsilon_i,$$

which we can write as

$$y_i=f(x_1,...,x_p)+\varepsilon_i=g(x_1,...,x_p,\varepsilon_i).$$

Both $f$ and $g$ are linear functions.

Now the optimisation function for the linear regression is

$$c(\alpha_1,...,\alpha_p)=\sum_{i=1}^n(y_i-f(x_1,...,x_p))^2.$$

It is not a linear function.

Hope this clarifies things a bit.

• please check the edit – Siddharth Shakya May 24 '17 at 6:40