#Bayesian robust MAP analysis with piecewise constant baseline hazard and #informative multivariate normal prior for alpha (baseline hazard) and #tau (precision of between-trial heterogeneity) model { ## Likelihoods ## for (i in 1:N) { # define the likelihood mu[i] <- TimeIntervals[i]*exp(alpha[Interval[i]]+inprod(par[],X[i,])+theta[Trial[i]]) EventsIntervals[i] ~ dpois(mu[i]); } #Informative multivariate normal prior on alpha, tau and par (covariate effects), #with reduced precision for robust component component ~ dcat(component_sizes) alpha ~ dmnorm(mean,precision_matrix[1:(K+1+P),1:(K+1+P),component]); tau <- exp(alpha[K+1]); #Theta's (trial specific effects) are normally distributed. #Here we set the population mean of the theta's to zero, #because the alpha's already describe the baseline hazard. for (i in minTrial:maxTrial){ theta[i] ~ dnorm(0, tau) } #Normal prior on parameters for (j in 1:P){ par[j] <- alpha[K+1+j]; } }