tau is taken as GIVEN; the log marginal posterior of tau, up to an additive constant and under a flat prior, is returned so a caller can profile or grid over it.
Details
Formula: mu_hat and V_mu from (5.20); theta_hat_j and V_j from (5.17); log p(tau|y) from (5.21) with a flat prior
References
Gelman, Carlin, Stern, Dunson, Vehtari & Rubin (2013), Bayesian Data Analysis, 3rd edition, Section 5.4, equations (5.17), (5.20) and (5.21). A flat prior on tau is used and the additive constant dropped, so the value is comparable across tau but is not an absolute density.
Examples
Hiermodel(y = c(1, 2, 3, 4, 5, 6, 7, 8), sigma = c(1, 2, 3, 4, 5, 6, 7, 8), tau = 0.5)
#> $mu_hat
#> [1] 1.889335
#>
#> $V_mu
#> [1] 0.7645262
#>
#> $theta_hat
#> [1] 1.711468 1.895844 1.919353 1.921806 1.920133 1.917684 1.915277 1.913112
#>
#> $V_theta
#> [1] 0.2000000 0.2352941 0.2432432 0.2461538 0.2475248 0.2482759 0.2487310
#> [8] 0.2490272
#>
#> $shrinkage
#> [1] 0.8000000 0.9411765 0.9729730 0.9846154 0.9900990 0.9931034 0.9949239
#> [8] 0.9961089
#>
#> $log_post_tau
#> [1] -12.41711
#>
#> $tau
#> [1] 0.5
#>
#> $J
#> [1] 8
#>
#> $method
#> [1] "Hierarchical normal model, BDA3 (5.17)/(5.20)/(5.21)"
#>
#> attr(,"class")
#> [1] "morie_rich_result" "list"
