Convert a mars
object from the mda
package to an earth
object
mars.to.earth(object, trace=TRUE)
A mars
object, created using mars
in the mda
package.
If TRUE
(default) print a summary of the conversion.
The value is the same format as that returned by earth
but
with skeletal versions of rss.per.subset
,
gcv.per.subset
, and prune.terms
.
You can fully initialize these components by calling update.earth
after mars.to.earth
, but if you do this selected.terms
may change.
However with pmethod="backward"
a change is unlikely ---
selected.terms
would change only if GCVs are so close that numerical errors
have an effect.
# NOT RUN { if(require(mda)) { mars.mod <- mars(trees[,-3], trees[,3]) earth.mod <- mars.to.earth(mars.mod) # the standard earth functions can now be used # note the reconstructed call in the summary summary(earth.mod, digits = 2) } # }