ConstrainedStrategicEquilibrium.jl
ConstrainedStrategicEquilibrium.jl is a Julia package for solving Constrained Strategic Equilibrium (CSE) problems in game theory and economics.
It has been implemented based on the work by Armantier et al [1] and the Fortran code released alongside that publication.
Features
- Multiple Problem Types: Symmetric and asymmetric CSE problems
- Flexible Algorithms: Support for NonlinearSolve.jl solvers
- Built-in Visualization: Plotting recipes with RecipesBase
- Data Export: Results as DataFrames for easy analysis
Problem Types Supported
SymmetricAfrprogsCSEProblem- Symmetric piecewise linear CSE formSymmetricJaePoly1CSEProblem- Symmetric polynomial CSE formAsymmetricAfrprogsCSEProblem- Asymmetric piecewise linear CSE form
Quick start
Install the CSE package:
julia -e 'using Pkg; Pkg.add("ConstrainedStrategicEquilibrium")'Then in the julia repl (enter by running julia):
using ConstrainedStrategicEquilbrium
# create a CSE problem with default options
prob = SymmetricJaePoly1CSEProblem()
# solve the CSE problem
solutions = compute_cse(prob)
# print the vector of solutions
println(solutions)
# plot the last solution
using Plots
cseplot(solutions[end]; dpi=300)
savefig("jae-poly-1-result.png")
# store the computed CSE/BNE to csv file
using CSV
CSV.write("cse_result.csv", solutions[end].cse)