best.fit {cgam} | R Documentation |
Extract the Best Fit Returned by the ShapeSelect Routine
Description
This is a subroutine that only works for the ShapeSelect
routine.
It returns an object of the cgam
class given the variables and their shapes
chosen by the ShapeSelect
routine.
Usage
best.fit(x)
Arguments
x |
An object of the |
Value
The best fit returned by the ShapeSelect
routine, which is an object of class cgam
.
Author(s)
Xiyue Liao
See Also
Examples
## Not run:
library(MASS)
data(Rubber)
# Perform variable and shape selection with four possible shapes:
# increasing, decreasing, convex, and concave
ans <- ShapeSelect(loss ~ shapes(hard, set = c("incr", "decr", "conv", "conc")) +
shapes(tens, set = c("incr", "decr", "conv", "conc")),
data = Rubber, genetic = TRUE)
# Extract the best fit (a cgam object)
bf <- best.fit(ans)
class(bf)
plotpersp(bf)
## End(Not run)
[Package cgam version 1.28 Index]