semipadd_cv_adapt | R Documentation |
Compute semiparametric regression model using cv to choose the tuning parameter value
semipadd_cv_adapt( Y, X, response, nonparm, w, d, xi, n.lambda = 5, lambda.min.ratio = 0.01, lambda.max.ratio = 1, n.folds = 5, lambda.beta = 1, lambda.f = 1, tol = 0.001, maxiter = 1000, report.prog = FALSE )
Y |
the response data |
X |
the matrix with the observed covariate values (including a column of ones for the intercept) |
response |
a character string indicating the type of response. Can be |
nonparm |
a vector indicating for which covariates a nonparametric function is to be estimated |
w |
covariate-specific weights for different penalization 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 |
n.lambda |
the number of lambda values with which to make the grid |
lambda.min.ratio |
ratio of the smallest lambda value to the smallest value of lambda which admits no variables to the model |
lambda.max.ratio |
ratio of the largest lambda value to the smallest value of lambda which admits no variables to the model |
n.folds |
the number of crossvalidation folds |
lambda.beta |
the level of sparsity penalization for the parametric effects (relative to nonparametric effects) |
lambda.f |
the level of sparsity penalization for the nonparametric effects (relative to the parametric effects) |
tol |
a convergence criterion |
maxiter |
the maximum allowed number of iterations |
report.prog |
a logical indicating whether the progress of the algorithm should be printed to the console |
Returns the estimator of the semiparametric additive model
data <- get_semipadd_data(n = 500, response = "binary") semipadd_cv_adapt.out <- semipadd_cv_adapt(Y = data$Y, X = data$X, nonparm = data$nonparm, response = "binary", w = 1, d = 20, xi = 1, n.lambda = 5, lambda.min.ratio = .001, lambda.max.ratio = .1, lambda.beta = 1, lambda.f = 1, tol = 1e-3, maxiter = 1000, report.prog = TRUE) plot_semipadd_cv_adapt(semipadd_cv_adapt.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.