lns: Number of blocks with default lns = floor(T/bns).
nboot: Number of bootstrap iterations with default nboot=5000.
post: Logical. If TRUE (default), post-Lasso estimation is conducted, i.e. a refit of the model with the selected variables.
intercept: Logical. If TRUE, intercept is included which is not penalized.
model: Logical. If TRUE (default), model matrix is returned.
X.dependent.lambda: Logical, TRUE, if the penalization parameter depends on the design of the matrix x. FALSE (default), if independent of the design matrix.
c: Constant for the penalty, default value is 2.
gamma: Constant for the penalty, default gamma=0.1/log(T) with T=data length.
numIter: Number of iterations for the algorithm for the estimation of the variance and data-driven penalty, ie. loadings.
tol: Constant tolerance for improvement of the estimated variances.
threshold: Constant applied to the final estimated lasso coefficients. Absolute values below the threshold are set to zero.
...: further parameters
Returns
rlassoHAC returns an object of class "rlasso". An object of class "rlasso" is a list containing at least the following components: - coefficients: Parameter estimates.
beta: Parameter estimates (named vector of coefficients without intercept).
intercept: Value of the intercept.
index: Index of selected variables (logical vector).
lambda: Data-driven penalty term for each variable, product of lambda0 (the penalization parameter) and the loadings.
lambda0: Penalty term.
loadings: Penalty loadings, vector of lenght p (no. of regressors).
residuals: Residuals, response minus fitted values.
sigma: Root of the variance of the residuals.
iter: Number of iterations.
call: Function call.
options: Options.
model: Model matrix (if model = TRUE in function call).
Examples
set.seed(1)T =100#sample sizep =20# number of variablesb =5# number of variables with non-zero coefficientsbeta0 = c(rep(10,b), rep(0,p-b))rho =0.1#AR parameterCov = matrix(0,p,p)for(i in1:p){for(j in1:p){ Cov[i,j]=0.5^(abs(i-j))}}C <- chol(Cov)X <- matrix(rnorm(T*p),T,p)%*%C
eps <- arima.sim(list(ar=rho), n = T+100)eps <- eps[101:(T+100)]Y = X%*%beta0 + eps
reg.lasso.hac1 <- rlassoHAC(X, Y,"Bartlett")#lambda is chosen independent of regressor #matrix X by default.bn =10# block lengthbwNeweyWest =0.75*(T^(1/3))reg.lasso.hac2 <- rlassoHAC(X, Y,"Bartlett", bands=bwNeweyWest, bns=bn, nboot=5000, X.dependent.lambda =TRUE, c=2.7)