I believe that I have ran enough number of simulations and the Rhat for the paramters in the model are all like 1.00x (less than 1.01). But I am still confused about the following two questions:
Should I ignore the warning message?
Some paramters have relatively small n_eff, such as 3000 but in total I have ran 60000 simulations, will it just because of randomness or my model is misspecified?
You should not ignore the warnings, and you probably should not need to run that many iterations. It’s hard to say More without seeing how you specified your model.
Also I found that one of the paramters has n_eff 66314, which is greatly than the total number of simulations (60000). Does it mean that my calculation is wrong?
The estimated effective sample size is going to vary from run to run. That’s especially true when mixing is slow because then the adaptation is less reliable.
May I ask that is Rstan has some funtion like set.seed() so that I could make sure that every time I ran some Rstan code the output will be reproducible?
The stan() function in rstan has a seed parameter. The documentation says:
seed: The seed for random number generation. The default is generated from 1 to the maximum integer supported by **R** on the machine. Even if multiple chains are used, only one seed is needed, with other chains having seeds derived from that of the first chain to avoid dependent samples. When a seed is specified by a number, as.integer will be applied to it. If as.integer produces NA, the seed is generated randomly. The seed can also be specified as a character string of digits, such as "12345"` , which is converted to integer.
Using R 's set.seed function to set the seed for Stan will not work.`