## S3 method for class 'bas'
fitted(object, type="HPM", top=NULL, ...)
Arguments
object
An object of class 'bma' as created by bas
type
type of fitted value to return. Options include
'HPM' the highest probability model
'BMA' Bayesian model averaging, using optionally only the 'top'
models
'MPM' the median probability model of Barbieri and Berger.
top
optional argument specifying that the 'top' models will be
used in constructing the BMA prediction, if NULL all models will be
used. If top=1, then this is equivalent to 'HPM'
...
optional arguments, not used currently
Details
Calcuates fitted values at observed design matrix using either
the highest probability model, 'HPM', the posterior mean (under BMA)
'BMA', or the median probability model 'MPM'. The median probability
model is defined by including variable where the marginal inclusion
probability is greater than or equal to 1/2. For type="BMA", the
weighted average may be based on using a subset of the highest
probability models if an optional argument is given for top. By
default BMA uses all sampled models, which may take a while to compute
if the number of variables or number of models is large.
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/fitted.bma.Rd_%03d_medium.png", width=480, height=480)
> ### Name: fitted.bas
> ### Title: Fitted values for a BAS BMA objects
> ### Aliases: fitted.bas fitted
> ### Keywords: regression
>
> ### ** Examples
>
> data(Hald)
> hald.gprior = bas.lm(Y~ ., data=Hald, prior="ZS-null", initprobs="Uniform")
> plot(Hald$Y, fitted(hald.gprior, type="HPM"))
> plot(Hald$Y, fitted(hald.gprior, type="BMA"))
> plot(Hald$Y, fitted(hald.gprior, type="MPM"))
>
>
>
>
>
> dev.off()
null device
1
>