sparse_linear_summary.Rd
Sparse linear summary
sparse_linear_summary(
X,
fhatmat = X %*% betaSamples,
betaSamples,
sigma2Samples = NA,
adaptive = TRUE,
varnames = NA,
alpha = 0.05,
...
)
N p design matrix
N NMC matrix of posterior draws of the function f, where N is the number of observations and NMC is the number of Monte Carlo posterior samples. The user must specify fhatmat OR betaSamples
p NMC matrix of posterior draws of the coefficients for the (generalized) linear model
Optional vector of posterior samples for the residual variance (for a linear model)
if TRUE (default), use adaptive lasso, weighting by the posterior mean. See Hahn and Carvalho (2015)
Optional vector of variable names
Return the alpha/2 and 1-alpha/2 posterior credible intervals for the summary
other arguments, e.g., to glmnet
Compute a sparse linear summary of a nonparametric regression model or high-dimensional (generalized) linear model