How to evaluate log posterior probabilities at certain parameter values?

Only the stan model definition (.stan file) and posterior draws from that model are given. How can I compute the (unnormalized) log probabilities of these posterior samples?

Thank you!

If you don’t have access to the original stanfit object that has the log-probability stored internally, then you can use the log_prob function in rstan to recreate this. @avehtari has a great case study that walks through this in more detail: Visual illustration of Jacobian of parameter transformation

1 Like

Thank you for the answer and links! I am using pystan 3 whose documentation is a bit obscure. Will take a try!