The function gdensity
estimates and plots the posterior density for
the shrinkage factor \(g/(1+g)\)
This is evidently only possible if the
shrinkage factor if not fixed, i.e. if the bma object x
was estimated
with a hyper-g prior - cf. argument g
in bms
The
density is based only on the best models retained in the bma object
x
, cf. argument nmodel
in bms
A note on
argument n
: The points at which the density is estimated start at
\(max(0,E-5*SD)\), where \(E\) and \(SD\) are the expected value and
standard deviation of the shrinkage factor, respectively. For plotting the
entire domain \((0,1)\) use xlim=c(0,1)
as an argument for
gdensity
.
The argument addons
specifies what additional information should be
added to the plot(s) via the low-level commands lines
and
legend
:
"e"
for the posterior expected value (EV) of
the shrinkage factor,
"s"
for 2 times posterior standard deviation
(SD) bounds,
"m"
for the posterior median,
"f"
for
posterior expected values of the individual models whom the density is
averaged over,
"z"
for a zero line, "l"
for including a
legend
The following two are only possible if the bma
object collected statistics on shrinkage, cf. argument g.stats
in
bms
"E"
for posterior expected value under MCMC
frequencies (see argument exact
in coef.bma
),
"S"
for the corresponding 2 times standard deviation bounds
(MCMC),
Any combination of these letters will give the desired result. Use
addons=""
for not using any of these.