Implement posterior::ess_mean with coda fallback (Issue #45) (#5)#46
Implement posterior::ess_mean with coda fallback (Issue #45) (#5)#46GiorgioMB wants to merge 11 commits intoquentingronau:masterfrom
posterior::ess_mean with coda fallback (Issue #45) (#5)#46Conversation
…onau#45) (#5) * Prepare Pull Request (#4) * Implement effective sample size computation function Added a helper function to compute effective sample size for iterative schemes, with fallback options for different methods. * Refactor effective sample size calculation Replaced effective sample size calculation with a custom function for consistency. * Implement tests for .bs_compute_neff function Add tests for .bs_compute_neff function behavior with and without posterior ESS. * Add messages for fallback cases in ESS computation * Add 'posterior' dependency to DESCRIPTION Added 'posterior' to the list of dependencies in DESCRIPTION. * Rename parameter 'use_neff' to 'use_ess' * Rename parameter for effective sample size function Updated parameter name from 'use_neff' to 'use_ess' in the helper function for effective sample size calculation. * Rename function and update effective sample size calculation * Replace neff computation with ess in bridge_sampler * Replace 'neff' with 'ess' in bridge sampler * Rename 'neff' to 'ess' in bridge_sampler_normal.R * Rename neff to ess for effective sample size * Rename tests for .bs_compute_ess function
|
Sorry for the delay at looking at that, the last two weeks of term were of course very busy again. I have two thoughts:
Makes sense? |
Add .onLoad function to set ESS function based on posterior package availability.
Refactor effective sample size computation to allow user-defined method and improve error handling.
Updated the documentation for the 'use_ess' parameter to clarify its default behavior and the method for effective sample size computation.
|
Dear Professor Singmann, |
|
Please have a look at my comments for function |
Refactor ESS calculation logic to improve validation and error handling.
|
Dear Professor,
|
As discussed in Issue #45, with the following, an internal helper,
.bs_compute_ess()does the following to compute the effective sample size:posterior::ess_mean()if the package is installed and the global optionbridgesampling.use_posterior_ess(default TRUE) is enabled.median(coda::effectiveSize()).nrow(samples)if both methods fail.test_ess.R)posteriortoSuggest:Additionally, it also renames all
use_neffandneffwithuse_essandessrespectively.