HC {WpProj}R Documentation

Run the Hahn-Carvalho Method

Description

[Experimental] Runs the Hahn-Carvalho method but adapted to return full distributions.

Usage

HC(
  X,
  Y = NULL,
  theta,
  family = "gaussian",
  penalty = c("elastic.net", "selection.lasso", "lasso", "ols", "mcp", "scad", "mcp.net",
    "scad.net", "grp.lasso", "grp.lasso.net", "grp.mcp", "grp.scad", "grp.mcp.net",
    "grp.scad.net", "sparse.grp.lasso"),
  method = c("selection.variable", "projection"),
  lambda = numeric(0),
  nlambda = 100L,
  lambda.min.ratio = NULL,
  alpha = 1,
  gamma = 1,
  tau = 0.5,
  groups = numeric(0),
  penalty.factor = NULL,
  group.weights = NULL,
  maxit = 500L,
  tol = 1e-07,
  irls.maxit = 100L,
  irls.tol = 0.001
)

Arguments

X

Covariates

Y

Predictions

theta

Parameters

family

Family for method. See oem.

penalty

Penalty function. See oem.

method

Should we run a selection variable methodology or projection?

lambda

lambda for lasso. See oem for this and all options below

nlambda

Number of lambda values.

lambda.min.ratio

Minimum lambda ratio for self selected lambda

alpha

elastic net mixing.

gamma

tuning parameters for SCAD and MCP

tau

mixing parameter for sparse group lasso

groups

A vector of grouping values

penalty.factor

Penalty factor for OEM.

group.weights

Weights for groupped lasso

maxit

Max iteration for OEM

tol

Tolerance for OEM

irls.maxit

IRLS max iterations for OEM

irls.tol

IRLS tolerance for OEM

Value

a WpProj object with selected covariates and their values

References

Hahn, P. Richard and Carlos M. Carvalho. (2014) "Decoupling Shrinkage and Selection in Bayesian Linear Models: A Posterior Summary Perspective." https://arxiv.org/pdf/1408.0464.pdf

Examples

n <- 32
p <- 10
s <- 99
x <- matrix( 1, nrow = n, ncol = p )
beta <- (1:10)/10
y <- x %*% beta
post_beta <- matrix(beta, nrow=p, ncol=s) 
post_mu <- x %*% post_beta

fit <-  HC(X=x, Y=post_mu, theta = post_beta,
               penalty = "lasso", 
               method = "projection"
)

[Package WpProj version 0.2.1 Index]