View source: R/g_regression_fast_const.R
| g_regression_fast_const | R Documentation |
The function implements Bayesian regression with g prior (Zellner, 1986) for a model with just a constant
g_regression_fast_const(y, g = 0.5)
y |
A vector with data - only the dependent variable. |
g |
Value for g in the g prior. Default value: g = 0.5. |
A list with g_regression objects:
Expected values of coefficients
Posterior standard errors
Natural logarithm of marginal likelihood
R^2 form ols model
Degrees of freedom
Determinant of the regressors' matrix
x1 <- rnorm(100, mean = 0, sd = 1)
x2 <- rnorm(100, mean = 0, sd = 2)
e <- rnorm(100, mean = 0, sd = 5)
y <- 2 + x1 + 2*x2 + e
g_result <- g_regression_fast_const(y, g = 0.99)
g_result[[1]]
g_result[[2]]
x1 <- rnorm(50, mean = 0, sd = 1)
x2 <- rnorm(50, mean = 0, sd = 2)
e <- rnorm(50, mean = 0, sd = 0.5)
y <- 2 + x1 + 2*x2 + e
g_result <- g_regression_fast_const(y, g = 1.1)
g_result[[1]]
g_result[[2]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.