Skip to content

Handle infinite values in effectiveSizeEquivalentError() - #2

Open
ms609 wants to merge 1 commit into
afmagee:masterfrom
ms609:master
Open

Handle infinite values in effectiveSizeEquivalentError()#2
ms609 wants to merge 1 commit into
afmagee:masterfrom
ms609:master

Conversation

@ms609

@ms609 ms609 commented Sep 6, 2024

Copy link
Copy Markdown

In one of the simulated datasets (DS3, 1000 iterations), I've encountered infinite values in the jumpDistanceBootstrapESS estimate computed by effectiveSizeEquivalentError() in compute_errors.R.

I imagine that this is not a desirable situation... my workaround, implemented here, has been to replace the infinite values with NA, throw a warning, and proceed with the calculation – but this may not be appropriate.

@afmagee

afmagee commented Sep 11, 2024

Copy link
Copy Markdown
Owner

Well, that's not supposed to happen. Thanks for bringing this to my attention.

It seems most likely to me that something is going wrong in finds0Smoothed() and that's leading to a returned ESS of n / 0. In which case a better band-aid might be replacing the Inf with the number of samples. (If this is what's happening, removing these from consideration risks a downward bias in the estimated ESS* from jumpDistanceBootstrapESS.)

But it would be better to check things out and fix the issue at its source. Would you be willing and able to share a simulatedPosterior object that produces Inf results? I'm happy to look into this if I can reproduce it.

*In practice it's a really bad estimator of the ESS. Probably because it's actually an estimator of something more like the lag at which the sampling distribution of autocorrelation coefficients becomes statistically indistinguishable from 0.

@ms609

ms609 commented Sep 12, 2024

Copy link
Copy Markdown
Author

I've added you to my fork of the project on GitHub, and added the simulatedPosterior objects to the /simulation_study/output/ directory (files *MCMC*). I'm afraid I can't remember which was the offending object and don't have time right now to reproduce it, but I encountered it quite early when running the compute_errors.R script. (You may need to install.packages("TreeDist")).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants