Learn R Programming

BMA (version 3.12)

MC3.REG: Bayesian simultaneous variable selection and outlier identification

Description

Performs Bayesian simultaneous variable selection and outlier identification (SVO) via Markov chain Monte Carlo model composition (MC3).

Usage

MC3.REG(all.y, all.x, num.its, M0.var= , M0.out= , outs.list= , 
        outliers = TRUE, PI=.1*(length(all.y) <50) +="" .02*(length(all.y)="">= 50),  K=7, nu= , lambda= , phi= )

Arguments

Value

  • An object of class mc3. Print and summary methods exist for this class. Objects of class mc3 are a list consisting of at least
  • post.probThe posterior probabilities of each model visited.
  • variablesAn indicator matrix of the variables in each model.
  • outliersAn indicator matrix of the outliers in each model, if outliers were selected.
  • visit.countThe number of times each model was visited.
  • outlier.numbersAn index showing which outliers were eligable for selection.
  • var.namesThe names of the variables.
  • n.modelsThe number of models visited.
  • PIThe value of PI used.
  • KThe value of K used.
  • nuThe value of nu used.
  • lambdaThe value of lambda used.
  • phiThe value of phi used.
  • callThe function call.

Details

Performs Bayesian simultaneous variable and outlier selection using Monte Carlo Markov Chain Model Choice (MC3). Potential models are visited using a Metropolis-Hastings algorithm on the integrated likelihood. At the end of the chain exact posterior probabilities are calculated for each model visited.

References

Bayesian Model Averaging for Linear Regression Models Adrian E. Raftery, David Madigan, and Jennifer A. Hoeting (1997). Journal of the American Statistical Association, 92, 179-191. A Method for Simultaneous Variable and Transformation Selection in Linear Regression Jennifer Hoeting, Adrian E. Raftery and David Madigan (2002). Journal of Computational and Graphical Statistics 11 (485-507) A Method for Simultaneous Variable Selection and Outlier Identification in Linear Regression Jennifer Hoeting, Adrian E. Raftery and David Madigan (1996). Computational Statistics and Data Analysis, 22, 251-270 Earlier versions of these papers are available via the World Wide Web using the url: http://www.stat.colostate.edu/~jah/papers/

See Also

out.ltsreg as.data.frame.mc3

Examples

Run this code
# Example 1:   Scottish hill racing data.

data(race)
b<- out.ltsreg(race[,-1], race[,1], 2)
races.run1<-MC3.REG(race[,1], race[,-1], num.its=20000, c(FALSE,TRUE), 
                    rep(TRUE,length(b)), b, PI = .1, K = 7, nu = .2, 
                    lambda = .1684, phi = 9.2)
races.run1
summary(races.run1)

# Example 2: Crime data
library(MASS)
data(UScrime)

y.crime.log<- log(UScrime$y)
x.crime.log<- UScrime[,-ncol(UScrime)]
x.crime.log[,-2]<- log(x.crime.log[,-2])
crime.run1<-MC3.REG(y.crime.log, x.crime.log, num.its=2000, 
                     rep(TRUE,15), outliers = FALSE)
crime.run1[1:25,]
summary(crime.run1)

Run the code above in your browser using DataLab