Skip to main content
. Author manuscript; available in PMC: 2019 May 20.
Published in final edited form as: Stat Med. 2018 Mar 6;37(11):1767–1787. doi: 10.1002/sim.7623

Algorithm 3.

Causal MARS.

Require: Data (Xi, Yi, Yi), parameter D
 Define ≡ {{(xjc)+, (c −xj)+} : c ∈ {Xij}, j ∈ {1,…,p}}
 Initialize = {1}
β^argminβi=1n(Yiβh1ITi=1βh0ITi=0)2
RiYiβ^h1ITi=1β^h0ITi=0
for d in 1,…,D do
  for {f, g} in {{b(x)f*(x), b(x)g*(x)} : b ∈ ℬ, {f*,g*} ∈ ℱ} do
    RSSμminβi=1n(Rih{f,g}βhh(Xi))2
    RSSτminβi=1n(Rih{f,g}βh1h(Xi)ITi=1h{f,g}βh0h(Xi)ITi=0)2
   dRSS = RSSτ − RSSμ
  end for
  Choose {f,g} which maximize dRSS
   β^argminβi=1n(Yih{f,g}βh1h(Xi)ITi=1h{f,g}βh0h(Xi)ITi=0)2
   RiYih{f,g}β^h1h(Xi)ITi=1h{f,g}β^h0h(Xi)ITi=0
   BB{f,g}
end for
 Backward deletion: delete terms one at a time, using the same criterion dRSS = RSSτ − RSSμ
 Use out-of-hag dRSS to estimate the optimal model size.