plotModelsize {BMS} | R Documentation |
Plots posterior and prior model size distribution
plotModelsize(
bmao,
exact = FALSE,
ksubset = NULL,
include.legend = TRUE,
do.grid = TRUE,
...
)
bmao |
a 'bma' object (cf. |
exact |
if |
ksubset |
integer vector detailing for which model sizes the plot should be done |
include.legend |
if |
do.grid |
if |
... |
parameters passed on to |
As a default, plotModelsize
plots the posterior model size
distribution as a blue line, and the prior model distribution as a dashed
red line.
In addition, it returns a list with the following elements:
mean |
The posterior expected value of model size |
var |
The variance of the posterior model size distribution |
dens |
A vector
detailing the posterior model size distribution from model size |
See also bms
, image.bma
,
density.bma
, plotConv
Check http://bms.zeugner.eu for additional help.
data(datafls)
mm=bms(datafls,burn=1500, iter=5000, nmodel=200,mprior="fixed",mprior.size=6)
#plot Nb.1 based on aggregate results
postdist= plotModelsize(mm)
#plot based only on 30 best models
plotModelsize(mm[1:30],exact=TRUE,include.legend=FALSE)
#plot based on all best models, but showing distribution only for model sizes 1 to 20
plotModelsize(mm,exact=TRUE,ksubset=1:20)
# create a plot similar to plot Nb. 1
plot(postdist$dens,type="l")
lines(mm$mprior.info$mp.Kdist)