get_theta_linear {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 v_2
and selection parameter
r
of the inverse gamma prior IG(v_1
,v_2
) for \tau^2
when \tau^2\sim N(0,r(\delta)\tau^2)
and given shape paramter
such that approximately P(\beta\le c_2|spike)\ge 1-\alpha_2
and P(\beta\ge c_1|slab)\ge 1-\alpha1
.
\alpha_1
and \alpha_2
should not be smaller than 0.1 due to numerical sensitivity and possible instability. Better change c_1
, c_2
.
Usage
get_theta_linear(alpha1 = 0.1, alpha2 = 0.1, c1 = 0.1, c2 = 0.1,
eps = .Machine$double.eps, v1 = 5)
Arguments
alpha1 |
denotes the 1- |
alpha2 |
denotes the 1- |
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 |
v1 |
is the shape parameter of the inverse gamma distribution, default is 5. |
Value
an object of class list
with values from uniroot
.
Warning
\alpha_1
and \alpha_2
should not be smaller than 0.1 due to numerical sensitivity and possible instability. Better change c_1
, c_2
.
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 <- get_theta_linear()
r <- result$r
v2 <- result$v2
get_theta_linear(alpha1=0.1,alpha2=0.1,c1=0.5,c2=0.1,v1=5)