cvxpy port#24
Open
jlperla wants to merge 2 commits into
Open
Conversation
Port the kernel-collocation solvers off pyomo onto cvxpy, behind an `--implementation cvxpy|pyomo` switch on the figure/table scripts (default cvxpy): - Convex (asset pricing): DCP QP via open-source solvers (OSQP/Clarabel/SCS/HiGHS). - Nonconvex (neoclassical growth, human capital, optimal advertising): cvxpy DNLP (prob.solve(nlp=True, ...)) solved in-process by UNO (unopy, default) or IPOPT (cyipopt). - Concave-convex growth: an exact DNLP reformulation of the Expr_if production kink, with z=k**a making the branches affine so cp.maximum(...) <= Y is a valid L-convex epigraph, plus two complementarity equalities pinning the marginal product and binding output to the envelope (no smoothing). Defaults to IPOPT; its threshold figure stays on pyomo, where the MPCC collocation is fragile on the high-steady-state approach band. unopy becomes a core dependency (UNO runs in-process, no PATH binary), and the standalone uno_ampl install instructions are dropped from the README. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…m start Switch the concave-convex bistable threshold figure from pyomo back to the pyomo-free cvxpy DNLP port: - Flat, complementarity-consistent warm start (k(t)=k_0, consumption at the capital-stationary level, P on the active production branch) that encodes no knowledge of the steady states or basins of attraction -- replacing the prior ramp toward k_star. - Domain bounds on k and mu keep filterSQP trial points in-domain, avoiding the uninterruptible restoration loop that previously hung UNO near the kink. - Default solver back to UNO; figure default back to cvxpy; UNO console output muted via logger=SILENT. Resolves the bistable structure away from the threshold; a couple of points right at the kink fail (Skiba ill-conditioning), which is left visible. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
TODO
|
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.
Summary
Pyomo-free cvxpy ports of the economic-dynamics models, solved in-process through cvxpy's DNLP interface (
prob.solve(nlp=True, ...)) with UNO (via theunopywheel) — no solver binary onPATHrequired. The existing pyomo/ipopt implementations remain selectable via--implementation pyomo.What's included
*_matern_cvxpy.pymodels: asset pricing, neoclassical growth (baseline), neoclassical human capital, optimal advertising, and concave-convex growth.figures_*.py,tables_neoclassical_growth.py) take--implementation cvxpy|pyomo, defaulting tocvxpy.pyproject.toml,uv.lock) and README notes on the two solver paths.Concave-convex threshold figure (final commit)
The bistable threshold sweep now runs on the cvxpy port with UNO instead of pyomo:
k(t)=k_0, consumption at the capital-stationary level, marginal productPseeded on the active production branch). It encodes no knowledge of the steady-state locations or basins of attraction — replacing the earlier ramp towardk_star.k,mukeep filterSQP trial points in-domain, avoiding the uninterruptible restoration loop that otherwise hung UNO near the kink.Per-solve cost away from the boundary (train_points=20): UNO ~14 ms vs ipopt ~10 ms (≈1.4×); full per-call wall comparable (~0.12–0.14 s, dominated by the jax interpolator recompile).
🤖 Generated with Claude Code