Is there any existing function in Rstan to compute DIC, AIC or BIC ？
No, nor are those much good. Use the
loo function in the loo package to compute the LOOIC, but you will need a simulations by observations matrix of log-likelihoods.
@zhanggf798 For more info, tutorials, and links to all the relevant research check out