model
{
  K <-1000
  for(i in 1:n)
  {	   	        
      # 1: mean
      logit(ph1[i,1])  <- inprod(b[], xmu.1[i,]) 
      cloglog(ph1[i,2])<- inprod(b[], xmu.1[i,]) 
      probit(ph1[i,3]) <- inprod(b[], xmu.1[i,])
      mu[i] <- inprod(ph1[i, ],link[1,])

      # 2: sum  
      log(den[i]) <- inprod(d[],  xsum.1[i,])

      s[i,1]<- den[i]*mu[i]
  	  s[i,2]<- den[i]*(1-mu[i])	
        	  
      ll[i]<- (s[i,1]-1)*log(y[i])+(s[i,2]-1)*log(1-y[i])+
                  loggam(s[i,1]+s[i,2])-loggam(s[i,1])-loggam(s[i,2])
      trick[i] <- K-ll[i]
      zero[i] ~ dpois(trick[i]) 
      ypred[i] <- mu[i]
  }

  #################      regression coeff   ################## 
  tmp1 ~ dnorm(0, hyper[1,1])
  b[1] <- tmp1
  for(i in 1:(p.xmu-1))
	{
    ###   diffuse normal ###
		b.tmp[i,1] ~ dnorm(0.0, hyper[1,2]) 
     
    ###   L1 (lasso) ### 
		b.tmp[i,2] ~ dnorm(0.0,taub.L1[i]);  
    taub.L1[i] <- 1/sigmab.L1[i]; 	        
    sigmab.L1[i] ~ dexp(hyper[1,3]); 

    ###   L2  (ridge) ###
    b.tmp[i,3] ~ dnorm(0.0,taub.L2); 
		
		###   ARD  ###
		b.tmp[i,4] ~ dnorm(0.0,taub.ARD[i]);       
    taub.ARD[i] ~ dgamma(hyper[1,5], hyper[1,5]); 	      
    
    b[i+1] <- inprod(b.tmp[i, ],prior1[1,])   
 	}
  taub.L2 ~ dgamma(hyper[1,4],hyper[1,4]);  # L2 (ridge)
  

  tmp2 ~ dnorm(0, hyper[2,1])     
  d[1] <- tmp2
	for(i in 1:(p.xsum-1))
	{
		d.tmp[i,1] ~ dnorm(0, hyper[2,2]) 
    
		d.tmp[i,2] ~ dnorm(0.0,taud.L1[i]);  
    taud.L1[i] <- 1/sigmad.L1[i]; 	        
    sigmad.L1[i] ~ dexp(hyper[2,3]); 
    
    d.tmp[i,3] ~ dnorm(0.0,taud.L2);
    		
		d.tmp[i,4] ~ dnorm(0.0,taud.ARD[i]);       
    taud.ARD[i] ~ dgamma(hyper[2,5], hyper[2,5]); 
    	          
    d[i+1] <- inprod(d.tmp[i, ],prior1[2,])
 	}
  taud.L2 ~ dgamma(hyper[2,4],hyper[2,4]);  
  
}

