Repository navigation
mc: exp keeps the rho grid inside lower_rho and upper_rho - #185
Closed
gitRasheed wants to merge 1 commit into
Closed
gitRasheed wants to merge 1 commit into
gitRasheed wants to merge 1 commit into
Conversation
…ounds) Mirrors R NNS.MC (OVVO-Financial/NNS mc-exp-bounds). exp warped |rho| about 0 (negative side to the power exp, positive side to 1/exp), so with bounds that do not straddle 0 symmetrically the grid left them: lower_rho=0.2, upper_rho=0.8, exp=2 gave 0.447 to 0.894, and [-0.8, -0.2] gave -0.64 to -0.04. Each side of 0, or of the bound nearest 0, is now warped within its own span, so the ends stay at the bounds and exp still moves the grid towards upper_rho. The default [-1, 1] grid is unchanged to the bit. _r_seq dropped a last point that rounding put a hair past stop, so seq(-0.8, -0.2, 0.2) had three points; it now clamps the end to stop and uses the 1e-10 count fuzz, as R's seq.default does. The NNS.MC.grid parity helper rebuilds R's grid in an inline script; it now carries R main's code (its output equals NNS.MC's replicate names on R main for the moved case). 1 of its 6 cache entries moves, (-0.5, 0.8, 0.1, exp 1.5); the other 5 are unchanged.
Contributor
|
Incorporated through NNS R 14.0 integration #192, merged as |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
R's
NNS.MCwarped the rho grid withexpabout 0: the negative side to the powerexp, the positive side to1/exp. With bounds that don't straddle 0 symmetrically the grid left them:lower_rho = 0.2, upper_rho = 0.8, exp = 2gave 0.447 to 0.894, and [-0.8, -0.2] gave -0.64 to -0.04. OVVO-Financial/NNS#146 (merged) warps each side of 0, or of the bound nearest 0, within its own span. This slice mirrors it.Stacked on #184; merge with a merge commit.
Changes
_generate_mc_rhos(mc.py) uses R's new warp. The ends stay at the bounds andexp > 1still moves the grid towardsupper_rho. The default [-1, 1] grid is unchanged to the bit._r_seqdropped a last point that rounding put a hair paststop, soseq(-0.8, -0.2, 0.2)had three points here and four in R. It now clamps the end tostopand uses R's 1e-10 count fuzz, asseq.defaultdoes. R's new bounds test needs this; it is a separate parity bug that predates DataFrame point_est / IVs.test columns are matched by position, and declared levels are ignored #146.Tests
NNS.MC. It now carries R main's code; its output for the moved case equals the replicate names ofNNS.MCon R main. 1 of its 6 cache entries moves, (-0.5, 0.8, by 0.1, exp 1.5); the other 5 are unchanged. The NNS.MC.stat_summary entries still match.NNS_DISABLE_NATIVE=1: 2913 passed, 29 skipped, 2 xpassed. The 3 xfails are mode: break tied discrete modes by gravity, not their mean (mirrors R #111) #178's strict ones and the 2 xpasses the existing non-strict live-R VAR xfails. tests/parity/test_practical_examples.py against the usual R library: 9 passed, 2 xfailed, as on mode: break tied discrete modes by gravity, not their mean (mirrors R #111) #178. ruff check is clean on every changed file.Review
GPT-6.1 Sol reviewed the #146, #147 and #148 mirrors together: SHIP.
Mirrors OVVO-Financial/NNS#146