Repository navigation
PALC: keep the state on the tangent line when p reaches p_min or p_max - #363
Open
ParadaCarleton wants to merge 3 commits into
Open
ParadaCarleton wants to merge 3 commits into
ParadaCarleton wants to merge 3 commits into
Conversation
…ound Clamping only the parameter left the state a full step out along the tangent, so the fixed-parameter corrector could converge onto another branch: on (x - λ)(x - λ - 3) = 0, a step of 4 from λ = 0 ended at x = 4 at p_max = 1. Claude-Session: https://claude.ai/code/session_01BEoUbvf41HZqywHoqybG7q
…ves a trial past a bound instead of aborting Claude-Session: https://claude.ai/code/session_0195j23m7MRde8V6ApNmKjBR
This branch has not been deployed
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.
PALC clamps the parameter at the ends of
[p_min, p_max], but both clamp onlyp. The statexstays where the unclamped step put it, so the point the solver works with no longer lies on the tangent line. This means the correction can converge onto a different branch, or evaluateFoutside its domain. The error occurs in two separate places:1. The predictor (
corrector!,Palc.jl:160-162). When the predictor(x_pred, p_pred) = (x, p) + ds·τlands past a bound,corrector!setsp_predto the bound and runs theNaturalcorrector at that parameter, starting fromx_pred. Butx_predbelongs to the overshot parameter, so the fixed-parameter Newton starts a full step's worth ofxbeyond where the curve meets the bound. If another branch is closer to that point, it converges there.Example:
F(x, λ) = (x − λ)(x − λ − 3), whose two branches arex = λandx = λ + 3. Start at(0, 0)withds = 4andp_max = 1. The tangent is(1, 1)/√2, so the predictor lands at about(2.83, 2.83).pis clamped to 1, butxstays at 2.83. Atλ = 1the roots arex = 1andx = 4, and 2.83 is closer to 4, so the continuation ends atx = 4, on the other branch.The fix moves the predictor to where its line meets the bound,
x + (bound − p)/(p_pred − p)·(x_pred − x), whenever the current point lies inside(p_min, p_max). In the example this isx = 1, the right root. The new testtest/continuation/palc_bound_predictor.jlruns this problem withSecantandBorderedtangents. We first hit this on a 3-player logit equilibrium branch that folds back just past the target parameter; the clamped step landed on the folded-back segment.2. The corrector iterates (
newton_palc). Each Newton iterate setsp = clamp(p − up, p_min, p_max)and keepsx − u. An iterate that wants to leave the interval is again moved inponly, so the next residual is evaluated at a point that no Newton step produced. WhenFis undefined past the bound, the line search can also evaluate it there and throw aDomainError. Here the corrector stops when an iterate leaves[p_min, p_max], so PALC rejects the step and shrinksdsas for any failed corrector. The testtest/continuation/palc_bounds.jlcovers this case.Both changes only affect steps that reach a bound; every step strictly inside the interval runs as before.
https://claude.ai/code/session_015sE9Latuiqsp6zSHQ1cshz