Repository navigation
Conversation
- Cameron: replace the made-up exponential constants with Dave Cameron's velocity-ratio model, f(d) = 13.49681 - 0.000030363*d + 835.7114/d^0.7905 (d in metres). The old constants were far more optimistic than Riegel for the marathon; the real model is more conservative. - Altitude: threshold 914.4 m -> 300 m with a linear ramp to the first NCAA point (no more 0% -> 1.41% jump at 915 m) and quadratic-fit extrapolation to 4000 m instead of a 5.90% cap from 2438 m. - Splits: negative/positive strategies use +-1% pace per half instead of +-4%. - Heat: extrapolate 35 C (8.7%) and 40 C (10.9%) from the 25->30 C slope.
All review phases will ship together in a single later release.
Cameron's f(d) crosses zero near 445 km, so long distances produced negative or absurd times. Add CAMERON_MAX_DISTANCE_KM (100 km, keeps '100k' usable) and raise ArgumentError when either distance exceeds it. Also strengthen the altitude continuity and YAML structure tests, and move the changelog entry under Unreleased, marking the removed CAMERON_A/B/C constants and the new range limit as breaking.
Owner
Author
|
Superseded by #97 (released as 2.0.0). |
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.
Phase F1a of the physiology review. Four models returned unrealistic numbers; this PR fixes them. Method names, signatures and return shapes don't change, and neither does the structure of
environmental_factors.yml. Only the returned values move, except that Cameron now rejects distances above 100 km. No version bump: all phases ship together in one later release, so the CHANGELOG entry sits under[Unreleased].Changes
cameron_predictor.rb): the olda + b·e^(−d/c)constants were not Cameron's formula. They gave 10K 42:00 → marathon 2:57:34, which is more optimistic than Riegel (3:13:12). This PR replaces them with Dave Cameron's velocity-ratio model,f(d) = 13.49681 − 0.000030363·d + 835.7114 / d^0.7905,T2 = T1·(D2/D1)·f(D1)/f(D2), with d in metres. Sources: Cameron's own metric version posted to the t-and-f list (2001-06-20, https://www.mail-archive.com/t-and-f@lists.uoregon.edu/msg11312.html) and the had2know.org Cameron calculator, which states metres and gives a worked example (3.5 mi in 51:30 → 5 mi in ~75:08). That example is pinned in a test.CAMERON_A/B/Care replaced by named constants for the new formula. Domain guard: f(d) crosses zero near 445 km, so a new constantCAMERON_MAX_DISTANCE_KM = 100.0makes every Cameron method raiseArgumentErrorwhen either distance is above 100 km. The model is fitted up to the marathon, and 100 km keeps'100k'usable.threshold_meters914.4 → 300, plus a new300: 0.0point, so the penalty ramps up instead of jumping at 915 m. The NCAA points are kept exactly. New extrapolated points3000: 7.92,3500: 9.97,4000: 12.2come from the quadratic fitp = 0.3647·x² + 1.9482·x,x = km − 0.3, and the YAML documents them as extrapolation. The0: 0.0point is removed.35: 8.7and40: 10.9continue the 25→30 °C slope of 0.44 points/°C and are marked as extrapolation.duration_factorand the ideal range are untouched.Compatibility checks
duration_factoris unchanged, and so are therace_splitssignature and strategy names.altitude.threshold_meters,altitude.data_points,heat.ideal_range_celsius,heat.data_points). Points were only added, apart from the redundant0: 0.0. A test pins this structure.CameronPredictor::CAMERON_A/B/Care removed, and Cameron raises above 100 km.Baseline diff (
gem_realismo/baseline.rb, main → this branch)Only the intended sections changed. Age grade, VO2max/zones, Riegel, VDOT, even splits and heat ≤ 30 °C are identical.
Verification
bundle exec rake test: 534 runs, 0 failures.bundle exec rubocop: 44 files, no offenses.test_documented_exampleschecks the single-line ones.Draft: do not merge before review. Merging to main publishes to RubyGems.