get.zeta {icmm}R Documentation

Local posterior probability estimation

Description

This function estimates the local posterior probability when assuming no prior on structured predictors.

Usage

get.zeta(SS, w, alpha)

Arguments

SS

a scalar value of sufficient statistic for regression coefficient.

w

a scalar value of mixing weight.

alpha

a scalar value of hyperparameter alpha.

Details

Given all other parameters, this function estimates the local posterior probability or the probability that a regression coefficient is not zero conditional on other parameters. This function is called when assuming no prior on structured predictors.

Value

Return a scalar value of local posterior probability.

Author(s)

Vitara Pungpapong, Min Zhang, Dabao Zhang

Examples

data(simGaussian)
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)
# Obtain the final output from ebvs
output<-icmm(Y, X, b0.start=0, b.start=initbeta, family = "gaussian", 
        ising.prior = FALSE, 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)
# 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(SS=SS, w=w, alpha=alpha)

[Package icmm version 1.2 Index]