NVC_frequentist {NVCSSL} | R Documentation |
Fits frequentist penalized nonparametric varying coefficient (NVC) models
Description
This function implements frequentist penalized nonparametric varying coefficient (NVC) models. It supports the following penalty functions: the group lasso penalty of Yuan and Lin (2006), the group minimax concave penalty (MCP) of Breheny and Huang (2015), and the group smoothly clipped absolute deviation (SCAD) penalty of Breheny and Huang (2015). This function solves a penalized regression problem of the form,
argmax_{\gamma} \frac{1}{N} \ell(\gamma) + pen_{\lambda}(\gamma),
where N
is the total number of observations, \ell(\gamma)
is the loss function, and pen_{\lambda}(\cdot)
is a penalty function with regularization parameter \lambda > 0
. Since the objective function is rescaled by 1/N
, the penalty \lambda
is typically smaller than the spike hyperparameter \lambda_0
used by the NVC_SSL
function. The BIC criterion is used to select the optimal tuning parameter \lambda
.
Usage
NVC_frequentist(y, t, X, n_basis=8, penalty=c("gLASSO","gSCAD","gMCP"),
lambda=NULL, include_intercept=TRUE)
Arguments
y |
|
t |
|
X |
|
n_basis |
number of basis functions to use. Default is |
penalty |
string specifying which penalty function to use. Specify |
lambda |
grid of tuning parameters. If |
include_intercept |
Boolean variable for whether or not to include an intercept function |
Value
The function returns a list containing the following components:
t_ordered |
all |
classifications |
|
beta_hat |
|
beta0_hat |
estmate of the intercept function |
gamma_hat |
estimated basis coefficients (needed for prediction) for the optimal |
lambda_min |
the individual |
lambda0_all |
grid of all |
BIC_all |
|
beta_est_all_lambda |
list of length |
beta0_est_all_lambda |
|
gamma_est_all_lambda |
|
classifications_all_lambda |
|
iters_to_converge |
number of iterations it took for the group ascent algorithm to converge for each entry in |
References
Bai, R., Boland, M. R., and Chen, Y. (2023). "Scalable high-dimensional Bayesian varying coefficient models with unknown within-subject covariance." arXiv pre-print arXiv:arXiv:1907.06477.
Breheny, P. and Huang, J. (2015). "Group descent algorithms for nonconvex penalized linear and logistic regression models with grouped predictors." Statistics and Computing, 25:173-187.
Wei, F., Huang, J., and Li, H. (2011). "Variable selection and estimation in high-dimensional varying coefficient models." Statistica Sinica, 21:1515-1540.
Yuan, M. and Lin, Y. (2006). "Model selection and estimation in regression with grouped variables." Journal of the Royal Statistical Society: Series B (Statistical Methodology), 68:49-67.
Examples
## Load data
data(SimulatedData)
attach(SimulatedData)
y = SimulatedData$y
t = SimulatedData$t
id = SimulatedData$id
X = SimulatedData[,4:103]
## Fit frequentist penalized NVC model with the SCAD penalty.
## Can set penalty as "gLASSO", "gSCAD", or "gMCP".
## No need to specify an 'id' argument when using NVC_frequentist() function
NVC_gSCAD_mod = NVC_frequentist(y, t, X, penalty="gSCAD")
## Classifications. First varying coefficients are selected as nonzero
NVC_gSCAD_mod$classifications
## Optimal lambda chosen from BIC
NVC_gSCAD_mod$lambda_min
## Plot first estimated varying coefficient function
t_ordered = NVC_gSCAD_mod$t_ordered
beta_hat= NVC_gSCAD_mod$beta_hat
plot(t_ordered, beta_hat[,1], lwd=3, type='l', col='blue',
xlab="Time", ylim = c(-12,12), ylab=expression(beta[1]))
## Plot third estimated varying coefficient function
plot(t_ordered, beta_hat[,3], lwd=3, type='l', col='blue',
xlab="Time", ylim = c(-4,2), ylab=expression(beta[3]))
## Plot fifth estimated varying coefficient function
plot(t_ordered, beta_hat[,5], lwd=3, type='l', col='blue',
xlab="Time", ylim = c(0,15), ylab=expression(beta[5]))