plsim.lam {PLSiMCpp} | R Documentation |
Select lambda for Penalized Profile Least Squares Estimator
Description
Use AIC or BIC to choose the regularization parameters for Penalized Profile least squares (PPLS) estimation.
Usage
plsim.lam(...)
## S3 method for class 'formula'
plsim.lam(formula, data, ...)
## Default S3 method:
plsim.lam(xdat=NULL, ydat, zdat, h, zetaini=NULL, penalty="SCAD",
lambdaList=NULL, l1_ratio_List=NULL, lambda_selector="BIC", verbose=TRUE, seed=0, ...)
Arguments
... |
additional arguments. |
formula |
a symbolic description of the model to be fitted. |
data |
an optional data frame, list or environment containing the variables in the model. |
xdat |
input matrix (linear covariates). The model reduces to a single index model when |
zdat |
input matrix (nonlinear covariates). |
ydat |
input vector (response variable). |
h |
bandwidth. |
zetaini |
initial coefficients, optional (default: NULL). It could be obtained by the function |
penalty |
string, optional (default="SCAD"). It could be "SCAD", "LASSO" or "ElasticNet". |
lambdaList |
candidates for lambda selection. |
l1_ratio_List |
candidates for l1_ratio selection. |
lambda_selector |
the criterion to select lambda (and l1_ratio), default: "BIC". |
verbose |
bool, default: TRUE. Enable verbose output. |
seed |
int, default: 0. |
Value
goodness_best |
the AIC (or BIC) statistics with |
lambda_best |
lambda selected by AIC or BIC. |
l1_ratio_best |
l1_ratio selected by AIC or BIC. |
lambdaList |
|
References
H. Liang, X. Liu, R. Li, C. L. Tsai. Estimation and testing for partially linear single-index models. Annals of statistics, 2010, 38(6): 3811.
Examples
# EXAMPLE 1 (INTERFACE=FORMULA)
# To select the regularization parameters based on AIC.
n = 50
sigma = 0.1
alpha = matrix(1,2,1)
alpha = alpha/norm(alpha,"2")
beta = matrix(4,1,1)
x = matrix(1,n,1)
z = matrix(runif(n*2),n,2)
y = 4*((z%*%alpha-1/sqrt(2))^2) + x%*%beta + sigma*matrix(rnorm(n),n,1)
fit_plsimest = plsim.est(y~x|z)
# Select the regularization parameters by AIC
res = plsim.lam(y~x|z,h=fit_plsimest$data$h,zetaini = fit_plsimest$zeta,
lambda_selector='AIC')
# EXAMPLE 2 (INTERFACE=DATA FRAME)
# To select the regularization parameters based on AIC.
n = 50
sigma = 0.1
alpha = matrix(1,2,1)
alpha = alpha/norm(alpha,"2")
beta = matrix(4,1,1)
x = rep(1,n)
z1 = runif(n)
z2 = runif(n)
X = data.frame(x)
Z = data.frame(z1,z2)
x = data.matrix(X)
z = data.matrix(Z)
y = 4*((z%*%alpha-1/sqrt(2))^2) + x%*%beta + sigma*matrix(rnorm(n),n,1)
fit_plsimest = plsim.est(xdat=X,zdat=Z,ydat=y)
# Select the regularization parameters by AIC
res2 = plsim.lam(xdat=X,ydat=y,zdat=Z,h=fit_plsimest$data$h,
zetaini = fit_plsimest$zeta, lambda_selector='AIC')