Helper function for MC3.REG which implements each step of the Metropolis-Hastings algorithm.
For.MC3.REG(i, g, Ys, Xs, PI, K, nu, lambda, phi, outs.list)
a list containing the current state and the history of the Markov-Chain, with components
a 0/1 number specifying whether the previous Metropolis-Hastings step resulted in a changed state or not.
a matrix containing the history of the Markov-Chain. Each row represents a unique model (combination of variables and outliers). The first column is the set of variables in the model (in binary form), the second column is the set of outliers in the model (in binary form), the third column is the log-posterior for the model (up to a constant) and the fourth column is the number of times that model has been visited.
a logical vector specifying the variables in the current model.
a logical vector specifying the outliers in the current model.
a number representing the variables in the current model in binary form.
a number represnting the outliers in the current model in binary form.
the number of potential outliers
the current iteration number.
a list containing the current state and the history of the Markov-Chain. This list is in the same form as the return value (see the 'value' section below):
a logical vector specifying the variables in the current model.
a logical vector specifying the outliers in the current model.
a number representing the variables in the current model in binary form.
a number represnting the outliers in the current model in binary form.
the number of potential outliers
the vector of scaled responses.
the matrix of scaled covariates.
a hyperparameter indicating the prior probability of an outlier. The default values are 0.1 if the data set has less than 50 observations, 0.02 otherwise.
a hyperparameter indicating the outlier inflation factor
regression hyperparameter. Default value is 2.58 if r2 for the full model is less than 0.9 or 0.2 if r2 for the full model is greater than 0.9.
regression hyperparameter. Default value is 0.28 if r2 for the full model is less than 0.9 or 0.1684 if r2 for the full model is greater than 0.9.
regression hyperparameter. Default value is 2.85 if r2 for the full model is less than 0.9 or 9.2 if r2 for the full model is greater than 0.9.
a vector of all potential outlier locations
(e.g. c(10,12)
means the 10th and 12th points are
potential outliers).
If NULL
and if outliers
is TRUE
,
then potential outliers are estimated using the
out.ltsreg
function.
Jennifer Hoeting jennifer.hoeting@gmail.com with the assistance of Gary Gadbury. Translation from Splus to R by Ian Painter ian.painter@gmail.com.
This function implements a single Metropolis-Hastings step, choosing a proposal model, calculating the Bayes Factor between the current model and proposal model, and updating the current model to the proposal model if the step results in an update.
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: https://www.stat.colostate.edu/~jah/papers/
MC3.REG
, MC3.REG.choose
, MC3.REG.logpost