ArticleslgStudy

computer science

Multivariate adaptive regression spline

Multivariate adaptive regression spline is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Multivariate adaptive regression spline rather than just read about it. In short: In statistics, multivariate adaptive regression splines (MARS) is a form of regression analysis introduced by Jerome H. Friedman in 1991.

Multivariate adaptive regression spline — main illustration
Multivariate adaptive regression spline — illustration

Key takeaways

  • Multivariate adaptive regression spline belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Multivariate adaptive regression spline to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Multivariate adaptive regression spline from memory before moving on to harder problems.

Reference excerpt

In statistics, multivariate adaptive regression splines (MARS) is a form of regression analysis introduced by Jerome H. Friedman in 1991. It is a non-parametric regression technique and can be seen as an extension of linear models that automatically models nonlinearities and interactions between variables. The term "MARS" is trademarked and licensed to Salford Systems. In order to avoid trademark infringements, many open-source implementations of MARS are called "Earth".

The basics This section introduces MARS using a few examples. We start with a set of data: a matrix of input variables x, and a vector of the observed responses y, with a response for each row in x. For example, the data could be:

Here there is only one independent variable, so the x matrix is just a single column. Given these measurements, we would like to build a model which predicts the expected y for a given x.

A linear model for the above data is y^=−37+5.1x The hat on the y^ indicates that y^ is estimated from the data. The figure on the right shows a plot of this function: a line giving the predicted y^ versus x, with the original values of y shown as red dots. The data at the extremes of x indicates that the relationship between y and x may be non-linear (look at the red dots relative to the regression line at low and high values of x). We thus turn to MARS to automatically build a model taking into account non-linearities. MARS software constructs a model from the given x and y as follows y^= 25+6.1max⁡(0,x−13)−3.1max⁡(0,13−x)

The figure on the right shows a plot of this function: the predicted y^ versus x, with the original values of y once again shown as red dots. The predicted response is now a better fit to the original y values. MARS has automatically produced a kink in the predicted y to take into account non-linearity. The kink is produced by hinge functions. The hinge functions are the expressions starting with max (where max⁡(a,b) is a if a>b, else b). Hinge functions are described in more detail below. In this simple example, we can easily see from the plot that y has a non-linear relationship with x (and might perhaps guess that y varies with the square of x). However, in general there will be multiple independent variables, and the relationship between y and these variables will be unclear and not easily visible by plotting. We can use MARS to discover that non-linear relationship. An example MARS expression with multiple variables is ozone= 5.2+0.93max⁡(0,temp−58)−0.64max⁡(0,temp−68)−0.046max⁡(0,234−ibt)−0.016max⁡(0,wind−7)max⁡(0,200−vis)

This expression models air pollution (the ozone level) as a function of the temperature and a few other variables. Note that the last term in the formula (on the last line) incorporates an interaction between wind and vis. The figure on the right plots the predicted ozone as wind and vis vary, with the other variables fixed at their median values. The figure shows that wind does not affect the ozone level unless visibility is low. We see that MARS can build quite flexible regression surfaces by combining hinge functions. To obtain the above expression, the MARS model building procedure automatically selects which variables to use (some variables are important, others not), the positions of the kinks in the hinge functions, and how the hinge functions are combined.

The MARS model MARS builds models of the form f^(x)=∑i=1kciBi(x). The model is a weighted sum of basis functions Bi(x). Each ci is a constant coefficient. For example, each line in the formula for ozone above is one basis function multiplied by its coefficient. Each basis function Bi(x) takes one of the following three forms:

a constant 1. There is just one such term, the intercept. In the ozone formula above, the intercept term is 5.2. a hinge function. A hinge function has the form max⁡(0,x−constant) or max⁡(0,constant−x). MARS automatically selects variables and values of those variables for knots of the hinge functions. Examples of such basis functions can be seen in the middle three lines of the ozone formula. a product of two or more hinge functions. These basis functions can model interaction between two or more variables. An example is the last line of the ozone formula.

Hinge functions

A key part of MARS models are hinge functions taking the form max⁡(0,x−c) or max⁡(0,c−x) where c is a constant, called the knot. The figure on the right shows a mirrored pair of hinge functions with a knot at 3.1. A hinge function is zero for part of its range, so can be used to partition the data into disjoint regions, each of which can be treated independently. Thus for example a mirrored pair of hinge functions in the expression 6.1max⁡(0,x−13)−3.1max⁡(0,13−x) creates the piecewise linear graph shown for the simple MARS model in the previous section. One might assume that only piecewise linear functions can be formed from hinge functions, but hinge functions can be multiplied together to form non-linear functions. Hinge functions are also called ramp, hockey stick, or rectifier functions. Instead of the max notation used in this article, hinge functions are often represented by [±(xi−c)]+ where [⋅]+ means take the positive part.

The model building process

MARS builds a model in two phases: the forward and the backward pass. This two-stage approach is the same as that used by recursive partitioning trees.

The forward pass MARS starts with a model which consists of just the intercept term (which is the mean of the response values). MARS then repeatedly adds basis function in pairs to the model. At each step it finds the pair of basis functions that gives the maximum reduction in sum-of-squares residual error (it is a greedy algorithm). The two basis functions in the pair are identical except that a different side of a mirrored hinge function is used for each function. Each new basis function consists of a term already in the model (which could perhaps be the intercept term) multiplied by a new hinge function. A hinge function is defined by a variable and a knot, so to add a new basis function, MARS must search over all combinations of the following:

… excerpt ends here. Continue reading the full article.

Illustrations

Multivariate adaptive regression spline: A simple MARS model of the same data
A simple MARS model of the same data
Multivariate adaptive regression spline: Variable interaction in a MARS model
Variable interaction in a MARS model
Multivariate adaptive regression spline: A mirrored pair of hinge functions with a knot at x=3.1
A mirrored pair of hinge functions with a knot at x=3.1

Worked examples

Example 1 — a first encounter with Multivariate adaptive regression spline

Start with the simplest possible case. Write down what Multivariate adaptive regression spline claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Multivariate adaptive regression spline before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Multivariate adaptive regression spline ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Multivariate adaptive regression spline

In research
Multivariate adaptive regression spline appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Multivariate adaptive regression spline in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Multivariate adaptive regression spline is common in secondary-school and first-year university syllabi. It links to neighbouring topics Machine learning, Nonparametric regression, so understanding it makes those chapters shorter.
In everyday life
Look for Multivariate adaptive regression spline outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Multivariate adaptive regression spline” →

How to study Multivariate adaptive regression spline in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Multivariate adaptive regression spline means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Multivariate adaptive regression spline out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Multivariate adaptive regression spline in simple terms?

In statistics, multivariate adaptive regression splines (MARS) is a form of regression analysis introduced by Jerome H. Friedman in 1991.

Why does Multivariate adaptive regression spline matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Multivariate adaptive regression spline?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Multivariate adaptive regression spline.

Tags

  • Machine learning
  • Nonparametric regression

Keep exploring