Predict.matrix             package:mgcv             R Documentation

_P_r_e_d_i_c_t_i_o_n _m_e_t_h_o_d_s _f_o_r _s_m_o_o_t_h _t_e_r_m_s _i_n _a _G_A_M

_D_e_s_c_r_i_p_t_i_o_n:

     Takes 'smooth' objects produced by 'smooth.construct' methods and
     obtains the matrix mapping  the parameters associated with such a
     smooth to the predicted values of the smooth at a set of new
     covariate values.

     In practice this method is often called via the wrapper function
     'PredictMat'.

_U_s_a_g_e:

     Predict.matrix(object,data)
     Predict.matrix2(object,data)

_A_r_g_u_m_e_n_t_s:

  object: is a smooth object produced by a 'smooth.construct' method
          function. The object  contains all the information required
          to specify the basis for a term of its class, and this
          information is used by the appropriate 'Predict.matrix'
          function to produce a prediction matrix for new covariate
          values. Further details are given in 'smooth.construct'.

    data: A data frame containing the values of the (named) covariates
          at which the smooth term is to be  evaluated. Exact
          requirements are as for 'smooth.construct' and
          'smooth.construct2'

     .

_D_e_t_a_i_l_s:

     Smooth terms in a GAM formula are turned into smooth specification
     objects of  class 'xx.smooth.spec' during processing of the
     formula. Each of these objects is converted to a smooth object
     using an appropriate 'smooth.construct' function. The
     'Predict.matrix'  functions are used to obtain the matrix that
     will map the parameters associated with a smooth term to the
     predicted values for the term at new covariate values.

     Note that new smooth classes can be added by writing a new
     'smooth.construct' method function and a  corresponding
     'Predict.matrix' method function: see the example code provided
     for  'smooth.construct' for details.

_V_a_l_u_e:

     A matrix which will map the parameters associated with the smooth
     to the vector of values of the smooth  evaluated at the covariate
     values given in 'object'. If the smooth class is one which
     generates offsets the corresponding offset is returned as
     attribute '"offset"' of the matrix.

_A_u_t_h_o_r(_s):

     Simon N. Wood simon.wood@r-project.org

_R_e_f_e_r_e_n_c_e_s:

     Wood S.N. (2006) Generalized Additive Models: An Introduction with
     R. Chapman and Hall/CRC Press.

_S_e_e _A_l_s_o:

     'gam','gamm', 'smooth.construct', 'PredictMat'

_E_x_a_m_p_l_e_s:

     # See smooth.construct examples

