init_params_lm_hs: Initialize the parameters for a linear regression

View source: R/source_MCMC.R

init_params_lm_hsR Documentation

Initialize the parameters for a linear regression

Description

Initialize the parameters for a linear regression model assuming a horseshoe prior for the (non-intercept) coefficients. The number of predictors p may exceed the number of observations n.

Usage

init_params_lm_hs(y, X)

Arguments

y

n x 1 vector of data

X

n x p matrix of predictors

Value

a named list params containing

  1. mu n x 1 vector of conditional means (fitted values)

  2. sigma the conditional standard deviation

  3. coefficients a named list of parameters that determine mu

Note

The parameters in coefficients are:

  • beta: the p x 1 vector of regression coefficients

  • sigma_beta: the p x 1 vector of regression coefficient standard deviations (local scale parameters)

  • xi_sigma_beta: the p x 1 vector of parameter-expansion variables for sigma_beta

  • lambda_beta: the global scale parameter

  • xi_lambda_beta: the parameter-expansion variable for lambda_beta components of beta

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_params_lm_hs(y = y, X = X)
names(params)
names(params$coefficients)


drkowal/rSTAR documentation built on July 5, 2023, 2:18 p.m.