You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of the post-v0.4.0 development plan (development/post-v040-development-plan.md, Phase 1, Task 4).
Context — this is a parity gap, not a new feature
The legacy generator supports exponential: R/create_con_var.R:279-281 (rexp(n_valid, rate = rate_val)), documented in advanced-topics and the metadata schema (rate column).
The plumbing already exists: the recodeflow adapter stores rate on the spec variable (R/mock_spec_recodeflow.R:365), and .new_mock_spec_variable() forwards extra fields via ....
Scope
Add rate = NA_real_ parameter to mock_continuous() and mock_spec_continuous(), forwarded to .new_mock_spec_variable().
Validator rule in .validate_mock_spec_variable() (next to the existing normal-distribution block at R/mock_spec.R:792-798): distribution == "exponential" requires rate > 0.
.generate_native_continuous() branch using inverse-CDF truncation to the declared range (qexp(runif(n, pexp(lo, rate), pexp(hi, rate)), rate)), mirroring .native_truncated_normal().
Document the intentional semantic difference: legacy rexp() is unbounded; native truncates to the declared range, consistent with the native normal. NEWS entry.
Out of scope: simstudy-backend exponential mapping; distribution registry (see plan, deferred register).
Acceptance
TDD; values within range; seed-reproducible; validator message tested.
Part of the post-v0.4.0 development plan (
development/post-v040-development-plan.md, Phase 1, Task 4).Context — this is a parity gap, not a new feature
R/create_con_var.R:279-281(rexp(n_valid, rate = rate_val)), documented inadvanced-topicsand the metadata schema (ratecolumn).R/mock_spec_native.R:202-208("Native backend does not yet support continuous distribution 'exponential'...") — so exponential metadata forces the v0.4→legacy fallback (which also switches RNG streams, Follow-ups from PR #32 review: loader validation, strict-mode semantics, doc polish #33 item 11).rateon the spec variable (R/mock_spec_recodeflow.R:365), and.new_mock_spec_variable()forwards extra fields via....Scope
rate = NA_real_parameter tomock_continuous()andmock_spec_continuous(), forwarded to.new_mock_spec_variable()..validate_mock_spec_variable()(next to the existing normal-distribution block atR/mock_spec.R:792-798):distribution == "exponential"requiresrate > 0..generate_native_continuous()branch using inverse-CDF truncation to the declared range (qexp(runif(n, pexp(lo, rate), pexp(hi, rate)), rate)), mirroring.native_truncated_normal().rexp()is unbounded; native truncates to the declaredrange, consistent with the native normal. NEWS entry.Out of scope: simstudy-backend exponential mapping; distribution registry (see plan, deferred register).
Acceptance
Relates to #24.