lf                  package:locfit                  R Documentation

_L_o_c_f_i_t _t_e_r_m _i_n _A_d_d_i_t_i_v_e _M_o_d_e_l _f_o_r_m_u_l_a

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

     This function is used to specify a smooth term in a 'gam()' model
     formula.

     At the time of writing, 'gam' is not available in R.

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

     lf(..., alpha=0.7, deg=2, scale=1, kern="tcub", ev="tree", maxk=100)

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

     ...: numeric predictor variable(s)

   alpha: Smoothing parameter. A single number (e.g. 'alpha=0.7') is
          interpreted as a nearest neighbor fraction. With two
          componentes (e.g. 'alpha=c(0.7,1.2)'), the first component is
          a nearest neighbor fraction, and the second component is a
          fixed component. A third component is the penalty term in
          locally adaptive smoothing.

     deg: degree of polynomials to be fitted locally.

   scale: A scale to apply to each variable. This is especially
          important for multivariate fitting, where variables may be
          measured in non-comparable units. It is also used to specify
          the frequency for 'ang' terms. If 'scale=FALSE' (the default)
          no scaling is performed. If 'scale=TRUE', marginal standard
          deviations are used. Alternatively, a numeric vector can
          provide scales for the individual variables.

    kern: Weight function, default = '"tcub"'. Other choices are
          '"rect"', '"trwt"', '"tria"', '"epan"', '"bisq"' and
          '"gauss"'. Choices may be restricted when derivatives are
          required; e.g. for confidence bands and some bandwidth
          selectors.

      ev: Evaluation Structure, default = '"tree"'. Also available are
          '"phull"', '"data"', '"grid"', '"kdtree"', '"kdcenter"' and
          '"crossval"'. 'ev="none"' gives no evaluation points,
          effectively producing the global parametric fit. A vector or
          matrix of evaluation points can also be provided.

    maxk: Controls space assignment for evaluation structures. For the
          adaptive evaluation structures, it is impossible to be sure
          in advance how many vertices will be generated. If you get
          warnings about `Insufficient vertex space', Locfit's default
          assigment can be increased by increasing 'maxk'. The default
          is 'maxk=100'.

_S_e_e _A_l_s_o:

     'locfit', 'locfit.raw', 'gam.lf', 'gam'

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

     # fit an additive semiparametric model to the ethanol data.
     if (exists("gam")) {  # shut up R's checks
     fit <- gam(NOx~lf(E)+C,data=ethanol)
     plot(fit)
     }

