Title: | Factor-Augmented Sparse Regression Tuning-Free Testing |
---|---|
Description: | The 'FAS' package implements the bootstrap method for the tuning parameter selection and tuning-free inference on sparse regression coefficient vectors. Currently, the test could be applied to linear and factor-augmented sparse regressions, see Lederer & Vogt (2021, JMLR) <https://www.jmlr.org/papers/volume22/20-539/20-539.pdf> and Beyhum & Striaukas (2023) <arXiv:2307.13364>. |
Authors: | Jonas Striaukas [cre, aut], Jad Beyhum [aut] |
Maintainer: | Jonas Striaukas <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0.0 |
Built: | 2024-11-11 03:28:18 UTC |
Source: | https://github.com/jstriaukas/fas |
Bootstrap methods for selecting the tuning parameter for LASSO-type regression models and testing sparse regression coefficients
Jonas Striaukas (maintainer) [email protected]
Test of the factor model against factor augmented sparse alternative
factorsparsetest(x, y, w = NULL, q.levels = c(0.90, 0.95, 0.99), p.value = FALSE, rmax = 10, ...)
factorsparsetest(x, y, w = NULL, q.levels = c(0.90, 0.95, 0.99), p.value = FALSE, rmax = 10, ...)
x |
T by p data matrix, where T and p respectively denote the sample size and the number of regressors. |
y |
T by 1 response variable. |
w |
T BY k additional regressors added in to the factor model under H0. |
q.levels |
quantile levels of effective noise. |
p.value |
whether pvalue should be computed. Default is |
rmax |
maximum number of factors. Use in eigenvalue ratio estimator. Default is 10. |
... |
other arguments that can be passed to lassofit. |
Computes the test statistic and the p-value for testing the factor model against factor augmented sparse alternative. The number of factors are estimated by eigenvalue ratio estimator.
factorsparsetest object.
Jonas Striaukas
set.seed(1) x = matrix(rnorm(100 * 20), 100, 20) beta = c(5,4,3,2,1,rep(0, times = 15)) y = x%*%beta + rnorm(100) factorsparsetest(x = x, y = y)
set.seed(1) x = matrix(rnorm(100 * 20), 100, 20) beta = c(5,4,3,2,1,rep(0, times = 15)) y = x%*%beta + rnorm(100) factorsparsetest(x = x, y = y)
Fits effective noise of LASSO regressions.
lassofit(x, y, q.levels = c(0.90, 0.95, 0.99), p.value = FALSE, numboot = 1000L, nlambda = 100L, lambda.factor = ifelse(nobs < nvars, 1e-02, 1e-04), lambda = NULL, pf = rep(1, nvars), dfmax = nvars + 1, pmax = min(dfmax * 1.2, nvars), standardize = FALSE, intercept = FALSE, eps = 1e-08, maxit = 1000000L)
lassofit(x, y, q.levels = c(0.90, 0.95, 0.99), p.value = FALSE, numboot = 1000L, nlambda = 100L, lambda.factor = ifelse(nobs < nvars, 1e-02, 1e-04), lambda = NULL, pf = rep(1, nvars), dfmax = nvars + 1, pmax = min(dfmax * 1.2, nvars), standardize = FALSE, intercept = FALSE, eps = 1e-08, maxit = 1000000L)
x |
T by p data matrix, where T and p respectively denote the sample size and the number of regressors. |
y |
T by 1 response variable. |
q.levels |
quantile levels of effective noise. |
p.value |
whether pvalue should be computed. Default is |
numboot |
bootstrap replications. |
nlambda |
number of |
lambda.factor |
The factor for getting the minimal |
lambda |
a user-supplied lambda sequence. By leaving this option unspecified (recommended), users can have the program compute its own |
pf |
the ℓ1 penalty factor of length |
dfmax |
the maximum number of variables allowed in the model. Useful for very large |
pmax |
the maximum number of coefficients allowed ever to be nonzero. For example, once βi ≠ 0 for some i ∈ [p], no matter how many times it exits or re-enters the model through the path, it will be counted only once. Default is |
standardize |
logical flag for variable standardization, prior to fitting the model sequence. The coefficients are always returned to the original scale. It is recommended to keep |
intercept |
whether intercept be fitted ( |
eps |
convergence threshold for block coordinate descent. Each inner block coordinate-descent loop continues until the maximum change in the objective after any coefficient update is less than thresh times the null deviance. Defaults value is |
maxit |
maximum number of outer-loop iterations allowed at fixed lambda values. Default is |
Fits effective noise of LASSO regressions.
lassofit object.
Jonas Striaukas
set.seed(1) x = matrix(rnorm(100 * 20), 100, 20) beta = c(5,4,3,2,1,rep(0, times = 15)) y = x%*%beta + rnorm(100) lassofit(x = x, y = y)
set.seed(1) x = matrix(rnorm(100 * 20), 100, 20) beta = c(5,4,3,2,1,rep(0, times = 15)) y = x%*%beta + rnorm(100) lassofit(x = x, y = y)