semipadd2pop: Compute semiparametric binary-response regression model with...

View source: R/semipadd2pop.R

semipadd2popR Documentation

Compute semiparametric binary-response regression model with 2 data sets while penalizing dissimilarity

Description

Compute semiparametric binary-response regression model with 2 data sets while penalizing dissimilarity

Usage

semipadd2pop(
  Y1,
  X1,
  nonparm1,
  Y2,
  X2,
  nonparm2,
  response,
  rho1,
  rho2,
  w1,
  w2,
  w,
  nCom,
  d1,
  d2,
  xi,
  lambda.beta,
  lambda.f,
  eta.beta,
  eta.f,
  tol = 1e-04,
  maxiter = 500,
  plot_obj = FALSE
)

Arguments

Y1

the response data from data set 1

nonparm1

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

Y2

the response data from data set 2

nonparm2

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

response

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

rho1

weight placed on the first data set

rho2

weight placed on the second data set

w1

covariate-specific weights for different penalization among covariates in data set 1

w2

covariate-specific weights for different penalization among covariates in data set 2

w

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

nCom

the number of covariates to be treated as common between the two data sets: these must be arranged in the first nCom columns of the matrices X1 and X2 after the column of ones corresponding to the intercept.

d1

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.

d2

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

eta.beta

the level of penalization towards model similarity for parametric effects indicated to be common

eta.f

the level of penalization towards model similarity for nonparametric effects indicated to be common

tol

a convergence criterion

maxiter

the maximum allowed number of iterations

XX1

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

XX2

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

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_semipadd2pop_data(n1 = 500, n2 = 600, response = "binary")

semipadd2pop.out <- semipadd2pop(Y1 = data$Y1,
                                 X1 = data$X1,
                                 nonparm1 = data$nonparm1,
                                 Y2 = data$Y2,
                                 X2 = data$X2,
                                 nonparm2 = data$nonparm2,
                                 response = "binary",
                                 rho1 = 1,
                                 rho2 = 1,
                                 nCom = data$nCom,
                                 d1 = 25,
                                 d2 = 15,
                                 xi = .5,
                                 w1 = 1,
                                 w2 = 1,
                                 w = 1,
                                 lambda.beta = .01,
                                 lambda.f = .01,
                                 eta.beta = .1,
                                 eta.f = .1,
                                 tol = 1e-3,
                                 maxiter = 500)


plot_semipadd2pop(semipadd2pop.out,
                  true.functions = list(f1 = data$f1,
                                        f2 = data$f2,
                                        X1 = data$X1,
                                        X2 = data$X2))

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