Open James-Thorson opened 9 years ago
Yes, the importance sampling weights can be used to diagnose problems with the Laplace approximation in the way you suggest, but I am not aware of any systematic study of how to draw a conclusion from the output.
Hans
Hi all,
I just re-tried using the importance sampler (option MCcontrol in MakeADFun, via internal function MC()), and see that it now reports the standard error of sampling -- very useful! Thank you whoever thought of that feature, which now gives some idea of whether the importance sample number is high enough.
However, it got me thinking that another potentially useful statistic would be the degree to which the Laplace approximation is a good representation of the probability of random effects (conditional on fixed par.last.best). I think this could be assessed by whether
log.density.target / log.density.propose ~ flat()
i.e., whether the ratio of proposal probability and likelihood is uniform. For a model with adequate samples (where the SE is low), I think that departures from uniformity would imply that the conditional probability of random effects is not well approximated by the Laplace approximation (which is being used to generate proposal samples).
Is my logic wrong here? If not, should I try to add code and submit a pull request (or does anyone else want to take a crack instead)?
jim