Sparse linear summary

sparse_linear_summary(
  X,
  fhatmat = X %*% betaSamples,
  betaSamples,
  sigma2Samples = NA,
  adaptive = TRUE,
  varnames = NA,
  alpha = 0.05,
  ...
)

Arguments

X

N p design matrix

fhatmat

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

betaSamples

p NMC matrix of posterior draws of the coefficients for the (generalized) linear model

sigma2Samples

Optional vector of posterior samples for the residual variance (for a linear model)

adaptive

if TRUE (default), use adaptive lasso, weighting by the posterior mean. See Hahn and Carvalho (2015)

varnames

Optional vector of variable names

alpha

Return the alpha/2 and 1-alpha/2 posterior credible intervals for the summary

...

other arguments, e.g., to glmnet

Details

Compute a sparse linear summary of a nonparametric regression model or high-dimensional (generalized) linear model

Author

Spencer Woody