tpU                   package:amer                   R Documentation

_G_e_n_e_r_a_t_e _a _m_o_d_i_f_i_e_d _t_r_u_n_c_a_t_e_d _p_o_w_e_r _b_a_s_i_s _f_o_r _p_e_n_a_l_i_z_e_d _s_p_l_i_n_e _s_m_o_o_t_h_i_n_g.

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

     Generate a modified truncated power basis for penalized spline
     smoothing.

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

     tpU(x, degree=2, k=15, unpen=1, by, allPen=FALSE, varying,
         diag=FALSE, knots=seq(min(x), max(x), l = k - degree +
         2)[-c(1, k - degree + 2)], centerscale=NULL, scaledknots=FALSE)

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

       x: covariate for the smooth function

  degree: integer: degree of truncated polynomials (0: piecewise
          constant, 1: piecewise linear etc..)

       k: integer: dimensionality of the basis (i.e.: number of knots +
          degree)

   unpen: integer: degree of the unpenalized nullspace, must be lower
          than degree: 1 for pen. deviations from linearity, 2 for pen.
          deviations from quadratic etc.

      by: factor variable: estimate separate functions for each level -
          this assumes standard treatment contrasts for the supplied
          factor.

  allPen: boolean: if TRUE, make design for group-specific curves with
          common smoothing parameter: all parameters (including the
          normally unpenalized basis functions in X) are penalized,
          every level of "by" has the same amount of smoothing. If
          FALSE, make design for separate curves for each by-level:
          separate smoothing parameters for every level of "by",
          unpenalized estimates for the coefficients associated with X

 varying: numeric: if not NULL, a varying coefficient model is fit:
          f(x,varying) = f(x)*varying

    diag: logical: force a diagonal covariance-matrix for the random
          effects for X if 'allPen=TRUE'?

   knots: vector of knot locations (optional). Defaults to equidistant
          knot placement.

scaledknots: boolean:     are knots given for the rescaled x-values?

centerscale: numeric(2): center&scale x by these values if not NULL

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

     list with entries: '"X"': 'n x unpen' design matrix for
     unpenalized part (without intercept)   '"Z"': 'n x (k-unpen)'
     design matrix for penalized part

_N_o_t_e:

     This is a more detailed implementation of the example on how to
     define additional basis generating functions in the vignette. For
     quantile-based knot placement use 'knots=quantile(x, probs = (2:(k
     - degree + 1))/(k - degree + 2))'

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

     Fabian Scheipl

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

     'tp'

