hyperparlin {sdPrior}R Documentation

Find Scale Parameter for Inverse Gamma Hyperprior of Linear Effects with Spike and Slab Prior

Description

This function implements a optimisation routine that computes the scale parameter bb and selection parameter rr. Here, we assume an inverse gamma prior IG(aa,bb) for τ2\tau^2 and βδ,τ2N(0,r(δ)τ2)\beta|\delta,\tau^2\sim N(0,r(\delta)\tau^2). For given shape paramter aa the user gets bb, rr such that approximately P(βc2spike)1α2P(\beta\le c2|spike)\ge 1-\alpha2 and P(βc1slab)1α1P(\beta\ge c1|slab)\ge 1-\alpha1 hold.
Note that if you observe numerical instabilities try not to specify α1\alpha1 and α2\alpha2 smaller than 0.1.

Usage

hyperparlin(alpha1 = 0.1, alpha2 = 0.1, c1 = 0.1, c2 = 0.1,
  eps = .Machine$double.eps, a = 5)

Arguments

alpha1

denotes the 1-α1\alpha1 level for bb.

alpha2

denotes the 1-α2\alpha2 level for rr.

c1

denotes the expected range of the linear effect in the slab part.

c2

denotes the expected range of the linear effect in the spike part.

eps

denotes the error tolerance of the result, default is .Machine$double.eps.

a

is the shape parameter of the inverse gamma distribution, default is 5.

Value

an object of class list with root values rr, bb from uniroot.

Warning

α1\alpha1 and α2\alpha2 should not be smaller than 0.1 due to numerical sensitivity and possible instability. Better change c1c1, c2c2.

Author(s)

Nadja Klein

References

Nadja Klein, Thomas Kneib, Stefan Lang and Helga Wagner (2016). Automatic Effect Selection in Distributional Regression via Spike and Slab Priors. Working Paper.

Examples

set.seed(123)
result <- hyperparlin()
r <- result$r
b <- result$b

hyperparlin(alpha1=0.1,alpha2=0.1,c1=0.5,c2=0.1,a=5) 


[Package sdPrior version 1.0-0 Index]