I just realized that the log-likelihood matrix of the stan fit varies if I use the following two ways to extract:
my_loglik <- extract(fit, pars = “log_lik”) (from “rstan” package)
my_loglik <- extract_log_lik(fit$fit,parameter_name = “log_lik”) (from “loo” package)
In theory, the value should not be affected by the way to extract. I don’t know why. I hope someone can explain this to me. Thanks a lot for your help and have a nice day!