<s>
In	O
statistics	O
,	O
multivariate	B-General_Concept
adaptive	I-General_Concept
regression	I-General_Concept
splines	I-General_Concept
(	O
MARS	O
)	O
is	O
a	O
form	O
of	O
regression	O
analysis	O
introduced	O
by	O
Jerome	O
H	O
.	O
Friedman	O
in	O
1991	O
.	O
</s>
<s>
It	O
is	O
a	O
non-parametric	O
regression	O
technique	O
and	O
can	O
be	O
seen	O
as	O
an	O
extension	O
of	O
linear	B-Algorithm
models	I-Algorithm
that	O
automatically	O
models	O
nonlinearities	O
and	O
interactions	O
between	O
variables	O
.	O
</s>
<s>
The	O
data	O
at	O
the	O
extremes	O
of	O
x	O
indicates	O
that	O
the	O
relationship	O
between	O
y	O
and	O
x	O
may	O
be	O
non-linear	O
(	O
look	O
at	O
the	O
red	O
dots	O
relative	O
to	O
the	O
regression	B-General_Concept
line	I-General_Concept
at	O
low	O
and	O
high	O
values	O
of	O
x	O
)	O
.	O
</s>
<s>
MARS	O
automatically	O
selects	O
variables	O
and	O
values	O
of	O
those	O
variables	O
for	O
knots	B-Algorithm
of	O
the	O
hinge	O
functions	O
.	O
</s>
<s>
where	O
is	O
a	O
constant	O
,	O
called	O
the	O
knot	B-Algorithm
.	O
</s>
<s>
The	O
figure	O
on	O
the	O
right	O
shows	O
a	O
mirrored	O
pair	O
of	O
hinge	O
functions	O
with	O
a	O
knot	B-Algorithm
at	O
3.1	O
.	O
</s>
<s>
creates	O
the	O
piecewise	B-Algorithm
linear	O
graph	O
shown	O
for	O
the	O
simple	O
MARS	O
model	O
in	O
the	O
previous	O
section	O
.	O
</s>
<s>
One	O
might	O
assume	O
that	O
only	O
piecewise	B-Algorithm
linear	O
functions	O
can	O
be	O
formed	O
from	O
hinge	O
functions	O
,	O
but	O
hinge	O
functions	O
can	O
be	O
multiplied	O
together	O
to	O
form	O
non-linear	O
functions	O
.	O
</s>
<s>
Hinge	O
functions	O
are	O
also	O
called	O
ramp	O
,	O
hockey	O
stick	O
,	O
or	O
rectifier	B-Algorithm
functions	O
.	O
</s>
<s>
recursive	B-General_Concept
partitioning	I-General_Concept
trees	O
.	O
</s>
<s>
At	O
each	O
step	O
it	O
finds	O
the	O
pair	O
of	O
basis	O
functions	O
that	O
gives	O
the	O
maximum	O
reduction	O
in	O
sum-of-squares	O
residual	O
error	O
(	O
it	O
is	O
a	O
greedy	B-Algorithm
algorithm	I-Algorithm
)	O
.	O
</s>
<s>
A	O
hinge	O
function	O
is	O
defined	O
by	O
a	O
variable	O
and	O
a	O
knot	B-Algorithm
,	O
so	O
to	O
add	O
a	O
new	O
basis	O
function	O
,	O
MARS	O
must	O
search	O
over	O
all	O
combinations	O
of	O
the	O
following	O
:	O
</s>
<s>
3	O
)	O
all	O
values	O
of	O
each	O
variable	O
(	O
for	O
the	O
knot	B-Algorithm
of	O
the	O
new	O
hinge	O
function	O
)	O
.	O
</s>
<s>
To	O
calculate	O
the	O
coefficient	O
of	O
each	O
term	O
MARS	O
applies	O
a	O
linear	B-General_Concept
regression	I-General_Concept
over	O
the	O
terms	O
.	O
</s>
<s>
The	O
search	O
at	O
each	O
step	O
is	O
done	O
in	O
a	O
brute-force	B-Algorithm
fashion	O
,	O
but	O
a	O
key	O
aspect	O
of	O
MARS	O
is	O
that	O
because	O
of	O
the	O
nature	O
of	O
hinge	O
functions	O
the	O
search	O
can	O
be	O
done	O
relatively	O
quickly	O
using	O
a	O
fast	O
least-squares	O
update	O
technique	O
.	O
</s>
<s>
The	O
search	O
can	O
be	O
sped	O
up	O
with	O
a	O
heuristic	B-Algorithm
that	O
reduces	O
the	O
number	O
of	O
parent	O
terms	O
to	O
consider	O
at	O
each	O
step	O
(	O
"	O
Fast	O
MARS	O
"	O
)	O
.	O
</s>
<s>
The	O
forward	O
pass	O
usually	O
builds	O
an	O
overfit	B-Error_Name
model	O
.	O
</s>
<s>
(	O
An	O
overfit	B-Error_Name
model	O
has	O
a	O
good	O
fit	O
to	O
the	O
data	O
used	O
to	O
build	O
the	O
model	O
but	O
will	O
not	O
generalize	O
well	O
to	O
new	O
data	O
.	O
)	O
</s>
<s>
The	O
raw	O
residual	B-Algorithm
sum-of-squares	I-Algorithm
(	O
RSS	O
)	O
on	O
the	O
training	O
data	O
is	O
inadequate	O
for	O
comparing	O
models	O
,	O
because	O
the	O
RSS	O
always	O
increases	O
as	O
MARS	O
terms	O
are	O
dropped	O
.	O
</s>
<s>
where	O
RSS	O
is	O
the	O
residual	B-Algorithm
sum-of-squares	I-Algorithm
measured	O
on	O
the	O
training	O
data	O
and	O
N	O
is	O
the	O
number	O
of	O
observations	O
(	O
the	O
number	O
of	O
rows	O
in	O
the	O
x	O
matrix	O
)	O
.	O
</s>
<s>
is	O
the	O
number	O
of	O
hinge-function	O
knots	B-Algorithm
,	O
so	O
the	O
formula	O
penalizes	O
the	O
addition	O
of	O
knots	B-Algorithm
.	O
</s>
<s>
Generalized	O
cross-validation	B-Application
is	O
so	O
named	O
because	O
it	O
uses	O
a	O
formula	O
to	O
approximate	O
the	O
error	O
that	O
would	O
be	O
determined	O
by	O
leave-one-out	O
validation	O
.	O
</s>
<s>
It	O
is	O
useful	O
to	O
compare	O
MARS	O
to	O
recursive	B-General_Concept
partitioning	I-General_Concept
and	O
this	O
is	O
done	O
below	O
.	O
</s>
<s>
(	O
Recursive	B-General_Concept
partitioning	I-General_Concept
is	O
also	O
commonly	O
called	O
regression	B-Algorithm
trees	I-Algorithm
,	O
</s>
<s>
see	O
the	O
recursive	B-General_Concept
partitioning	I-General_Concept
article	O
for	O
details	O
)	O
.	O
</s>
<s>
MARS	O
models	O
are	O
more	O
flexible	O
than	O
linear	B-General_Concept
regression	I-General_Concept
models	I-General_Concept
.	O
</s>
<s>
Compare	O
the	O
equation	O
for	O
ozone	O
concentration	O
above	O
to	O
,	O
say	O
,	O
the	O
innards	O
of	O
a	O
trained	O
neural	B-Architecture
network	I-Architecture
or	O
a	O
random	B-Algorithm
forest	I-Algorithm
.	O
</s>
<s>
MARS	O
tends	O
to	O
be	O
better	O
than	O
recursive	B-General_Concept
partitioning	I-General_Concept
for	O
numeric	O
data	O
because	O
hinges	O
are	O
more	O
appropriate	O
for	O
numeric	O
variables	O
than	O
the	O
piecewise	B-Algorithm
constant	O
segmentation	O
used	O
by	O
recursive	B-General_Concept
partitioning	I-General_Concept
.	O
</s>
<s>
In	O
this	O
respect	O
MARS	O
is	O
similar	O
to	O
recursive	B-General_Concept
partitioning	I-General_Concept
which	O
also	O
partitions	O
the	O
data	O
into	O
disjoint	O
regions	O
,	O
although	O
using	O
a	O
different	O
method	O
.	O
</s>
<s>
MARS	O
(	O
like	O
recursive	B-General_Concept
partitioning	I-General_Concept
)	O
does	O
automatic	O
variable	B-General_Concept
selection	I-General_Concept
(	O
meaning	O
it	O
includes	O
important	O
variables	O
in	O
the	O
model	O
and	O
excludes	O
unimportant	O
ones	O
)	O
.	O
</s>
<s>
Recursive	B-General_Concept
partitioning	I-General_Concept
is	O
much	O
faster	O
than	O
MARS	O
.	O
</s>
<s>
With	O
MARS	O
models	O
,	O
as	O
with	O
any	O
non-parametric	O
regression	O
,	O
parameter	O
confidence	O
intervals	O
and	O
other	O
checks	O
on	O
the	O
model	O
cannot	O
be	O
calculated	O
directly	O
(	O
unlike	O
linear	B-General_Concept
regression	I-General_Concept
models	I-General_Concept
)	O
.	O
</s>
<s>
Cross-validation	B-Application
and	O
related	O
techniques	O
must	O
be	O
used	O
for	O
validating	O
the	O
model	O
instead	O
.	O
</s>
<s>
MARS	O
models	O
do	O
not	O
give	O
as	O
good	O
fits	O
as	O
boosted	B-Algorithm
trees	O
,	O
but	O
can	O
be	O
built	O
much	O
more	O
quickly	O
and	O
are	O
more	O
interpretable	O
.	O
</s>
<s>
The	O
earth	O
,	O
mda	O
,	O
and	O
polspline	O
implementations	O
do	O
not	O
allow	O
missing	O
values	O
in	O
predictors	O
,	O
but	O
free	O
implementations	O
of	O
regression	B-Algorithm
trees	I-Algorithm
(	O
such	O
as	O
rpart	O
and	O
party	O
)	O
do	O
allow	O
missing	O
values	O
using	O
a	O
technique	O
called	O
surrogate	O
splits	O
.	O
</s>
<s>
Compare	O
that	O
to	O
making	O
a	O
prediction	O
with	O
say	O
a	O
Support	B-Algorithm
Vector	I-Algorithm
Machine	I-Algorithm
,	O
where	O
every	O
variable	O
has	O
to	O
be	O
multiplied	O
by	O
the	O
corresponding	O
element	O
of	O
every	O
support	O
vector	O
.	O
</s>
<s>
Generalized	O
linear	B-Algorithm
models	I-Algorithm
(	O
GLMs	O
)	O
can	O
be	O
incorporated	O
into	O
MARS	O
models	O
by	O
applying	O
a	O
link	O
function	O
after	O
the	O
MARS	O
model	O
is	O
built	O
.	O
</s>
<s>
(	O
These	O
constraints	O
are	O
necessary	O
because	O
discovering	O
a	O
model	O
from	O
the	O
data	O
is	O
an	O
inverse	O
problem	O
that	O
is	O
not	O
well-posed	B-Algorithm
without	O
constraints	O
on	O
the	O
model	O
.	O
)	O
</s>
<s>
Recursive	B-General_Concept
partitioning	I-General_Concept
(	O
commonly	O
called	O
CART	O
)	O
.	O
</s>
<s>
MARS	O
can	O
be	O
seen	O
as	O
a	O
generalization	O
of	O
recursive	B-General_Concept
partitioning	I-General_Concept
that	O
allows	O
the	O
model	O
to	O
better	O
handle	O
numerical	O
(	O
i.e.	O
</s>
<s>
From	O
the	O
user	O
's	O
perspective	O
GAMs	O
are	O
similar	O
to	O
MARS	O
but	O
(	O
a	O
)	O
fit	O
smooth	O
loess	O
or	O
polynomial	O
splines	B-Algorithm
instead	O
of	O
MARS	O
basis	O
functions	O
,	O
and	O
(	O
b	O
)	O
do	O
not	O
automatically	O
model	O
variable	O
interactions	O
.	O
</s>
<s>
Typically	O
in	O
this	O
set	O
up	O
the	O
predictors	O
are	O
the	O
lagged	O
time	O
series	O
values	O
resulting	O
in	O
autoregressive	O
spline	B-Algorithm
models	O
.	O
</s>
<s>
These	O
models	O
and	O
extensions	O
to	O
include	O
moving	O
average	O
spline	B-Algorithm
models	O
are	O
described	O
in	O
"	O
Univariate	O
Time	O
Series	O
Modelling	O
and	O
Forecasting	O
using	O
TSMARS	O
:	O
A	O
study	O
of	O
threshold	O
time	O
series	O
autoregressive	O
,	O
seasonal	O
and	O
moving	O
average	O
models	O
using	O
TSMARS	O
"	O
.	O
</s>
