sparse_linear_summary: Sparse linear summaries

View source: R/sparse_linear_summary.R

sparse_linear_summaryR Documentation

Sparse linear summaries

Description

Sparse linear summary

Usage

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

Arguments

X

N \times p design matrix

fhatmat

N \times 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 \times 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(s)

Spencer Woody


spencerwoody/possum documentation built on Aug. 5, 2022, 12:18 a.m.