Description Usage Arguments Details Value Author(s) Examples
View source: R/get.beta.ising.R
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.
1 | get.beta.ising(SS, wpost, alpha, scaledfactor)
|
SS |
a sufficient statistic for a regression coefficient. |
wpost |
a posterior probability of mixing weight. |
alpha |
a scalar value for hyperparameter |
scaledfactor |
a scalar value for multiplicative factor. |
Given a posterior probability of mixing weight, empirical Bayes thresholding is employed to obtain a posterior median of a regression coefficient.
a scalar value of regression coefficient.
Vitara Pungpapong, Min Zhang, Dabao Zhang
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.