sgplm1               package:KernGPLM               R Documentation

_G_e_n_e_r_a_l_i_z_e_d _p_a_r_t_i_a_l _l_i_n_e_a_r _m_o_d_e_l

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

     Fits a generalized partial linear model (based on smoothing
     spline) using the (generalized) Speckman estimator or backfitting
     (in the generalized case combined with local scoring) for two
     additive component functions. In contrast to 'kgplm', this
     function can be used only for a 1-dimensional nonparametric
     function. (Note that as for 'kgplm' currently only the PLM as well
     as partial linear Logit and Probit models are implemented.)

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

     sgplm1(x, t, y, spar, family, link,
            b.start=NULL, m.start=NULL, grid = NULL, offset = 0, 
            method = "speckman", sort = TRUE, weights = 1, weights.trim = 1, 
            weights.conv = 1, max.iter = 25, eps.conv = 1e-8,
            verbose = FALSE, ...)

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

       x: n x p matrix, data for linear part

       y: n x 1 vector, responses

       t: n x 1 matrix, data for nonparametric part

    spar: scalar smoothing parameter, as in 'smooth.spline'

  family: text string (currently "gaussian", "bernoulli")

    link: text string (currently "identity" for "gaussian", "logit" or
          "probit" for "bernoulli")

 b.start: p x 1 vector, start values for linear part

 m.start: n x 1 vector, start values for nonparametric part

    grid: m x q matrix, where to calculate the nonparametric function
          (default = t)

  offset: offset

  method: "speckman" or "backfit"

    sort: sort data (default=TRUE)

 weights: binomial weights

weights.trim: trimming weights for fitting the linear part

weights.conv: weights for convergence criterion

max.iter: maximal number of iterations

eps.conv: convergence criterion

 verbose: print additional convergence information

     ...: further parameters to be passed to 'smooth.spline'

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

     List with components: 

       b: p x 1 vector, linear coefficients

   b.cov: p x p matrix, linear coefficients

       m: n x 1 vector, nonparametric function estimate

  m.grid: m x 1 vector, nonparametric function estimate on grid

      it: number of iterations

deviance: deviance

df.residual: approximate degrees of freedom (residuals)

     aic: Akaike's information criterion

_N_o_t_e:

     This function is mainly implemented for comparison. It is not
     really optimized for performance, however since it is
     spline-based, it should be sufficiently fast. Nevertheless, there
     might be several possibilities to improve for speed, in particular
     I guess that the sorting that 'smooth.spline' performs in every
     iteration is slowing down the procedure quite a bit.

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

     Marlene Mueller

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

     Mueller, M. (2001) Estimation and testing in generalized partial
     linear models - A comparative study. _Statistics and Computing,_
     11:299-309.

     Hastie, T. and Tibshirani, R. (1990) _Generalized Additive
     Models._ London: Chapman and Hall.

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

     'kgplm'

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

       ## partial linear model (PLM)
       n <- 1000; b <- c(1,-1); rho <- 0.7
       mm <- function(t){ 1.5*sin(pi*t) }
       x1 <- runif(n,min=-1,max=1); u  <- runif(n,min=-1,max=1)
       t  <- runif(n,min=-1,max=1); x2 <- round(mm(rho*t + (1-rho)*u))
       x  <- cbind(x1,x2)
       y  <- x1*b[1]+x2*b[2] + mm(t) + rnorm(n)

       ## fit partial linear model (PLM)
       k.plm <- kgplm(x,t,y,h=0.35,family="gaussian",link="identity")
       s.plm <- sgplm1(x,t,y,spar=0.5,family="gaussian",link="identity")

       o <- order(t)
       ylim <- range(c(mm(t[o]),k.plm$m,s.plm$m),na.rm=TRUE)
       plot(t[o],mm(t[o]),type="l",ylim=ylim)
       lines(t[o],k.plm$m[o], col="green")
       lines(t[o],s.plm$m[o], col="blue")
       rug(t); title("Kern PLM vs. Spline PLM")

       ## fit partial linear probit model (GPLM)
       y <- (y>0)
       k.gplm <- kgplm(x,t,y,h=0.35,family="bernoulli",link="probit")
       s.gplm <- sgplm1(x,t,y,spar=0.95,family="bernoulli",link="probit")

       o <- order(t)
       ylim <- range(c(mm(t[o]),k.gplm$m,s.gplm$m),na.rm=TRUE)
       plot(t[o],mm(t[o]),type="l",ylim=ylim)
       lines(t[o],k.gplm$m[o], col="green")
       lines(t[o],s.gplm$m[o], col="blue")
       rug(t); title("Kern GPLM vs. Spline GPLM (Probit)")

