init_lm_gprior {countSTAR} | R Documentation |
Initialize linear regression parameters assuming a g-prior
Description
Initialize the parameters for a linear regression model assuming a g-prior for the coefficients.
Usage
init_lm_gprior(y, X, X_test = NULL)
Arguments
y |
|
X |
|
X_test |
|
Value
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 determinemu
Additionally, if X_test is not NULL, then the list includes an element
mu_test
, the vector of conditional means at the test points
Note
The parameters in coefficients
are:
-
beta
: thep x 1
vector of regression coefficients components ofbeta
Examples
# 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)
[Package countSTAR version 1.0.2 Index]