zellner: Bayesian Linear Regression with Zellner's prior.

Description Usage Arguments Value Author(s) References Examples

View source: R/Bayesian_Linear_Regression.R

Description

Bayesian Linear Regression with Zellner's prior.

Usage

1
zellner(formula, data, m1 = m1, g = g, a = a, b = b)

Arguments

formula

A string fromula.

data

A data frame with your data including response.

m1

A number of hyperparameter of the intercept.

g

A string of hyperparameter of the Zellner's prior. "typeI" is 1/n, "typeII" is 1/k^2 and "typeIII" is 1/max(n,k^2).

a

A number of hyperparameter for the gamma distribution.

b

A number of hyperparameter for the gamma distribution.

Value

A list with the estimated coefficients and standard deviations of the model from the Classical and Bayesian approach

Author(s)

Camilo Gonzalez <cigonzalez2@uc.cl>

References

L. Fahrmeir, T. Kneib, S. Lang, and B. Marx, Regression: Models, Methods and Applications. Springer-Verlag GmbH, 2013.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
a <- 0.0001
b <- 0.0001
test <- zellner(
formula = 'dist ~ speed', 
data = cars,
m1 = 0,
g = 'typeI',
a = a,
b = b 
)
test$classic_coef
test$classic_sigma
test$bayesian_coef
test$bayesian_sigma

cigonzalez2/BLR documentation built on Oct. 25, 2020, 4:58 p.m.