get.beta.ising: Obtain a regression coefficient when assuming Ising prior...

Description Usage Arguments Details Value Author(s) Examples

View source: R/get.beta.ising.R

Description

Given a sufficient statistic for a regression coefficient, this function estimates a coefficient when assuming the Ising model to incorporate the prior of structured predictors.

Usage

1
get.beta.ising(SS, wpost, alpha, scaledfactor)

Arguments

SS

a sufficient statistic for a regression coefficient.

wpost

a posterior probability of mixing weight.

alpha

a scalar value for hyperparameter alpha.

scaledfactor

a scalar value for multiplicative factor.

Details

Given a posterior probability of mixing weight, empirical Bayes thresholding is employed to obtain a posterior median of a regression coefficient.

Value

a scalar value of regression coefficient.

Author(s)

Vitara Pungpapong, Min Zhang, Dabao Zhang

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
data(simGaussian)
Y<-as.matrix(simGaussian[,1])
X<-as.matrix(simGaussian[,-1])
n<-dim(X)[1]
data(linearrelation)
edgeind<-sort(unique(linearrelation[,1]))
# Obtain initial values from lasso
data(initbetaGaussian)
beta<-as.matrix(initbetaGaussian)
# Initiate all other parameters
alpha<-0.5
sigma<-get.sigma(Y=Y, X=X, beta=beta, alpha=alpha)
hyperparam<-get.ab(beta, linearrelation, edgeind)
# Obtain regression coefficient
j<-1
Yres<-Y-X%*%beta+X[,j]*beta[j,1]
sxy<-t(Yres)%*%X[,j]
ssx<-sum(X[,j]^2)
SS<-sqrt(n-1)*sxy/(sigma*ssx)
wpost<-get.wpost(SS, beta, alpha, hyperparam, linearrelation, edgeind, j)
beta[j,1]<-get.beta.ising(SS=SS, wpost=wpost, alpha=alpha, 
           scaledfactor=sigma/sqrt(n-1))

icmm documentation built on May 26, 2021, 9:06 a.m.