I am using 250 warmup iteration and 250 sampling iteration while testing. I have increased it once which did not seem to change the amount of divergent transition.
I have palyed around with desolve and their ode45 method which is the most similiar to the solver integrated with stan. Changing max steps between 1e5 and 1e10 seems to have no marked effect on the results.
stepsize_traj.pdf (8.2 KB)
I also varied the absolute and relative tolerance between 1e-2 and 1e-14 in steps of 1e-2. What you can see it that the results a markedly different between 1e-2/1e-4(blue and red(appears red because of the overlay)) and the smaller tolerance results.
tolerance_traj.pdf (13.7 KB)
The stan model parameter looks like this now. Are there any further changes I could make. All parameter priors are now defined between 0 and 1.
real<lower=0, upper=1> k_scaled;
real<lower=0.05, upper=1> R_scaled;
real<lower=0, upper=20> k;
k = k_scaled*20;
R = R_scaled*120;
dn = pn - tr_delta;
ds = pow(2, k)* tr_delta*R + ps;
pn ~ uniform(0,1);
ps ~ uniform(0,1);
tr_delta ~ uniform(0,1);
k_scaled ~ uniform(0,1);
ds_label ~ uniform(0,1);
R_scaled ~ uniform(0.05,1);
sigma1 ~ uniform(0, 1);
sigma2 ~ uniform(0, 1);