I try to reproduce a rstan experiment using pystan, but the results are not identical.
Of course, I am sure about this:
All the variables have the same values.
I use the same OS and computer.
I set the same seed in the R and Python experiment (at the beginning of the scripts) and the same seed in sampling rstan/pystan functions.
The printed model summary should be identical? Or is it normal to get different results (beta, eta, pi, epsilon?
Clue: When I run big experiments (chain=4 and iter=1000), the results are pretty similar (but donāt match), and when I run toy experiments (chain=1 and iter=5) the results are different.
Somewhere in transition, before this rng values are same. I had 2 chains where 1st chain had 187 extra calls for rng in RStan compared to PyStan. The seconds chain had 550 (donāt remember accurate diff right now) extra calls in PyStan compared to RStan.
Are these not already set by default? They could give some easy performance benefits to Pystan users, since the flags enable the maximum level of compiler optimisation and SIMD vectorisation.