Skip to content

Add Traub's algorithm as solver option for Newton-style implementations#219

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-traubs-algorithm-option-again
Draft

Add Traub's algorithm as solver option for Newton-style implementations#219
Copilot wants to merge 2 commits intomainfrom
copilot/add-traubs-algorithm-option-again

Conversation

Copy link
Contributor

Copilot AI commented Jan 2, 2026

Implements Traub's method, a third-order root-finding algorithm, as an alternative to Newton's method throughout the package. Traub's method achieves cubic convergence with only two function evaluations per iteration by reusing the Jacobian, making it more efficient when Jacobian computation is expensive.

Changes

  • src/algorithms/nonlinear_solver.jl: Added traub() function with identical interface to newton()

    • Two-step iteration: y = x - f(x)/f'(x), then x_new = y - f(y)/f'(x)
    • Handles sparse/dense matrices, bound constraints, convergence tracking
  • src/filter/find_shocks.jl: Added find_shocks(::Val{:Traub}, ...) implementations

    • Second-order variant for 𝐒ⁱ²ᵉ problems
    • Third-order variant for 𝐒ⁱ³ᵉ problems
    • Follows LagrangeNewton pattern with Traub's two-step approach

Usage

filter_data_with_model(
    model,
    data,
    Val(:pruned_second_order),
    Val(:inversion);
    filter_algorithm = :Traub,  # Previously only :LagrangeNewton available
    opts = opts
)

Convergence characteristics:

  • Newton: 2nd order, 1 function + 1 Jacobian eval
  • Traub: 3rd order, 2 functions + 1 Jacobian eval
Original prompt

implement Traubs algorithm as an option for any newton and lageange newton style implementation in the package


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Traub's algorithm option for Newton and Lagrange implementations Add Traub's algorithm as solver option for Newton-style implementations Jan 2, 2026
Copilot AI requested a review from thorek1 January 2, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants