Linear functions of several variables
A
linear function of two variables has the form
$f(x,y) = a + bx + cy. \quad \qquad$
\t
Using subscripted variables, we can write instead
$f(x_1,x_2) = a_0 + a_1x_1 + a_2x_2.$
\t
We extend this idea to any number of variables as follows:
#[Linear function of 3 variables][Función lineal de 3 variables]#: \\ $f(x_1,x_2,x_3) = a_0 + a_1x_1 + a_2x_2 + a_3x_3\qquad$ \t
\\ ...
\\ #[Linear function of n variables][Función lineal de n variables]#:
\\ $f(x_1,x_2,...,x_n) = a_0 + a_1x_1 + a_2x_2 + ... + a_nx_n\qquad$ \t
#[Examples][Ejemplos]#
1. $f(x,y) = 3x+y - 4$ \t
\\ 2. $f(x,y,z,t) = -x+y-4t+10 \qquad$ \t
\\ 3. $f(x,y,z,t,w) = 4$ \t
\\ 4. $f(x,y) = 4+2x\color{darkred}{+y^2}$ \t
\\ 5. $f(x,y) = 4+2x+y\color{darkred}{-3xy}$ \t
#[
Notes- Second-order terms involve products of unknowns with a total power of 2, like $x^2$ or $xy$. Similarly, third-order terms would involve products of unknowns with a total power of 3, like $x^3, x^2y$ or $xyz.$
- Terms like $xy, xy^2,$ and $xyz$ are also referred to as interaction terms, as they involve more than one variable.
- Interaction terms for linear models would be products of single variables, like $xy$ and $xyz$. Interactive terms for quadratic models could involve powers of variables up to 2, like $x^2y$, $x^2y^2$, or $x^2y^2z^2,$
][
NotasLos términos de segundo orden implican productos de incógnitas con una potencia total de 2, como $x^2$ o $xy$. De manera similar, los términos de tercer orden involucrarían productos de incógnitas con una potencia total de 3, como $x^3, X^2y$ o $xyz.$Términos como $xy, xy^2$ y $xyz$ también se conocen como términos de interacción, ya que involucran más de una variable.Los términos de interacción para modelos lineales serían productos de variables individuales, como $xy$ y $xyz$. Los términos interactivos para modelos cuadráticos podrían involucrar potencias de variables hasta 2, como $x^2y$, $x^2y^2$ o $x^2y^2z^2,$]#
Adding interaction terms
In statistical modeling using functions of several variables, interaction terms are often added to obtain a more accurate model.
#[Examples][Ejemplos]#
5. $f(x,y) = 4+2x+y-3xy$ \t
\\ 6. $f(x,y,z) = -x+2xy - xz + xyz \qquad$ \t
%%Note #[Interction terms are nonlinear terms in a model, so linear model with added interaction terms is no longer linear.][Los términos de interacción son términos no lineales en un modelo, por lo que un modelo lineal con términos de interacción agregados ya no es lineal.]#
Quadratic functions of several variables
A
quadratic function of two variables is a nonlinear function of the form
$f(x,y) = a + b_1x + b_2y + c_1x^2 + c_2y^2 + dxy \qquad$ \t
(#[Being nonlinear amounts to saying that at least one of the
second-order terms $c_1x^2,\ c_2y^2,\ dxy$ is nonzero (otherwise we would get a linear function).][Ser no lineal equivale a decir que al menos uno de los
términos de segundo orden $c_1x^2,\ c_2y^2,\ dxy$ es distinto de cero (de lo contrario, obtendríamos una función lineal).]#)
#[Examples][Ejemplos]#
#[Examples 4 and 5 above are quadratic whereas Examples 1–3 above are linear (and thus not quadratic). Example 6 above is neither linear nor quadratic, as it contains a
third-order term $xyz.$ That model is an example of a
cubic model.][El ejemplos 4 y 5 anterior son cuadráticos, mientras que los ejemplos 1 a 3 anteriores son lineales (y, por lo tanto, no cuadráticos). El ejemplo 6 anterior no es lineal ni cuadrático, ya que contiene un término de
tercer-orden $xyz.$ Ese modelo es un ejemplo de modelo
cúbico.]#