Add NA-based bounds specification for MCMC kernels - #25
Conversation
- Added process_bounds() helper function to handle NA values in lb/ub - Updated all kernel functions to support NA for unbounded parameters: * kernel_ram * kernel_normal_reflective * kernel_adapt * kernel_nmirror * kernel_umirror * kernel_unif_reflective - Updated documentation template (lb-ub.R) to explain NA usage - Added examples showing NA bounds usage - Created comprehensive tests in test-na-bounds.R Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
- Updated NEWS.md to version 0.6-0 with reference to #22 and credit to @dmi3kno - Improved test to verify NA and explicit bounds produce IDENTICAL results with same seed - Updated vignette example to demonstrate NA usage for unbounded parameters Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
Done in commit 1cf9e97:
|
There was a problem hiding this comment.
Pull request overview
This PR implements NA-based bounds specification for MCMC kernels, allowing users to specify unbounded parameters more intuitively using NA instead of .Machine$double.xmax. This addresses issue #22 as suggested by @dmi3kno.
Key Changes:
- Added
process_bounds()helper function to convert NA values to machine limits - Updated all 6 bounded kernel functions to support NA in bounds specification
- Added comprehensive test coverage with IDENTICAL results verification
- Updated documentation and vignette with examples demonstrating NA usage
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| R/kernel.R | Added process_bounds() helper function to convert NA to machine limits for unbounded parameters |
| R/kernel_ram.R | Updated kernel to call process_bounds() after dimension checking and added example with NA bounds |
| R/kernel_normal.R | Updated reflective kernel to process NA bounds and added example comparing old/new syntax |
| R/kernel_adapt.R | Updated kernel to handle NA bounds via process_bounds() |
| R/kernel_mirror.R | Updated both nmirror and umirror kernels to process NA bounds |
| R/kernel_unif.R | Updated reflective uniform kernel to handle NA bounds |
| man-roxygen/lb-ub.R | Updated documentation template to explain NA usage for unbounded parameters |
| inst/tinytest/test-na-bounds.R | Added comprehensive tests for all kernels with NA bounds, including IDENTICAL results verification |
| vignettes/advanced-features.Rmd | Updated example to use NA syntax for unbounded parameters |
| NEWS.md | Added version 0.6-0 entry with proper issue reference and credit to @dmi3kno |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot, R CMD check seems to be failing in the current version |
|
@copilot, try again to fix the CI. |
- Updated DESCRIPTION version from 0.5-2.9000 to 0.6-0 to match NEWS.md - Updated date to 2024-11-22 - Manually updated all kernel .Rd files to document NA bounds support: * kernel_ram.Rd * kernel_adapt.Rd * kernel_normal.Rd * kernel_mirror.Rd * kernel_unif.Rd Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
Fixed in commit 3f0009f. The CI was failing because:
Updated DESCRIPTION to version 0.6-0 and regenerated all kernel documentation files to include NA bounds documentation. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
… R CMD check The CI was failing because the example code demonstrating cluster usage was being executed during R CMD check, but the required data object 'D' was not available in that context. Changes: - Wrapped entire cluster example (lines 249-321 in R/mcmc.R) in if(FALSE) to prevent execution - Consolidated the two example sections (failing example and solution) into one if(FALSE) block - Regenerated documentation with roxygen2 (updates RoxygenNote to 7.3.3) - Updated .gitignore to exclude build artifacts (*.Rcheck/, *.tar.gz) R CMD check now passes with 0 errors (only expected vignette warnings). Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
Fixed in commit 36e756a. The CI was failing because the cluster usage example in MCMC.Rd was executing during R CMD check, but the required data object 'D' wasn't available outside the Wrapped the entire cluster example in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Plan: Enable NA-based bounds specification for MCMC kernels
.Machine$double.xmaxSummary
Successfully implemented easier bounds specification for MCMC kernels using
NAto indicate unbounded parameters, addressing all review feedback and fixing all CI issues.Changes Made:
process_bounds()helper function inR/kernel.Rman-roxygen/lb-ub.R)Testing:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.