View source: R/STAR_Bayesian.R
| init_lm_gprior | R Documentation |
Initialize the parameters for a linear regression model assuming a g-prior for the coefficients.
init_lm_gprior(y, X, X_test = NULL)
y |
|
X |
|
X_test |
|
a named list params containing at least
mu: vector of conditional means (fitted values)
sigma: the conditional standard deviation
coefficients: a named list of parameters that determine mu
Additionally, if X_test is not NULL, then the list includes an element
mu_test, the vector of conditional means at the test points
The parameters in coefficients are:
beta: the p x 1 vector of regression coefficients
components of beta
# Simulate data for illustration:
sim_dat = simulate_nb_lm(n = 100, p = 5)
y = sim_dat$y; X = sim_dat$X
# Initialize:
params = init_lm_gprior(y = y, X = X)
names(params)
names(params$coefficients)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.