update.earth {earth} | R Documentation |
Update an ‘earth’ model.
## S3 method for class 'earth': update(object = stop("no 'object' arg"), formula. = NULL, ..., evaluate = TRUE)
object |
|
formula. |
|
... |
These arguments are the same as earth .
The formula. argument is treated like earth's formula argument. |
evaluate |
If TRUE (default) evaluate the new call else return the call. |
The value is the same as that returned by earth
.
If object
is the only parameter then no changes are made
— the returned value will be the same as the original object
.
If only the following arguments are used, a forward pass
is unnecessary, and update.earth
will perform only the pruning pass.
This is usually much faster for large models.
trace pmethod ppenalty nprune Get.crit Eval.model.subsets Print.pruning.pass Force.xtx.prune
data(ozone1) (a <- earth(O3 ~ ., data = ozone1, degree = 2)) # yields: # Selected 14 of 21 terms, and 8 of 9 predictors # Number of terms at each degree of interaction: 1 6 7 # GCV: 13.74837 RSS: 3662.576 GRSq: 0.7864352 RSq: 0.8265448 update(a, formula = O3 ~ . - temp) # requires forward pass and pruning # yields: # Selected 15 of 21 terms, and 8 of 8 predictors # Number of terms at each degree of interaction: 1 5 9 # GCV: 13.11272 RSS: 3434.579 GRSq: 0.7963093 RSq: 0.8373425 update(a, nprune = 8) # requires only pruning # yields: # Selected 8 of 21 terms, and 6 of 9 predictors # Number of terms at each degree of interaction: 1 5 2 # GCV: 15.8959 RSS: 4673.984 GRSq: 0.7530759 RSq: 0.7786458