HSDC: Horseshoe with unpenalized design covariates

Description Usage Arguments Value References Examples

View source: R/HSDC.R

Description

This is the horseshoe model described by Carvalho et al. (2010), but with the allowance for a set of covariates that are not penalized. For example, you may wish to include variables such as age and gender in all models so that the coefficients for the other variables are penalized while controlling for these. This is a common need in research.

This tends to run very quickly even for larger data sets or larger numbers of predictors and in my experience is faster and more stable (at least on the tested data sets!) than the same model implemetned in Stan.

Model Specification:



Plugin Pseudo-Variances:


Usage

1
2
3
HSDC(formula, design.formula, data, log_lik = FALSE, iter = 4000,
  warmup = 3000, adapt = 3000, chains = 4, thin = 2,
  method = "rjparallel", cl = makeCluster(2), ...)

Arguments

formula

the model formula

design.formula

formula for the design covariates.

data

a data frame.

log_lik

Should the log likelihood be monitored? The default is FALSE.

iter

How many post-warmup samples? Defaults to 10000.

warmup

How many warmup samples? Defaults to 1000.

adapt

How many adaptation steps? Defaults to 2000.

chains

How many chains? Defaults to 4.

thin

Thinning interval. Defaults to 1.

method

Defaults to "rjparallel". For an alternative parallel option, choose "parallel" or. Otherwise, "rjags" (single core run).

cl

Use parallel::makeCluster(# clusters) to specify clusters for the parallel methods. Defaults to two cores.

...

Other arguments to run.jags.

design.formula

formula for the design covariates.

Value

an rjags object

References

Carvalho, C. M., Polson, N. G., and Scott, J. G. (2010). The horseshoe estimator for sparse signals. Biometrika, 97(2):465–480.

Examples

1
HSDC()

abnormally-distributed/Bayezilla documentation built on Oct. 31, 2019, 1:57 a.m.