Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add section about Pathfinder diagnostic and using for inits #833

Merged
merged 3 commits into from
Nov 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/reference-manual/pathfinder.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,29 @@ evaluations, with greater reductions for more challenging posteriors.
While the evaluations in @zhang_pathfinder:2022 found that
single-path and multi-path Pathfinder outperform ADVI for most of the models in the PosteriorDB evaluation set,
we recognize the need for further experiments on a wider range of models.

## Diagnosing Pathfinder

Pathfinder diagnoses the accuracy of the approximation by computing the density ratio of the true posterior and
the approximation and using Pareto-$\hat{k}$ diagnostic (Vehtari et al., 2024) to assess whether these ratios can
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use actual references here like "@zhang_pathfinder:2022"

be used to improve the approximation via resmapling. /, the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resmapling is misspelled.

I don't know what the / is doing here---should this be a different character?

normalization for the posterior can be estimated reliably (Section 3, Vehtari et al., 2024), which is the
first requirement for reliable resampling. If estimated Pareto-$\hat{k}$ for the ratios is smaller than 0.7,
there is still need to further diagnose importance sampling estimates by taking into account also the expetant
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know the word "expetant"---looks like it's Latin. Can we just write this in English?

function (Section 2.2, Vehtari et al., 2024). If estimated Pareto-$\hat{k}$ is larger than 0.7, then the
estimate for the normalization is unreliable and any Mote Carlo estimate may have a big error. The resampled draws
can still contain some useful information about the location and shape of the posterior which can be used in early
parts of Bayesian workflow (Gelman et al, 2020).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these should get turned into citations.


## Using Pathfinder for initializing MCMC

If estimated Pareto-$\hat{k}$ for the ratios is smaller than 0.7, the resampled posterior draws are almost as
good for initializing MCMC as would indepepent draws from the posterior be. If estimated Pareto-$\hat{k}$ for the
ratios is larger than 0.7, the Pathfinder draws are not reliable for posterior inference directly, but they are still
very likely better for initializing MCMC than random draws from an arbitrary pre-defined distribution (e.g. uniform from
-2 to 2 used by Stan by default). If Pareto-$\hat{k}$ is larger than 0.7, it is likely that one of the ratios is much bigger
than others and the default resampling with replacement would produce copies of one unique draw. For initializing several
Markov chains, it is better to use resampling without replacement to guarantee unique initialization for each chain. At the
moment Stan allows turning off the resampling completely, and then the resampling without replacement can be done outside of
Stan.