| semipadd | R Documentation |
Fit semiparametric regression model
semipadd( Y, X, nonparm, response, w, d, xi, lambda.beta, lambda.f, tol = 1e-04, max.iter = 500 )
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 |
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 |
Returns the estimator of the semiparametric additive model
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.