4

Say that your input variables are in $\mathbb{R}^2$ with a univariate output variable. Say that you want to determine whether the output variable is a linear combination of the input variables. If you just had one input variable you could easily just graph input vs output and see how linear the relationship is. But if you have two input variables I don't think that you can simply say that that

$y$ is a linear combination of $x_1$ and $x_2$ iff $x_1$ vs $y$ is linear and $x_2$ vs $y$ is linear.

It seems like the reverse should be true, but I'm not sure if the forward argument is valid. e.g. you could have two non-linear polynomials whose linear combination is linear (couldn't you?)

I suppose I could just fit a linear model and look at the residuals, but I was wondering if there was a more a priori approach to determining linearity (i.e. some sort of visualization).

user1893354
  • 1,435
  • 4
  • 15
  • 25
  • 2
    Let $f$ and $g$ be functions such that $f(x)+g(y)=ax+by+c$ for all $x$ and $y$ and some constants $a, b,$ and $c$: that is what it means for the sum to be linear. Because the rhs is differentiable in $x$ and $y$, we can differentiate the lhs, giving $f'(x)=a$ and $g'(y)=b$. Integrating yields $f(x)=ax+d$ and $g(y)=by+e$ for constants $d$ and $e$. (Comparing to the rhs shows $d+e=c$.) Therefore *whether $f$ and $g$ are assumed to be polynomials or any kind of function at all,* they must be linear if their sum is linear. – whuber Sep 12 '13 at 16:13
  • If you only have two input variables you could do a surface plot, and see if the $y$ values could be approximated by a plane. If you have more than two this isn't possible though. – Sam Livingstone Sep 12 '13 at 16:49
  • @Whuber why not make that an answer rather than a comment? –  Sep 12 '13 at 16:58
  • whuber. you are right. Since each individual function is a function of only 1 variable, it would be impossible for the non-linear terms to cancel when the two functions are added. – user1893354 Sep 12 '13 at 17:06
  • @BabakP I did not post the comment as an answer because it addresses only an incidental aspect of the question and I'm not sure what the question is really trying to ask. My comment deals with a purely mathematical issue but because the question appeared on this site I have to presume it is really inquiring about issues of near-linearity or goodness of fit in a linear regression. – whuber Sep 12 '13 at 17:12
  • So I guess what I can conclude from this is if all of the input variables are individually linear wrt the output variable, then the output variable is a linear combination of the inputs (obvious). Also, if any of the input variables are non-linear wrt the output variable, you cannot. I thought there may have existed a counter-example to disprove this but I know now that there isnt (assuming the input variables are independent). – user1893354 Sep 12 '13 at 17:25

0 Answers0