Description Usage Arguments Details Value Author(s) Examples
View source: R/get.zeta.ising.R
This function estimates the local posterior probability when assuming Ising prior on structured predictors.
1 | get.zeta.ising(SS, beta, alpha, hyperparam, structure, edgeind, j)
|
SS |
a scalar value of sufficient statistic for regression coefficient. |
beta |
a (p*1) matrix of regression coefficients. |
alpha |
a scalar value of hyperparameter |
hyperparam |
a two-dimensional vector of hyperparameters |
structure |
a data frame stores the information of structure among predictors. |
edgeind |
a vector stores primary keys of |
j |
an index ranges from 1 to p. This function estimate a local posterior probability of predictor |
Given all other parameters, this function estimates the local posterior probability or the probability that a regression coefficient is not zero conditional on other par ameters. This function is called when assuming Ising prior on structured predictors.
Return a scalar value of local posterior probability.
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 23 24 25 26 27 28 | data(simGaussian)
data(linearrelation)
Y<-as.matrix(simGaussian[,1])
X<-as.matrix(simGaussian[,-1])
n<-dim(X)[1]
# Obtain initial values from lasso
data(initbetaGaussian)
initbeta<-as.matrix(initbetaGaussian)
# Get final output from ebvs
output<-icmm(Y, X, b0.start=0, b.start=initbeta, family = "gaussian",
ising.prior = TRUE, structure=linearrelation, estalpha = FALSE,
alpha = 0.5, maxiter = 100)
b0<-output$coef[1]
beta<-matrix(output$coef[-1], ncol=1)
# Get all parameters for function arguments
w<-get.wprior(beta)
alpha<-0.5
sigma<-get.sigma(Y,X,beta,alpha)
edgeind<-sort(unique(linearrelation[,1]))
hyperparam<-get.ab(beta, linearrelation, edgeind)
# Estimate local posterior probability
j<-1
Yres<-Y-b0-X%*%beta+X[,j]*beta[j,1]
sxy<-t(Yres)%*%X[,j]
ssx<-sum(X[,j]^2)
SS<-sqrt(n-1)*sxy/(sigma*ssx)
zeta<-get.zeta.ising(SS=SS, beta=beta, alpha=alpha, hyperparam=hyperparam,
structure=linearrelation, edgeind=edgeind, j=j)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.