Learn R Programming

fabCI (version 0.2)

ebayes_est: Empirical Bayes estimation of hyperparameters

Description

Compute emprirical Bayes estimates of the error variance and distribution of the regression coefficients.

Usage

ebayes_est(y, X, emu = FALSE, dof = min(50, round(0.5 * (dim(X)[1] -
  dim(X)[2]))))

Arguments

y

a numeric vector of data

X

a design matrix

emu

(logical) estimate mean of coefficient (TRUE) or assume it is zero (FALSE)?

dof

degrees of freedom to use for the t-quantiles (the remainder go to adaptive estimation of the prior)

Value

A list (s,sigma2,tau2,mu) where

  1. s an estimate of the error standard deviation

  2. sigma2 an estimate of the error variance, independent of s

  3. tau2 an estimate of the coefficient variance, independent of s

  4. mu an estimate of the coefficient mean, independent of s

Details

This function computes the adaptive FAB confidence interval for each coefficient in a linear regression model.