R: Images of models used in Bayesian model averaging
image.bas
R Documentation
Images of models used in Bayesian model averaging
Description
Creates an image of the models selected using bas.
Usage
## S3 method for class 'bas'
image(x, top.models=20, intensity=TRUE, prob=TRUE, log=TRUE,
rotate=TRUE, color="rainbow", subset=NULL, offset=.75, digits=3,
vlas=2,plas=0,rlas=0, ...)
Arguments
x
A BMA object of type 'bas' created by BAS
top.models
Number of the top ranked models to plot
intensity
Logical variable, when TRUE image intensity is
proportional to the probability or log(probability) of the model,
when FALSE, intensity is binary indicating just presence (light) or
absence (dark) of a variable.
prob
Logical variable for whether the area in the image for
each model should be proportional to the posterior probability (or log
probability) of the model (TRUE) or with equal area (FALSE).
log
Logical variable indicating whether the intensities should
be based on log posterior odds (TRUE) or posterior
probabilities (FALSE). The log of the posterior odds is for
comparing the each model to the worst model in the top.models.
rotate
Should the image of models be rotated so that models are
on the y-axis and variables are on the x-axis (TRUE)
color
The color scheme for image intensities. The value
"rainbow" uses the rainbow palette. The value "blackandwhite"
produces a black and white image (greyscale image)
subset
indices of variables to include in plot; 1 is the
intercept
offset
numeric value to add to intensity
digits
number of digits in posterior probabilities to keep
vlas
las parameter for placing variable names; see par
plas
las parameter for posterior probability axis
rlas
las parameter for model ranks
...
Other parameters to be passed to the image and axis functions.
Details
Creates an image of the model space sampled using bas.
If a subset of the top models are plotted, then probabilities are
renormalized over the subset.
Note
Suggestion to allow area of models be proportional to posterior
probability due to Thomas Lumley
Clyde, M. (1999) Bayesian Model Averaging and Model Search Strategies (with discussion). In Bayesian Statistics 6. J.M. Bernardo, A.P. Dawid, J.O. Berger, and A.F.M. Smith eds. Oxford University Press, pages 157-185.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BAS)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/BAS/image.bma.Rd_%03d_medium.png", width=480, height=480)
> ### Name: image.bas
> ### Title: Images of models used in Bayesian model averaging
> ### Aliases: image.bas image
> ### Keywords: regression
>
> ### ** Examples
>
> require(graphics)
> data("Hald")
> hald.ZSprior = bas.lm(Y~ ., data=Hald, prior="ZS-null")
> image(hald.ZSprior, subset=-1)
>
>
>
>
>
> dev.off()
null device
1
>