best.fit: Extract the Best Fit Returned by the ShapeSelect Routine

Description Usage Arguments Value Author(s) See Also Examples

View source: R/cgam.R

Description

The is a subroutine which 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

1

Arguments

x

x is an object of the ShapeSelect class.

Value

object

The best fit returned by the ShapeSelect routine, which is an object of the cgam class.

Author(s)

Xiyue Liao

See Also

cgam, ShapeSelect

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
  library(MASS)
  data(Rubber)

  # do a 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)

  # check the best fit, which is an object of the cgam class
  bf <- best.fit(ans)
  class(bf)
  plotpersp(bf)

## End(Not run)

cgam documentation built on Nov. 9, 2018, 1:04 a.m.