Learn R Programming

earth (version 5.3.4)

mars.to.earth: Convert a mars object from the mda package to an earth object

Description

Convert a mars object from the mda package to an earth object

Usage

mars.to.earth(object, trace=TRUE)

Value

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.

Arguments

object

A mars object, created using mars in the mda package.

trace

If TRUE (default) print a summary of the conversion.

See Also

earth, mars

Examples

Run this code
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)
}

Run the code above in your browser using DataLab