ssanova0                 package:gss                 R Documentation

_F_i_t_t_i_n_g _S_m_o_o_t_h_i_n_g _S_p_l_i_n_e _A_N_O_V_A _M_o_d_e_l_s

_D_e_s_c_r_i_p_t_i_o_n:

     Fit smoothing spline ANOVA models in Gaussian regression.  The
     symbolic model specification via 'formula' follows the same rules
     as in 'lm'.

_U_s_a_g_e:

     ssanova0(formula, type=NULL, data=list(), weights, subset,
              offset, na.action=na.omit, partial=NULL, method="v",
              varht=1, prec=1e-7, maxiter=30)

_A_r_g_u_m_e_n_t_s:

 formula: Symbolic description of the model to be fit.

    type: List specifying the type of spline for each variable. See
          'mkterm' for details.

    data: Optional data frame containing the variables in the model.

 weights: Optional vector of weights to be used in the fitting process.

  subset: Optional vector specifying a subset of observations to be
          used in the fitting process.

  offset: Optional offset term with known parameter 1.

na.action: Function which indicates what should happen when the data
          contain NAs.

 partial: Optional extra unpenalized terms in partial spline models.

  method: Method for smoothing parameter selection.  Supported are
          'method="v"' for GCV, 'method="m"' for GML (REML), and
          'method="u"' for Mallow's CL.

   varht: External variance estimate needed for 'method="u"'.  Ignored
          when 'method="v"' or 'method="m"' are specified.

    prec: Precision requirement in the iteration for multiple smoothing
          parameter selection.  Ignored when only one smoothing
          parameter is involved.

 maxiter: Maximum number of iterations allowed for multiple smoothing
          parameter selection.  Ignored when only one smoothing
          parameter is involved.

_D_e_t_a_i_l_s:

     The model specification via 'formula' is intuitive.  For example,
     'y~x1*x2' yields a model of the form

          y = C + f_{1}(x1) + f_{2}(x2) + f_{12}(x1,x2) + e

     with the terms denoted by '"1"', '"x1"', '"x2"', and '"x1:x2"'.

     The model terms are sums of unpenalized and penalized terms.
     Attached to every penalized term there is a smoothing parameter,
     and the model complexity is largely determined by the number of
     smoothing parameters.

     'ssanova0' and the affiliated methods provide a front end to
     RKPACK, a collection of RATFOR routines for nonparametric
     regression via the penalized least squares.  The algorithms
     implemented in RKPACK are of the order O(n^{3}).

_V_a_l_u_e:

     'ssanova0' returns a list object of class
     'c("ssanova0","ssanova")'.

     The method 'summary.ssanova0' can be used to obtain summaries of
     the fits.  The method 'predict.ssanova0' can be used to evaluate
     the fits at arbitrary points along with standard errors.  The
     methods 'residuals.ssanova' and 'fitted.ssanova' extract the
     respective traits from the fits.

_N_o_t_e:

     For complex models and large sample sizes, the approximate
     solution of 'ssanova' can be faster.

     The method 'project' is not implemented for 'ssanova0', nor is the
     mixed-effect model support through 'mkran'.

     In _gss_ versions earlier than 1.0, 'ssanova0' was under the name
     'ssanova'.

_A_u_t_h_o_r(_s):

     Chong Gu, chong@stat.purdue.edu

_R_e_f_e_r_e_n_c_e_s:

     Gu, C. (2002), _Smoothing Spline ANOVA Models_.  New York:
     Springer-Verlag.

     Wahba, G. (1990), _Spline Models for Observational Data_.
     Philadelphia: SIAM.

_E_x_a_m_p_l_e_s:

     ## Fit a cubic spline
     x <- runif(100); y <- 5 + 3*sin(2*pi*x) + rnorm(x)
     cubic.fit <- ssanova0(y~x,method="m")
     ## Obtain estimates and standard errors on a grid
     new <- data.frame(x=seq(min(x),max(x),len=50))
     est <- predict(cubic.fit,new,se=TRUE)
     ## Plot the fit and the Bayesian confidence intervals
     plot(x,y,col=1); lines(new$x,est$fit,col=2)
     lines(new$x,est$fit+1.96*est$se,col=3)
     lines(new$x,est$fit-1.96*est$se,col=3)
     ## Clean up
     ## Not run: 
     rm(x,y,cubic.fit,new,est)
     dev.off()
     ## End(Not run)

     ## Fit a tensor product cubic spline
     data(nox)
     nox.fit <- ssanova0(log10(nox)~comp*equi,data=nox)
     ## Fit a spline with cubic and nominal marginals
     nox$comp<-as.factor(nox$comp)
     nox.fit.n <- ssanova0(log10(nox)~comp*equi,data=nox)
     ## Fit a spline with cubic and ordinal marginals
     nox$comp<-as.ordered(nox$comp)
     nox.fit.o <- ssanova0(log10(nox)~comp*equi,data=nox)
     ## Clean up
     ## Not run: rm(nox,nox.fit,nox.fit.n,nox.fit.o)

