bayesModel.fit: Bayesian regression model with mixture of two scaled inverse...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/BayesH.R

Description

Performs Gibbs Sampling algorithm for fitting the Bayesian regression model with mixture of two scaled inverse chi square as hyperprior distribution for variance of each regression coefficients.

Usage

1
2
 
   bayesModel.fit(X, y,  nu0, s0, niter = 2000, burnin = 500, type="bayesH")   

Arguments

X

the incidence matrix of model.

y

the vector of response variable of the model.

nu0

the degree of freedom hyperparameter(s) nu0 for all mixture components.

s0

the scale hyperparameter(s) s0 for all mixture components.

niter

the number of iterations of Gibbs Sampling algorithm.

burnin

the number of 'burn in' in a Gibbs Sampling algorithm.

type

it is a string which if were defined as “ridge” the function performs Bayesian ridge regression, otherwise, Bayes H model.

Details

For bayesian ridge regression (type == "ridge"), the prior distribution for the error variance and the hyperprior distribution for variance of the regression coefficients follows scaled inverse chi square with same hyperparameters (nu0[1], s0[1]) and (nu0[2], s0[2]), respectively.On the other hand, for hierarchical regression model (type == "bayesH") is assumed that each the regression coefficient has different variance and each one of them follows a mixture of scaled inverse chi square with hyperparameters (nu0[1]; s0[1]) and (nu0[2]; s0[2]), respectively. In this case, the prior distribution for error variance also follows scaled inverse chi square with hyperparameters nu0[3] and s0[3]. NA's in the incidence matrix are not allowed. All elements of vector s0 must be greater than zero.

Value

The output is an object of class BayesH that contains the posterior distribution of intercept, posterior distribution of variance error, posterior mean of regression coefficients and posterior mean of predicted values.

Author(s)

Renato Rodrigues Silva, renato.rrsilva@ufg.br

See Also

get.scale.bayesH

Examples

1
2
3
4
5
6
data(example)

mod = bayesModel.fit(X = X, y = y, nu0 = c(3,30,20), 
                     s0 =  c(1e-10,0.1, 0.5), niter = 2000, 
                     burnin = 300, type = "bayesH" )
summary(mod)

BayesH documentation built on May 1, 2019, 6:28 p.m.