Symmetric CSE example - polynomial form

This is a simple example of how to run the jae_poly_1 symmetric CSE case from Computer_Code_CSE coming from the work by Armantier et al. [1].

Install CSE package

Enter the Julia REPL (julia) and run:

using Pkg
Pkg.add("ConstrainedStrategicEquilibrium")

Load required modules

using ConstrainedStrategicEquilibrium
using Plots
using NonlinearSolve
using Distributions

Create the symmetric CSE problem

Create the CSE problem with two players and a maximum n value of 12:

cse_prob = SymmetricJaePoly1CSEProblem(np=2, maxn=12)
SymmetricJaePoly1CSEProblem(np=2, mc=10000, n=1..12, Kumaraswamy(a=2.5, b=3.5))

Compute the CSE

Now compute the CSE for the problem we created

solutions = compute_cse(cse_prob)
12-element Vector{ConstrainedStrategicEquilibrium.SymmetricCSESolution}:
 SymmetricCSESolution(n=01, MSE=1.65e-03, C_1=NaN, C_2=3.27e-15)
 SymmetricCSESolution(n=02, MSE=4.73e-04, C_1=5.70e-03, C_2=9.08e-17)
 SymmetricCSESolution(n=03, MSE=4.39e-06, C_1=2.31e-03, C_2=1.97e-17)
 SymmetricCSESolution(n=04, MSE=1.37e-05, C_1=1.69e-04, C_2=3.64e-16)
 SymmetricCSESolution(n=05, MSE=8.48e-06, C_1=6.47e-04, C_2=2.86e-13)
 SymmetricCSESolution(n=06, MSE=2.28e-06, C_1=4.36e-04, C_2=1.59e-15)
 SymmetricCSESolution(n=07, MSE=2.51e-07, C_1=1.98e-04, C_2=8.47e-15)
 SymmetricCSESolution(n=08, MSE=1.07e-08, C_1=5.44e-05, C_2=2.49e-15)
 SymmetricCSESolution(n=09, MSE=1.32e-08, C_1=1.94e-06, C_2=2.16e-13)
 SymmetricCSESolution(n=10, MSE=1.29e-08, C_1=1.46e-05, C_2=8.96e-15)
 SymmetricCSESolution(n=11, MSE=1.06e-08, C_1=1.30e-05, C_2=4.36e-13)
 SymmetricCSESolution(n=12, MSE=1.03e-08, C_1=2.34e-07, C_2=3.09e-13)

Postprocessing

Plot the final successful solution comparing the computed CSE to the "analytical" Bayes-Nash Equilibrium.

for sol in Iterators.reverse(solutions)
    if sol.success
        cseplot(sol, dpi=400)
        savefig("jae-poly-1.png")
        break
    end
end

View the plot showing the CSE and BNE: jae-poly-1.png

References

  • [1] Armantier et al. Journal of Applied Econometrics, 23 (2008)

This page was generated using Literate.jl.