But I am getting the divergent transitions warning. So I increased the adapt_delta parameter .
stan(file="logistic_LASSO2.stan", data=data_stan,
control = list(adapt_delta = 0.99999,max_treedepth=15),
iter=2500, chains=4)
Still I am getting some divergent transitions. This is the pairs plot for the parameter lambda and the first regression coefficient . The model had 5 divergent transitions.
The divergent transitions appeared to scatter randomly. Can anybody advice how to improve the results so that I can get rid of this divergent transition warning ?
I am very much a novice, so be careful with my advice. I suggest you try much tighter priors on lambda and alpha1. The fat tails on the cauchy can cause problems and the very broad normal on alpha1 is allowing values that do not seem likely in a logistic regression. As an experiment, try normal(0, 3) or something like that on both of them.
Driving adapt_delta so close to one is probably not a useful approach. I know the warning message suggests that. From what I have read on this forum, a well specified model should not need such a high value.
@FJCC Thank you for your valuable advice. I will try priors for the intercept term as you mentioned. Also I will consider your advice regarding adapt_delta too. Also is it possible to know whether I could have done a different parametrization for beta coefficients ? Actually, I am trying different regularization priors. Unfortunately , almost every prior giving this divergent transitions warning .
I wish could dive into this but I got a bunch of “real” work dumped on me today and I can’t take the time. Two quick suggestions:
Try building some toy data with just a few parameters. Maybe two parameters that contribute to the output and one that is just noise. Can the model recover the correct values?
Can you post your data somewhere? If it is not tool big, I would be willing to play with it should I get the time. How big is the data set?
I hope one of the experts will see this thread and provide more guidance.
Hi Thank you reaching me out for helping me. I cannot share my data for privacy reasons. But I have a toy data set . When I try to apply the same model to that data, I am getting the same issues.
here i have upload my data and code. diabetes.csv (23.3 KB) logistic_model_reg_LASSO4.stan (654 Bytes)