semipadd: Fit semiparametric regression model

View source: R/semipadd.R

semipaddR Documentation

Fit semiparametric regression model

Description

Fit semiparametric regression model

Usage

semipadd(
  Y,
  X,
  nonparm,
  response,
  w,
  d,
  xi,
  lambda.beta,
  lambda.f,
  tol = 1e-04,
  max.iter = 500
)

Arguments

Y

the response data

X

the matrix with the observed covariate values (including a column of ones for the intercept)

nonparm

a vector indicating for which covariates a nonparametric function is to be estimated

response

a character string indicating the type of response. Can be "continuous", "binary", or "gt"

w

covariate-specific weights for different penalization toward similarity for different covariates

d

vector giving the dimensions the B-spline bases to be used when fitting the nonparametric effects. If a scalar is given, this dimension is used for all nonparametric effects.

xi

a tuning parameter governing the smoothness of the nonparametric estimates

lambda.beta

the level of sparsity penalization for the parametric effects

lambda.f

the level of sparsity penalization for the nonparametric effects

tol

a convergence criterion

max.iter

the maximum allowed number of iterations

return_obj

a logical indicating whether the value of the objection function should be recorded after every step of the algorithm

Value

Returns the estimator of the semiparametric additive model

Examples

data <- get_semipadd_data(n = 500, response = "continuous")

semipadd.out <- semipadd(Y = data$Y,
                         X = data$X,
                         nonparm = data$nonparm,
                         response = "continuous",
                         w = 1,
                         d = 20,
                         xi = 1,
                         lambda.beta = 1,
                         lambda.f = 1,
                         tol = 1e-3,
                         max.iter = 500)

plot_semipadd(semipadd.out, 
              true.functions = list( f = data$f,
                                     X = data$X))

gregorkb/semipadd2pop documentation built on Oct. 2, 2022, 1:37 p.m.