Refactor to pass results table 'res' instead of posterior param 'pst'. It is more general purpose this way.