concept equation in category R

appears as: equations, equation, The equation, equation, n equation
Machine Learning with R, the tidyverse, and mlr

This is an excerpt from Manning's book Machine Learning with R, the tidyverse, and mlr.

Mathematical notation can look intimidating to those not formally trained in its use. But mathematical notation is really there to make our lives easier. While there are some equations in this book, not one of them uses anything more complicated than addition, subtraction, multiplication, and division. I do, however, use one symbol that makes my life a lot easier; and once you get the hang of it, it will make your life easier too (and make lots of equations seem less impenetrable). That symbol is the capital Greek letter sigma, which looks like a strange “E” (Σ).

In equations, capital sigma simply means to sum whatever is on the right-hand side of it. You’ll usually see indices above and below the sigma that tell us where to start and stop summing from. For example, instead of writing 1 + 2 + 3 + 4 + 5 = 15, we can use the sigma notation shown in equation A.1.

In this section, I’ll show you how we can take the general linear model we discussed in the previous chapter and extend it to include nonlinear, polynomial relationships between predictor variables and the outcome variable. Linear regression makes the strong assumption that there is a linear relationship between predictor variables and the outcome. Sometimes real-world variables have linear relationships, or can be sufficiently approximated by one, but often they do not. Surely the general linear model falls down when faced with nonlinear relationships, right? After all, it’s called the general linear model and uses the equation of a straight line. Well, it turns out that the general linear model is surprisingly flexible, and we can use it to model polynomial relationships.

Recall from high school math that a polynomial equation is just an equation with multiple terms (single numbers or variables). If all the terms in the equation are raised to the power of 1 (an exponent of 1)—in other words, they are all equal to themselves—the equation is a first-degree polynomial. If the highest exponent in the equation is 2—in other words, one or some of the terms are squared but there are no higher exponents—the equation is a second-degree polynomial or quadratic polynomial. If the highest exponent is 3, the equation is a cubic polynomial; and if the highest exponent is 4, the equation is a quartic polynomial.

Figure 10.1. Shapes of polynomial functions from the first to the fourth degree. When the x variable is raised to the first power, the equation models a straight line. As we increase the power that x is raised to, the equations model lines with varying degrees of flexibility.
  • GAMs use the equation of a straight line, but allow nonlinear relationships between the predictor variables and the outcome.