theta_jk ~ pi N(0, tau^2) + (1 - pi) delta_0. Because the slab is
conjugate the posterior inclusion probability of each coordinate is
available exactly, and it recovers a sparse truth: coordinates whose
observed value is large relative to the noise level 1/sqrt(n) get
inclusion probabilities near one, the rest near zero.
Usage
Ghosalwnadapt(y = NULL, n = 400, pi_incl = 0.2, tau2 = 1, seed = 42)
Arguments
- y
Numeric vector of observed coordinates; simulated when NULL.
- n
Precision (sample size) of each coordinate.
- pi_incl
Prior inclusion probability, in (0, 1).
- tau2
Slab variance.
- seed
Seed for the deterministic draw of y.
Value
List with estimate (first inclusion probability),
inclusion_probs, method.
Details
Formula: p_k = 1 / (1 + exp(l_0 - l_1)) with
l_1 = log(pi) + log phi(y_k; 0, 1/n + tau2),
l_0 = log(1 - pi) + log phi(y_k; 0, 1/n).
References
Ghosal & van der Vaart (2017), Fundamentals of
Nonparametric Bayesian Inference, CUP, section 10.3.2.
Examples
Ghosalwnadapt()
#> $estimate
#> [1] 1
#>
#> $inclusion_probs
#> [1] 1.00000000 1.00000000 0.05258736 0.01427602 0.02185807 0.05705080 0.02346064
#> [8] 0.01274937
#>
#> $method
#> [1] "spike-slab adaptation (GvdV 2017 sec. 10.3.2)"
#>
#> attr(,"class")
#> [1] "morie_rich_result" "list"