Hi there,
for assessing the variable importance of a bayesian cox model with shrinkage priors i would like to use brs. The idea is to compute the PIP (Posterior Inclusion Probability) of each predictor and rank them.
I’ve seen that horseshoe prior can be used to shrink the coefficients and later I could check the inclusion probability.
Do you have a suggestion of how this could work and the possible configuration of the prior (horseshoe or other if it would perform better for my purposes)?
this is an idea, but i do not know about the horseshoe configuration and possible alterntive options
# Extract posterior samples of the coefficients
posterior <- posterior_samples(model)
# Calculate PIP for each predictor (proportion of samples where the coefficient is not zero)
PIP <- apply(posterior[, grep("b_", colnames(posterior))], 2, function(x) mean(x != 0))
model <- brm(
formula = y ~ x1 + x2 + x3,
data = data,
prior = c(
prior(normal(0, 5), class = "b"), # Prior for the regression coefficients
prior(horseshoe(), class = "b") # Horseshoe prior for variable selection
),chains = 4, iter = 2000)
something similar has been discussed in Help with lasso example in brms but I did not grasp the best methodology and priors to be used. Any help will be greatly appreciated.
Thank you!