Closed luiarthur closed 4 years ago
Is the lp__
field in Stan the log posterior predictive probability?
lp__
in STAN is a "scaled" log likelihood. STAN has some clever way of getting rid of proportionality constants, to save on some computation, hence you get a scaled log likelihood (more correctly, log of the scaled likelihood). If done correctly, you can save quite a bit of compute. One issue with this is you have to be careful when using it to compare models. You have to know what exactly what constants are removed in the process.
I would be content with a log likelihood.
EDIT: After some investigation, I think lp__
is actually the log joint probability (likelihood x prior), up to a proportionality constant. I'm struggling to find an exact definition from the STAN page.
I think you can use the logprob
string macro for this or otherwise maybe also the predict
function. We currently don't have a flag that allows you to store the intermediate log joint or log-likelihood values while sampling.
@mohamed82008 is that correct?
Yes this is correct. The logprob macro is documented here https://turing.ml/dev/docs/using-turing/guide#querying-probabilities-from-model-or-chain.
Worked! Thanks.
In Turing, is there a way to get something like
lp__
in STAN?