model{
for (i in 1:N) {
#model for phenotype
pheno[i] ~ dbern.aux(z[i]) #discrete distribution defined on {0,1}
z[i]~dnorm(mu[i],1) #the probability associated with the value 1 is given by
# I(arg >= 0) where arg denotes the parameter z[i] in this case
#Genotypes
for (j in 1:Q) {
X[i, j] <- geno[i, j]
}
}
#linear variable selection model with all SNPs
mu[1:N] <- jump.lin.pred(X[1:N, 1:C], k, tau.beta) #function of full covariate matrix X, the number of currently selected
# variables k and tau.beta, the prior precision to be assigned to all
# regression parameters (B)
id[1:6]<- jump.model.id(mu[1:N]) #function that provides an efficient means of storing the set of currently selected covariates
# i.e. current values of Theta. Its argument is the relevant variable selection model and it
# returns a sequence of integers, one for each block of 20 covariates in X that can be decoded
# by the JUMP interface.
#priors
k ~ dbin(p, C)
p ~ dbeta(1,1)
#getting predictions out
pred[1:(C + 1)] <- jump.lin.pred.pred(mu[1:N], X.pred[1:(C + 1), 1:C]) #function that predicts from the VS model specified as
#the first argument at the set of covariate values given
#by the second argument.
for (i in 1:C) {
X.pred[i, i] <- 1
for (j in 1:(i - 1)) { X.pred[i, j] <- 0}
for (j in (i + 1):C) {X.pred[i, j] <- 0}
X.pred[(C + 1), i] <- 0
effect[i] <- pred[i] - pred[C + 1]
}
}